From: Johannes Berg <johannes@sipsolutions.net>
To: John Linville <linville@tuxdriver.com>
Cc: linux-wireless <linux-wireless@vger.kernel.org>
Subject: [PATCH] mac80211: stop queues across suspend/resume
Date: Fri, 13 Mar 2009 11:43:36 +0100 [thread overview]
Message-ID: <1236941016.5235.10.camel@johannes.local> (raw)
Even though userland probably cannot submit packets, there might
still be some coming, and that's no good when the driver doesn't
expect them. Stop the queues across suspend/resume.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
---
net/mac80211/ieee80211_i.h | 1 +
net/mac80211/pm.c | 6 ++++++
2 files changed, 7 insertions(+)
--- wireless-testing.orig/net/mac80211/ieee80211_i.h 2009-03-13 11:40:31.000000000 +0100
+++ wireless-testing/net/mac80211/ieee80211_i.h 2009-03-13 11:40:41.000000000 +0100
@@ -598,6 +598,7 @@ enum queue_stop_reason {
IEEE80211_QUEUE_STOP_REASON_PS,
IEEE80211_QUEUE_STOP_REASON_CSA,
IEEE80211_QUEUE_STOP_REASON_AGGREGATION,
+ IEEE80211_QUEUE_STOP_REASON_SUSPEND,
};
struct ieee80211_master_priv {
--- wireless-testing.orig/net/mac80211/pm.c 2009-03-13 11:40:12.000000000 +0100
+++ wireless-testing/net/mac80211/pm.c 2009-03-13 11:40:56.000000000 +0100
@@ -11,6 +11,9 @@ int __ieee80211_suspend(struct ieee80211
struct ieee80211_if_init_conf conf;
struct sta_info *sta;
+ ieee80211_stop_queues_by_reason(hw,
+ IEEE80211_QUEUE_STOP_REASON_SUSPEND);
+
flush_workqueue(local->hw.workqueue);
/* disable keys */
@@ -113,5 +116,8 @@ int __ieee80211_resume(struct ieee80211_
ieee80211_configure_filter(local);
netif_addr_unlock_bh(local->mdev);
+ ieee80211_wake_queues_by_reason(hw,
+ IEEE80211_QUEUE_STOP_REASON_SUSPEND);
+
return 0;
}
reply other threads:[~2009-03-13 10:44 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=1236941016.5235.10.camel@johannes.local \
--to=johannes@sipsolutions.net \
--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