Subject: Re: [PATCH net 4/4] sh_eth: Fix serialisation of interrupt disable with interrupt & NAPI handlers

From: Sergei Shtylyov <[email-masked]>
Date: Thu, 22 Jan 2015 19:35:06 +0300

Hello.

On 01/22/2015 06:06 PM, Ben Hutchings wrote:

>>> In order to stop the RX path accessing the RX ring while it's being
>>> stopped or resized, we clear the interrupt mask (EESIPR) and then call
>>> free_irq() or synchronise_irq().  This is insufficient because the
>>> interrupt handler or NAPI poller may set EESIPR again after we clear
>>> it.

>>      Hm, how come the interrupt handler gets called when we have disabled all
>> interrupts?

> It may be running on another processor and racing with the function that
> clears EESIPR.

    Ah, I didn't think about SMP... but then we need more spinlock protection 
instead, no?

>> Is it unmaskable EESR.ECI interrupt? BTW, I'm not seeing where the
>> interrupt handler enables interrupts again; only NAPI poller does that AFAIK.

> Normally it only clears EESR_RX_CHECK, but as it cannot atomically clear
> a single bit of EESIPR this can result in setting other bits.

    This is again only possible on SMP kernel, right?

[...]

> Ben.

WBR, Sergei