Re: [PATCH] drivers/net: fixed drivers that support netpoll usendo_start_xmit()

From: David Miller
Date: Fri Aug 14 2009 - 19:32:30 EST


From: Matt Mackall <mpm@xxxxxxxxxxx>
Date: Fri, 14 Aug 2009 10:33:39 -0500

> On Fri, 2009-08-14 at 13:12 +0800, DDD wrote:
>> The NETPOLL API requires that interrupts remain disabled in
>> netpoll_send_skb(). The use of spin_lock_irq() and spin_unlock_irq()
>> in the NETPOLL API callbacks causes the interrupts to get enabled and
>> can lead to kernel instability.
>>
>> The solution is to use spin_lock_irqsave() and spin_unlock_restore()
>> to prevent the irqs from getting enabled while in netpoll_send_skb().
...
>> Signed-off-by: Dongdong Deng <dongdong.deng@xxxxxxxxxxxxx>
>> Signed-off-by: Jason Wessel <jason.wessel@xxxxxxxxxxxxx>
>> Acked-by: Bruce Ashfield <bruce.ashfield@xxxxxxxxxxxxx>
>
> Acked-by: Matt Mackall <mpm@xxxxxxxxxxx>

Applied, thanks everyone.

> Perhaps we should also have a WARN_ONCE if start_xmit returns with
> interrupts enabled?

Probably a good idea.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/