summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2006-12-12 17:20:42 +0100
committerLinus Torvalds <torvalds@woody.osdl.org>2006-12-12 08:37:51 -0800
commit3640543df26fd38f31f0c6decc35c07be2a6307c (patch)
tree2d14a4e4bd5d36a2b123656a9793656088437723 /net
parentd224a93d91610fc641fbc5b234b32fcb84045a30 (diff)
downloadlinux-3.10-3640543df26fd38f31f0c6decc35c07be2a6307c.tar.gz
linux-3.10-3640543df26fd38f31f0c6decc35c07be2a6307c.tar.bz2
linux-3.10-3640543df26fd38f31f0c6decc35c07be2a6307c.zip
[PATCH] netpoll: fix netpoll lockup
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> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'net')
-rw-r--r--net/core/netpoll.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/net/core/netpoll.c b/net/core/netpoll.c
index a01abdd2d3e..823215d8e90 100644
--- a/net/core/netpoll.c
+++ b/net/core/netpoll.c
@@ -55,6 +55,7 @@ static void queue_process(struct work_struct *work)
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_struct *work)
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);
}
}