From: Jeff Garzik <jeff@garzik.org>
To: akpm@linux-foundation.org
Cc: netdev@vger.kernel.org, mitov@issp.bas.bg, davem@davemloft.net
Subject: Re: [patch for 2.6.25? 3/3] skge napi->poll() locking bug
Date: Thu, 27 Mar 2008 08:23:13 -0400 [thread overview]
Message-ID: <47EB91B1.8000307@garzik.org> (raw)
In-Reply-To: <200803270745.m2R7jEUA024166@imap1.linux-foundation.org>
akpm@linux-foundation.org wrote:
> From: Marin Mitov <mitov@issp.bas.bg>
>
> According to: Documentation/networking/netdevices.txt:
>
> <cite>
> napi->poll:
> ..........
> Context: softirq
> will be called with interrupts disabled by netconsole.
> </cite>
>
> napi->poll() could be called either with interrupts enabled
> (in softirq context) or disabled (by netconsole), so the irq flag
> should be preserved.
>
> Inspired by Ingo's resent forcedeth patch :-)
>
> Signed-off-by: Marin Mitov <mitov@issp.bas.bg>
> Acked-by: David S. Miller <davem@davemloft.net>
> Cc: Jeff Garzik <jeff@garzik.org>
> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
> ---
>
> drivers/net/skge.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff -puN drivers/net/skge.c~skge-napi-poll-locking-bug drivers/net/skge.c
> --- a/drivers/net/skge.c~skge-napi-poll-locking-bug
> +++ a/drivers/net/skge.c
> @@ -3199,12 +3199,14 @@ static int skge_poll(struct napi_struct
> skge_write8(hw, Q_ADDR(rxqaddr[skge->port], Q_CSR), CSR_START);
>
> if (work_done < to_do) {
> - spin_lock_irq(&hw->hw_lock);
> + unsigned long flags;
> +
> + spin_lock_irqsave(&hw->hw_lock, flags);
> __netif_rx_complete(dev, napi);
> hw->intr_mask |= napimask[skge->port];
> skge_write32(hw, B0_IMSK, hw->intr_mask);
> skge_read32(hw, B0_IMSK);
> - spin_unlock_irq(&hw->hw_lock);
> + spin_unlock_irqrestore(&hw->hw_lock, flags);
davem already has this
next prev parent reply other threads:[~2008-03-27 12:23 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-03-27 7:45 [patch for 2.6.25? 3/3] skge napi->poll() locking bug akpm
2008-03-27 10:03 ` Marin Mitov
2008-03-27 12:23 ` Jeff Garzik [this message]
2008-03-27 17:11 ` Andrew Morton
2008-03-27 21:57 ` David Miller
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=47EB91B1.8000307@garzik.org \
--to=jeff@garzik.org \
--cc=akpm@linux-foundation.org \
--cc=davem@davemloft.net \
--cc=mitov@issp.bas.bg \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.