lkml.org 
[lkml]   [2009]   [Aug]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] drivers/net: fixed drivers that support netpoll use ndo_start_xmit()
From
Date
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().
>
> Call trace:
> netpoll_send_skb()
> {
> -> local_irq_save(flags)
> ---> dev->ndo_start_xmit(skb, dev)
> ---> spin_lock_irq()
> ---> spin_unlock_irq() *******here would enable the interrupt.
> ...
> -> local_irq_restore(flags)
> }
>
> Signed-off-by: Dongdong Deng <dongdong.deng@windriver.com>
> Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
> Acked-by: Bruce Ashfield <bruce.ashfield@windriver.com>

Acked-by: Matt Mackall <mpm@selenic.com>

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

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




\
 
 \ /
  Last update: 2009-08-14 17:37    [W:0.874 / U:0.096 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site