提交 c36531b9 编写于 作者: M Mike McCormack 提交者: David S. Miller

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: NMike McCormack <mikem@ring3k.org>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 c32bbff8
...@@ -3176,7 +3176,9 @@ static void sky2_reset(struct sky2_hw *hw) ...@@ -3176,7 +3176,9 @@ static void sky2_reset(struct sky2_hw *hw)
static void sky2_detach(struct net_device *dev) static void sky2_detach(struct net_device *dev)
{ {
if (netif_running(dev)) { if (netif_running(dev)) {
netif_tx_lock(dev);
netif_device_detach(dev); /* stop txq */ netif_device_detach(dev); /* stop txq */
netif_tx_unlock(dev);
sky2_down(dev); sky2_down(dev);
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册