Hi David,

On Wed, May 6, 2015 at 7:36 AM, David Miller <[email protected]> wrote:
> From: Sonic Zhang <[email protected]>
> Date: Tue, 5 May 2015 15:55:53 +0800
>
>> From: Sonic Zhang <[email protected]>
>>
>> It is possible that poll_controller is called from netpoll.c with irq
>> already disabled. Unexpected interrupt may be triggered if always
>> enable irq before returning from poll_controller.
>>
>> Signed-off-by: Sonic Zhang <[email protected]>
>
> Nope, this is wrong.
>
> If you don't use disable_irq(), the interrupt handler can run in
> parallel on another cpu and you definitely do not want that.

How about change local_irq_save(flags) to
spin_lock_irqsave(&priv->lock, flags) ?

>
> There is nothing wrong with the interrupt triggering on the
> enable_irq() here.  If that causes some problem, there is a
> bug in this driver.

When I debug Linux kernel via KGDB over Ethernet, KGDB calls netpoll
API and stmmac_poll_controller to send UDP packets with all interrupts
disabled. KGDB assumes all interrupts keeps disabled when it is active
and doing UDP data transmission. Enabling interrupts in
stmmac_poll_controller causes KGDB re-enter exception and system halt.

Although KGDB over Ethernet is not part of the mainline tree, I feel
this patch is useful in case other kernel functions want to call
netpoll API with interrupts disabled.


Regards,

Sonic
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to