Subject: Re: [PATCH net] amd-xgbe: Do not schedule napi until ready

From: Tom Lendacky <[email-masked]>
Date: Wed, 25 Feb 2015 08:34:05 -0600

On 02/24/2015 10:25 PM, David Miller wrote:
> From: Tom Lendacky <[email-masked]>
> Date: Tue, 24 Feb 2015 10:48:01 -0600
>
>> It is possible that the ethernet device could not have been properly
>> shutdown when Linux begins executing, through firmware use for example.
>> Until the amd-xgbe module is loaded, interrupts associated with the
>> the device could be pending. Once the module is loaded and interrupts
>> are requested, the interrupt could fire right away. If napi support
>> has not been initialized then the poll function will be null and result
>> in a kernel panic when napi attempts to invoke the poll function. Add
>> a check to the interrupt routine to be sure napi has been initialized
>> before trying to schedule it.
>>
>> Also, move the napi enablement support to be a bit earlier during
>> startup and a bit later during shutdown to be certain napi support is
>> enabled while the device can perform DMA.
>>
>> Signed-off-by: Tom Lendacky <[email-masked]>
>
> This is not how you fix a problem like this.
>
> You should absolutely not request the IRQ for the device, nor should
> you enable NAPI, until the device and driver are both fully setup and
> able to process those events successfully.

Thanks for the feedback.  I'll rework the code/flow to not request the
IRQ until everything is ready.  Since the subject and description will
change quite a bit I'll just submit a new patch rather than a "v2."

Thanks,
Tom

>
> Trust me, you're not the first person to hit this kind of problem.
> :-)
>