Subject: Re: [PATCH] igb: fix kexec with igb

From: [email-masked] (Eric W. Biederman)
Date: Sat, 07 Mar 2009 10:20:42 -0800

Yinghai Lu <[email-masked]> writes:

> On Fri, Mar 6, 2009 at 11:18 PM, Jesse Brandeburg
> <[email-masked]> wrote:
>> On Fri, Mar 6, 2009 at 8:33 PM, Yinghai Lu <[email-masked]> wrote:
>>>
>>> Impact: could probe igb
>>>
>>> Found one system with 82575EB, in the kernel that is kexeced, probe igb
>>> failed with -2.
>>>
>>> it looks like the same behavior happened on forcedeth.
>>>
>>> try to check system_state to make sure if put it on D3
>>>
>>> Signed-off-by: Yinghai Lu <[email-masked]>
>>>
>>> ---
>>>  drivers/net/igb/igb_main.c |   19 ++++++++++++++-----
>>>  1 file changed, 14 insertions(+), 5 deletions(-)
>>
>> I see the point of the patch, but I know for a fact that ixgbe when
>> enabled for MSI-X also doesn't work with kexec.
>>
>> so my questions are:
>> are you going to change every driver?
>
> i tend to only change driver that i have related HW.
>
>> why can't this be fixed in core kernel code instead?
> will check it.
>
>> Shouldn't pci_enable_device take it out of D3?
>> Or maybe it should be taken out of D3 immediately if someone tries to
>> ioremap any of the BARx registers?
>
>
> looks like second kernel can not detect the state any more.

I know this has historically been a problem with the e1000 NICs.
Placing the hardware in a state they can not get them out of on
the reboot path.

Last I heard (a couple of weeks ago?) we had code to bring devices out
of a low power state that was working for the e1000 driver.

YH can you look and see if you can find that code and if it works?

<rant>
Frankly I don't understand why anyone would want to power down a device
when they are rebooting or shutting down a computer.  That is a
system state change.  But it seems to be bleed over from the confusion
that has been the power management code.
</rant>

If we can teach the kernel to handle this case with the proper enables
and disables that would be great.  Otherwise let's look at getting the
responsibilities of the various methods sorted out so we can at least
say with certainty what the various methods are supposed to do and
not do.

Eric