Re: [PATCH 2/2] drivers/net: fixed drivers that support netpolluse ndo_start_xmit()

From: Matt Mackall
Date: Fri Aug 21 2009 - 11:27:15 EST


On Fri, 2009-08-21 at 21:34 +0800, DDD wrote:
> The NETPOLL API requires that interrupts remain disabled in
> netpoll_send_skb(). The use of "A functions set" in the NETPOLL API
> callbacks causes the interrupts to get enabled and can lead to kernel
> instability.
>
> The solution is to use "B functions set" to prevent the irqs from
> getting enabled while in netpoll_send_skb().
>
> A functions set:
> local_irq_disable()/local_irq_enable()
> spin_lock_irq()/spin_unlock_irq()
> spin_trylock_irq()/spin_unlock_irq()
>
> B functions set:
> local_irq_save()/local_irq_restore()
> spin_lock_irqsave()/spin_unlock_irqrestore()
> spin_trylock_irqsave()/spin_unlock_irqrestore()
>
> Signed-off-by: Dongdong Deng <dongdong.deng@xxxxxxxxxxxxx>

Both of these look good to me, thanks.

Acked-by: Matt Mackall <mpm@xxxxxxxxxxx>

--
http://selenic.com : development and support for Mercurial and Linux


--
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/