netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Matt Mackall <mpm@selenic.com>
To: DDD <Dongdong.deng@windriver.com>
Cc: davem@davemloft.net, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org, "Ashfield,
	Bruce" <Bruce.Ashfield@windriver.com>,
	jason.wessel@windriver.com
Subject: Re: [PATCH] drivers/net: fixed drivers that support netpoll use ndo_start_xmit()
Date: Fri, 14 Aug 2009 10:33:39 -0500	[thread overview]
Message-ID: <1250264019.3807.1301.camel@calx> (raw)
In-Reply-To: <1250226751.29401.82.camel@dengdd-desktop>

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

  reply	other threads:[~2009-08-14 15:33 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-14  5:12 [PATCH] drivers/net: fixed drivers that support netpoll use ndo_start_xmit() DDD
2009-08-14 15:33 ` Matt Mackall [this message]
2009-08-14 23:32   ` David Miller
2009-08-18  5:59     ` DDD

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1250264019.3807.1301.camel@calx \
    --to=mpm@selenic.com \
    --cc=Bruce.Ashfield@windriver.com \
    --cc=Dongdong.deng@windriver.com \
    --cc=davem@davemloft.net \
    --cc=jason.wessel@windriver.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).