Skip to contentSkip to conversation

mac80211: fix PS vs. scan race

PATCH In review Johannes Berg 3 participants 5 messages Apr 22, 2009 – Apr 30, 2009 mac80211

lore
Share & tools
lore

Johannes Berg

author maintainer
#0 lore raw

PATCH 1/1 mac80211: fix PS vs. scan race

When somebody changes the PS parameters while scanning is in progress, we enable PS -- during the scan. This is clearly not desirable, and we can just abort enabling PS when scanning since when the scan finishes it will be taken care of.

---
 net/mac80211/mlme.c |    7 +++++++
 1 file changed, 7 insertions(+)
net/mac80211/mlme.c +7 -0
@@ -487,6 +487,13 @@ static void ieee80211_enable_ps(struct i
 {
 	struct ieee80211_conf *conf = &local->hw.conf;
 
+	/*
+	 * If we are scanning right now then the parameters will
+	 * take effect when scan finishes.
+	 */
+	if (local->hw_scanning || local->sw_scanning)
+		return;
+
 	if (conf->dynamic_ps_timeout > 0 &&
 	    !(local->hw.flags & IEEE80211_HW_SUPPORTS_DYNAMIC_PS)) {
 		mod_timer(&local->dynamic_ps_timer, jiffies +
Reviewed-by on v1 1/1
#1 lore raw
Quoted 7 lines · Johannes Berg

When somebody changes the PS parameters while scanning is in progress, we enable PS -- during the scan. This is clearly not desirable, and we can just abort enabling PS when scanning since when the scan finishes it will be taken care of.

Signature · 1 line
Kalle Valo
author maintainer
#2 lore raw
In reply to Johannes Berg
Quoted 5 lines · Johannes Berg

When somebody changes the PS parameters while scanning is in progress, we enable PS -- during the scan. This is clearly not desirable, and we can just abort enabling PS when scanning since when the scan finishes it will be taken care of.

John, did this fall through the cracks? I see you included a patch from today but not this :)

johannes

Quoted 28 lines
---
 net/mac80211/mlme.c |    7 +++++++
 1 file changed, 7 insertions(+)
net/mac80211/mlme.c +7 -1
@@ -487,6 +487,13 @@ static void ieee80211_enable_ps(struct i
 {
 	struct ieee80211_conf *conf = &local->hw.conf;
 
+	/*
+	 * If we are scanning right now then the parameters will
+	 * take effect when scan finishes.
+	 */
+	if (local->hw_scanning || local->sw_scanning)
+		return;
+
 	if (conf->dynamic_ps_timeout > 0 &&
 	    !(local->hw.flags & IEEE80211_HW_SUPPORTS_DYNAMIC_PS)) {
 		mod_timer(&local->dynamic_ps_timer, jiffies +
 
 
--

To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

Reviewed-by Kalle Valo
#3 lore raw
Quoted 9 lines · Johannes Berg
Quoted 5 lines · Johannes Berg

When somebody changes the PS parameters while scanning is in progress, we enable PS -- during the scan. This is clearly not desirable, and we can just abort enabling PS when scanning since when the scan finishes it will be taken care of.

John, did this fall through the cracks? I see you included a patch from today but not this :)

Looks like this one (on wireless-testing#master)?

commit da6cbb045d04706157d3117153b275ed9126bd1d

Author: Johannes Berg <[email protected]>
Date:   Wed Apr 22 23:02:51 2009 +0200

mac80211: fix PS vs. scan race

When somebody changes the PS parameters while scanning is in progress, we enable PS -- during the scan. This is clearly not desirable, and we can just abort enabling PS when scanning since when the scan finishes it will be taken care of.

Signature · 2 lines
John W. Linville		Someday the world will need a hero, and you
[email protected]			might be all we have.  Be ready.
author maintainer
#4 lore raw
Quoted 7 lines · John W. Linville

Looks like this one (on wireless-testing#master)?

commit da6cbb045d04706157d3117153b275ed9126bd1d

Author: Johannes Berg <[email protected]>
Date:   Wed Apr 22 23:02:51 2009 +0200

mac80211: fix PS vs. scan race

Sorry, looks like I never learn... The patch still applied (probably with some fuzz) so I figured it wasn't in.

johannes