netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] sky2: Lock transmit queue while disabling device
@ 2009-12-31 10:55 Mike McCormack
  2009-12-31 15:58 ` Michael Breuer
                   ` (3 more replies)
  0 siblings, 4 replies; 20+ messages in thread
From: Mike McCormack @ 2009-12-31 10:55 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: netdev, flyboy, dhazelton, mbreuer, "netdev


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>
---
 drivers/net/sky2.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c
index faa4841..8ae8520 100644
--- a/drivers/net/sky2.c
+++ b/drivers/net/sky2.c
@@ -3176,7 +3176,9 @@ static void sky2_reset(struct sky2_hw *hw)
 static void sky2_detach(struct net_device *dev)
 {
 	if (netif_running(dev)) {
+		netif_tx_lock(dev);
 		netif_device_detach(dev);	/* stop txq */
+		netif_tx_unlock(dev);
 		sky2_down(dev);
 	}
 }
-- 
1.5.6.5


^ permalink raw reply related	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2010-01-07 18:08 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-12-31 10:55 [PATCH] sky2: Lock transmit queue while disabling device Mike McCormack
2009-12-31 15:58 ` Michael Breuer
2009-12-31 16:15   ` Daniel Hazelton
2009-12-31 16:33 ` Berck Nash
2009-12-31 18:51 ` Jarek Poplawski
2009-12-31 23:51   ` Mike McCormack
2010-01-01  3:06     ` Berck E. Nash
2010-01-01  6:42       ` Stephen Hemminger
2010-01-01 18:31     ` Jarek Poplawski
2010-01-04  2:44       ` Berck E. Nash
2010-01-04 13:49         ` [PATCH] sky2: Fix oops in sky2_xmit_frame() after TX timeout Jarek Poplawski
2010-01-04 18:26           ` Stephen Hemminger
2010-01-04 18:48             ` [PATCH v2] " Jarek Poplawski
2010-01-07  4:27 ` [PATCH] sky2: Lock transmit queue while disabling device David Miller
2010-01-07  6:35   ` Jarek Poplawski
2010-01-07  8:01     ` David Miller
2010-01-07  8:15       ` Jarek Poplawski
2010-01-07  8:19         ` David Miller
2010-01-07 13:48           ` Stephen Hemminger
2010-01-07 18:08           ` Stephen Hemminger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).