Skip to contentSkip to conversation

mac80211: Clear wowlan flag when drv_suspend returns failure

PATCH In review Pontus Fuchs 2 participants 4 messages May 31, 2012 mac80211

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mac80211: Clear wowlan flag when drv_suspend returns failure

drv_resume can get called without a prior call to drv_suspend. Consider the following steps:

1. Suspend is started but driver's drv_suspend returns error.
2. Suspend is aborted. local->wowlan flag is left set.
3. Interface is removed.
4. Suspend again. This time open_count is 0 so drv_suspend is not called and local->wowlan not cleared.
5. On resume ieee80211_reconfig will call drv_resume since local->wowlan is set.

---
 net/mac80211/pm.c |    1 +
 1 file changed, 1 insertion(+)
net/mac80211/pm.c +1 -0
index af1c4e2..98c128b 100644
@@ -77,6 +77,7 @@ int __ieee80211_suspend(struct ieee80211_hw *hw, struct cfg80211_wowlan *wowlan)
 		int err = drv_suspend(local, wowlan);
 		if (err < 0) {
 			local->quiescing = false;
+			local->wowlan = false;
 			return err;
 		} else if (err > 0) {
 			WARN_ON(err != 1);
Signature · 1 line
1.7.9.5
#1 lore raw

Hi Pontus,

Quoted 6 lines · Pontus Fuchs

drv_resume can get called without a prior call to drv_suspend. Consider the following steps:

1. Suspend is started but driver's drv_suspend returns error.
2. Suspend is aborted. local->wowlan flag is left set.
3. Interface is removed.

got a doubt, in which path interface remove happens ?

Quoted 29 lines

4. Suspend again. This time open_count is 0 so drv_suspend is not called and local->wowlan not cleared.
5. On resume ieee80211_reconfig will call drv_resume since local->wowlan is set.

---
 net/mac80211/pm.c |    1 +

 1 file changed, 1 insertion(+)
net/mac80211/pm.c +1 -1
index af1c4e2..98c128b 100644
@@ -77,6 +77,7 @@ int __ieee80211_suspend(struct ieee80211_hw *hw, struct cfg80211_wowlan *wowlan)
                int err = drv_suspend(local, wowlan);
                if (err < 0) {
                        local->quiescing = false;
+                       local->wowlan = false;
                        return err;
                } else if (err > 0) {
                        WARN_ON(err != 1);
--

1.7.9.5

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

Signature · 2 lines
thanks,
shafi
#2 lore raw

Hi,

Quoted 5 lines
Quoted 3 lines

1. Suspend is started but driver's drv_suspend returns error.
2. Suspend is aborted. local->wowlan flag is left set.
3. Interface is removed.

got a doubt, in which path interface remove happens ?

Note that in between step 2 and 4 userspace is up and running again so I just use ifconfig to reproduce this.

Quoted 4 lines
Quoted 4 lines

4. Suspend again. This time open_count is 0 so drv_suspend is not called and local->wowlan not cleared.
5. On resume ieee80211_reconfig will call drv_resume since local->wowlan is set.

//Pontus

#3 lore raw
Quoted 8 lines · Pontus Fuchs

Hi,

Quoted 5 lines
Quoted 3 lines

1. Suspend is started but driver's drv_suspend returns error.
2. Suspend is aborted. local->wowlan flag is left set.
3. Interface is removed.

Quoted 5 lines
Quoted 1 line

got a doubt, in which path interface remove happens ?

Note that in between step 2 and 4 userspace is up and running again so I just use ifconfig to reproduce this.

thanks!

Quoted 9 lines
Quoted 6 lines
Quoted 6 lines

4. Suspend again. This time open_count is 0 so drv_suspend is not called and local->wowlan not cleared.
5. On resume ieee80211_reconfig will call drv_resume since local->wowlan is set.

//Pontus

Signature · 2 lines
thanks,
shafi