From: Michael Buesch <mb@bu3sch.de>
To: Jiri Benc <jbenc@suse.cz>
Cc: John Linville <linville@tuxdriver.com>, linux-wireless@vger.kernel.org
Subject: [PATCH RFC] mac80211: Make stop_queues() usable
Date: Mon, 2 Jul 2007 22:35:38 +0200 [thread overview]
Message-ID: <200707022235.38791.mb@bu3sch.de> (raw)
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.
next reply other threads:[~2007-07-02 20:36 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-07-02 20:35 Michael Buesch [this message]
2007-07-03 4:09 ` [PATCH RFC] mac80211: Make stop_queues() usable 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200707022235.38791.mb@bu3sch.de \
--to=mb@bu3sch.de \
--cc=jbenc@suse.cz \
--cc=linux-wireless@vger.kernel.org \
--cc=linville@tuxdriver.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).