linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mac80211: Push idle state to driver before stop
@ 2010-12-15 18:54 Paul Stewart
  2010-12-16  6:59 ` Johannes Berg
  0 siblings, 1 reply; 19+ messages in thread
From: Paul Stewart @ 2010-12-15 18:54 UTC (permalink / raw)
  To: linux-wireless; +Cc: luis.rodriguez, johannes

Sometimes mac80211 doesn't push idle state downwards to the
driver.  Specifically, there are times in some functions where
the "local->hw.conf.flags & IEEE80211_CONF_IDLE" may change but
the equivalent of "drv_config(local, IEEE80211_CONF_CHANGE_IDLE)"
does not end up being called.  This is usually not all that
problematic except, for example, suspending and resuming an idle
ath9k device.  If the device isn't marked idle when
ieee80211_stop_device() is called, the device never gets put to
sleep, and will end up in an unresponsive state on resume.

As a precaution, explicitly call drv_config() before
ieee80211_stop_device(), which should be a no-op under normal
circumstances, but where this problem arises, it will shut down
the ath9k where necessary.

One example where this problem occurs is when I down an interface
while a scan is in progress on ath9k.  If the device was not shut
down correctly and the system suspends and resumes repeatedly with
ath9k, I end up with a fatal register read error (0x7000/deadbeef)
when trying to bring the interface back up.

Signed-off-by: Paul Stewart <pstew@google.com>
---
 net/mac80211/iface.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c
index b6db237..5af5a89 100644
--- a/net/mac80211/iface.c
+++ b/net/mac80211/iface.c
@@ -536,6 +536,7 @@ static void ieee80211_do_stop(struct ieee80211_sub_if_data *sdata,
 		if (local->ops->napi_poll)
 			napi_disable(&local->napi);
 		ieee80211_clear_tx_pending(local);
+		drv_config(local, IEEE80211_CONF_CHANGE_IDLE);
 		ieee80211_stop_device(local);
 
 		/* no reconfiguring after stop! */
-- 
1.7.3.1


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

end of thread, other threads:[~2011-01-05 22:57 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-12-15 18:54 [PATCH] mac80211: Push idle state to driver before stop Paul Stewart
2010-12-16  6:59 ` Johannes Berg
2010-12-16 11:17   ` Paul Stewart
2010-12-16 11:30     ` Johannes Berg
2010-12-16 11:51       ` Paul Stewart
2010-12-16 12:04         ` Johannes Berg
2010-12-16 12:27           ` Paul Stewart
2010-12-16 12:35             ` Johannes Berg
2010-12-16 12:46               ` Paul Stewart
2010-12-16 12:53                 ` Johannes Berg
2010-12-16 16:02                   ` Paul Stewart
2010-12-16 17:44                     ` Luis R. Rodriguez
2010-12-16 17:49                       ` Luis R. Rodriguez
2010-12-16 19:08                       ` Paul Stewart
2010-12-16 19:12                         ` Luis R. Rodriguez
2011-01-04 18:19                       ` Paul Stewart
2011-01-04 22:29                         ` Paul Stewart
2011-01-05 18:26                           ` Luis R. Rodriguez
2011-01-05 22:57                             ` Luis R. Rodriguez

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