All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pontus Fuchs <pontus.fuchs@gmail.com>
To: johannes@sipsolutions.net, linville@tuxdriver.com
Cc: linux-wireless@vger.kernel.org
Subject: [PATCH] mac80211: Clear wowlan flag when drv_suspend returns failure
Date: Thu, 31 May 2012 12:34:47 +0200	[thread overview]
Message-ID: <1338460487-3277-1-git-send-email-pontus.fuchs@gmail.com> (raw)

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


             reply	other threads:[~2012-05-31 10:35 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-31 10:34 Pontus Fuchs [this message]
2012-05-31 10:52 ` [PATCH] mac80211: Clear wowlan flag when drv_suspend returns failure Mohammed Shafi
2012-05-31 10:55   ` Pontus Fuchs
2012-05-31 11:16     ` Mohammed Shafi

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=1338460487-3277-1-git-send-email-pontus.fuchs@gmail.com \
    --to=pontus.fuchs@gmail.com \
    --cc=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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.