public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@elte.hu>
To: Linus Torvalds <torvalds@osdl.org>
Cc: Andrew Morton <akpm@osdl.org>,
	"David S. Miller" <davem@davemloft.net>,
	Thomas Gleixner <tglx@linutronix.de>,
	Herbert Xu <herbert@gondor.apana.org.au>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: [patch] netpoll: fix netpoll lockup
Date: Tue, 12 Dec 2006 17:20:42 +0100	[thread overview]
Message-ID: <20061212162042.GA18359@elte.hu> (raw)
In-Reply-To: <Pine.LNX.4.64.0612120811180.6452@woody.osdl.org>


* Linus Torvalds <torvalds@osdl.org> wrote:

> On Tue, 12 Dec 2006, Ingo Molnar wrote:
> > 
> > current -git doesnt boot on my laptop due to the following netpoll 
> > breakages:
> > 
> >  - unlock the tx lock in the else branch too ...
> >  - use irq-safe locking instead of bh-safe locking, netpoll is
> >    often called from irq context.
> 
> This one doesn't apply for me any more, probably because David checked 
> in the patch from Andrew that fixed at least _part_ of the problem.
> 
> Davem, Ingo, Herbert, can you verify whether the fixes in the current 
> -git tree replace this patch from Ingo, or whether Ingo's patch is 
> still needed and just needs to be refreshed.

the first half of it is still needed - find the delta patch ontop of 
current -git below.

	Ingo

------------------------>
Subject: [patch] netpoll: fix netpoll lockup
From: Ingo Molnar <mingo@elte.hu>

current -git doesnt boot on my laptop due to netpoll
not unlocking the tx lock in the else branch.

booted this up on my laptop with lockdep enabled and there are
no locking complaints and it works fine.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
 net/core/netpoll.c |    9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

Index: linux-hres-timers.q/net/core/netpoll.c
===================================================================
--- linux-hres-timers.q.orig/net/core/netpoll.c
+++ linux-hres-timers.q/net/core/netpoll.c
@@ -55,6 +55,7 @@ static void queue_process(struct work_st
 	struct netpoll_info *npinfo =
 		container_of(work, struct netpoll_info, tx_work.work);
 	struct sk_buff *skb;
+	unsigned long flags;
 
 	while ((skb = skb_dequeue(&npinfo->txq))) {
 		struct net_device *dev = skb->dev;
@@ -64,15 +65,19 @@ static void queue_process(struct work_st
 			continue;
 		}
 
-		netif_tx_lock_bh(dev);
+		local_irq_save(flags);
+		netif_tx_lock(dev);
 		if (netif_queue_stopped(dev) ||
 		    dev->hard_start_xmit(skb, dev) != NETDEV_TX_OK) {
 			skb_queue_head(&npinfo->txq, skb);
-			netif_tx_unlock_bh(dev);
+			netif_tx_unlock(dev);
+			local_irq_restore(flags);
 
 			schedule_delayed_work(&npinfo->tx_work, HZ/10);
 			return;
 		}
+		netif_tx_unlock(dev);
+		local_irq_restore(flags);
 	}
 }
 

  reply	other threads:[~2006-12-12 16:23 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-12-12 10:16 [patch] netpoll: fix netpoll lockups Ingo Molnar
2006-12-12 12:49 ` [patch] net, 8139too.c: fix netpoll deadlock Ingo Molnar
2006-12-12 13:28   ` Jeff Garzik
2006-12-12 21:49     ` Francois Romieu
2006-12-13  1:12       ` Ingo Molnar
2007-02-14  2:30         ` Atsushi Nemoto
2007-02-16  4:33           ` Atsushi Nemoto
2006-12-12 16:13 ` [patch] netpoll: fix netpoll lockups Linus Torvalds
2006-12-12 16:20   ` Ingo Molnar [this message]
2006-12-12 21:00     ` [patch] netpoll: fix netpoll lockup Herbert Xu

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=20061212162042.GA18359@elte.hu \
    --to=mingo@elte.hu \
    --cc=akpm@osdl.org \
    --cc=davem@davemloft.net \
    --cc=herbert@gondor.apana.org.au \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tglx@linutronix.de \
    --cc=torvalds@osdl.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