linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mac80211: Clear wowlan flag when drv_suspend returns failure
@ 2012-05-31 10:34 Pontus Fuchs
  2012-05-31 10:52 ` Mohammed Shafi
  0 siblings, 1 reply; 4+ messages in thread
From: Pontus Fuchs @ 2012-05-31 10:34 UTC (permalink / raw)
  To: johannes, linville; +Cc: linux-wireless

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.

Signed-off-by: Pontus Fuchs <pontus.fuchs@gmail.com>
---
 net/mac80211/pm.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/net/mac80211/pm.c b/net/mac80211/pm.c
index af1c4e2..98c128b 100644
--- a/net/mac80211/pm.c
+++ b/net/mac80211/pm.c
@@ -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


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

* Re: [PATCH] mac80211: Clear wowlan flag when drv_suspend returns failure
  2012-05-31 10:34 [PATCH] mac80211: Clear wowlan flag when drv_suspend returns failure Pontus Fuchs
@ 2012-05-31 10:52 ` Mohammed Shafi
  2012-05-31 10:55   ` Pontus Fuchs
  0 siblings, 1 reply; 4+ messages in thread
From: Mohammed Shafi @ 2012-05-31 10:52 UTC (permalink / raw)
  To: Pontus Fuchs; +Cc: johannes, linville, linux-wireless

Hi Pontus,

On Thu, May 31, 2012 at 4:04 PM, Pontus Fuchs <pontus.fuchs@gmail.com> wrote:
> 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 ?

> 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.
>
> Signed-off-by: Pontus Fuchs <pontus.fuchs@gmail.com>
> ---
>  net/mac80211/pm.c |    1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/net/mac80211/pm.c b/net/mac80211/pm.c
> index af1c4e2..98c128b 100644
> --- a/net/mac80211/pm.c
> +++ b/net/mac80211/pm.c
> @@ -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 majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html



-- 
thanks,
shafi

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

* Re: [PATCH] mac80211: Clear wowlan flag when drv_suspend returns failure
  2012-05-31 10:52 ` Mohammed Shafi
@ 2012-05-31 10:55   ` Pontus Fuchs
  2012-05-31 11:16     ` Mohammed Shafi
  0 siblings, 1 reply; 4+ messages in thread
From: Pontus Fuchs @ 2012-05-31 10:55 UTC (permalink / raw)
  To: Mohammed Shafi; +Cc: johannes, linville, linux-wireless

Hi,

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

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

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

* Re: [PATCH] mac80211: Clear wowlan flag when drv_suspend returns failure
  2012-05-31 10:55   ` Pontus Fuchs
@ 2012-05-31 11:16     ` Mohammed Shafi
  0 siblings, 0 replies; 4+ messages in thread
From: Mohammed Shafi @ 2012-05-31 11:16 UTC (permalink / raw)
  To: Pontus Fuchs; +Cc: johannes, linville, linux-wireless

On Thu, May 31, 2012 at 4:25 PM, Pontus Fuchs <pontus.fuchs@gmail.com> wrote:
> Hi,
>
>
>>> 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.

thanks!

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



-- 
thanks,
shafi

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

end of thread, other threads:[~2012-05-31 11:16 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-31 10:34 [PATCH] mac80211: Clear wowlan flag when drv_suspend returns failure Pontus Fuchs
2012-05-31 10:52 ` Mohammed Shafi
2012-05-31 10:55   ` Pontus Fuchs
2012-05-31 11:16     ` Mohammed Shafi

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