diff mbox

mac80211: complete scan work immediately if quiesced or suspended

Message ID 1421962450-7096-1-git-send-email-emmanuel.grumbach@intel.com
State Accepted
Delegated to: Johannes Berg
Headers show

Commit Message

Emmanuel Grumbach Jan. 22, 2015, 9:34 p.m. UTC
From: Luciano Coelho <luciano.coelho@intel.com>

It is possible that a deferred scan is queued after the queues are
flushed in __ieee80211_suspend().  The deferred scan work may be
scheduled by ROC or ieee80211_stop_poll().

To make sure don't start a new scan while suspending, check whether
we're quiescing or suspended and complete the scan immediately if
that's the case.

Change-Id: I8ec2c8fb4d969833d45c77045b0f5594cc097086
Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
Reviewed-on: https://gerrit.rds.intel.com/r/51405
Tested-by: IWL Jenkins
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
---
 net/mac80211/scan.c | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Johannes Berg Jan. 23, 2015, 9:55 a.m. UTC | #1
On Thu, 2015-01-22 at 23:34 +0200, Emmanuel Grumbach wrote:
> From: Luciano Coelho <luciano.coelho@intel.com>
> 
> It is possible that a deferred scan is queued after the queues are
> flushed in __ieee80211_suspend().  The deferred scan work may be
> scheduled by ROC or ieee80211_stop_poll().
> 
> To make sure don't start a new scan while suspending, check whether
> we're quiescing or suspended and complete the scan immediately if
> that's the case.

Applied.

> Change-Id: I8ec2c8fb4d969833d45c77045b0f5594cc097086
> Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
> Reviewed-on: https://gerrit.rds.intel.com/r/51405
> Tested-by: IWL Jenkins
> Reviewed-by: Johannes Berg <johannes.berg@intel.com>

With all that fixed :)

johannes

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

Patch

diff --git a/net/mac80211/scan.c b/net/mac80211/scan.c
index 7807fa4..05f0d71 100644
--- a/net/mac80211/scan.c
+++ b/net/mac80211/scan.c
@@ -828,6 +828,11 @@  void ieee80211_scan_work(struct work_struct *work)
 
 	mutex_lock(&local->mtx);
 
+	if (!ieee80211_can_run_worker(local)) {
+		aborted = true;
+		goto out_complete;
+	}
+
 	sdata = rcu_dereference_protected(local->scan_sdata,
 					  lockdep_is_held(&local->mtx));
 	scan_req = rcu_dereference_protected(local->scan_req,