aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorMike McCormack <mikem@ring3k.org>2009-12-30 19:55:31 -0500
committerDavid S. Miller <davem@davemloft.net>2010-01-06 23:26:14 -0500
commitc36531b9b2e00d9715c3a0f5788ac5311435e078 (patch)
tree54aeae5ce9b08d05370a6c96ddf0f27dadb1452c /drivers/net
parentc32bbff81c04096c7888aed3946ee90fdbfbc3a3 (diff)
sky2: Lock transmit queue while disabling device
netif_device_detach() does not take the tx_lock, so it's possible that a call to sky2_xmit_frame is still in progress after netif_device_detach() is complete. Take netif_tx_lock() to make sure all transmits have stopped while we're disabling the devices and that no other CPU is still transmitting a frame after we've disabling the device. Proposed fix for "sky2 panic under load" reported by Berck E. Nash. Signed-off-by: Mike McCormack <mikem@ring3k.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/sky2.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c
index faa48410195e..8ae8520baaf3 100644
--- a/drivers/net/sky2.c
+++ b/drivers/net/sky2.c
@@ -3176,7 +3176,9 @@ static void sky2_reset(struct sky2_hw *hw)
3176static void sky2_detach(struct net_device *dev) 3176static void sky2_detach(struct net_device *dev)
3177{ 3177{
3178 if (netif_running(dev)) { 3178 if (netif_running(dev)) {
3179 netif_tx_lock(dev);
3179 netif_device_detach(dev); /* stop txq */ 3180 netif_device_detach(dev); /* stop txq */
3181 netif_tx_unlock(dev);
3180 sky2_down(dev); 3182 sky2_down(dev);
3181 } 3183 }
3182} 3184}