linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH RFC] mac80211: Make stop_queues() usable
@ 2007-07-02 20:35 Michael Buesch
  2007-07-03  4:09 ` Michael Wu
  0 siblings, 1 reply; 10+ messages in thread
From: Michael Buesch @ 2007-07-02 20:35 UTC (permalink / raw)
  To: Jiri Benc; +Cc: John Linville, linux-wireless

stop_queues() is currently not usable, as it races with
the TX path and generates hard to debug system freezes.

In the driver we must be able to stop and flush (!) the
TX queues before we shutdown the device.
Otherwise the TX handlers race against the device shutdown.
But stop_queues lacks some locking against the TX handlers.

stop_queues is only safe to call inside of the TX handler,
but there's it's useless to call.

I have no idea what's needed to get this working properly,
so here's an untested patch for RFC.


Index: mac80211/net/mac80211/ieee80211.c
===================================================================
--- mac80211.orig/net/mac80211/ieee80211.c	2007-06-25 17:32:32.000000000 +0200
+++ mac80211/net/mac80211/ieee80211.c	2007-07-02 22:29:03.000000000 +0200
@@ -5063,10 +5063,14 @@ EXPORT_SYMBOL(ieee80211_start_queues);
 
 void ieee80211_stop_queues(struct ieee80211_hw *hw)
 {
+	struct ieee80211_local *local = hw_to_local(hw);
+	struct net_device *mdev = local->mdev;
 	int i;
 
+	netif_tx_lock_bh(mdev);
 	for (i = 0; i < hw->queues; i++)
 		ieee80211_stop_queue(hw, i);
+	netif_tx_unlock_bh(mdev);
 }
 EXPORT_SYMBOL(ieee80211_stop_queues);
 

-- 
Greetings Michael.

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

end of thread, other threads:[~2007-07-03 17:49 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-02 20:35 [PATCH RFC] mac80211: Make stop_queues() usable Michael Buesch
2007-07-03  4:09 ` Michael Wu
2007-07-03  8:39   ` Michael Buesch
2007-07-03 12:31     ` Patrick McHardy
2007-07-03 12:39       ` Michael Buesch
2007-07-03 12:56         ` Patrick McHardy
2007-07-03 17:15     ` Michael Wu
2007-07-03 17:36       ` Michael Buesch
2007-07-03 17:41         ` Michael Wu
2007-07-03 17:47           ` Michael Buesch

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).