Skip to content

Commit

Permalink
[PATCH] netpoll: fix netpoll lockup
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Ingo Molnar authored and Linus Torvalds committed Dec 12, 2006
1 parent d224a93 commit 3640543
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions net/core/netpoll.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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);
}
}

Expand Down

0 comments on commit 3640543

Please sign in to comment.