linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mac80211: check whether scan is in progress before queueing scan_work
@ 2010-04-06  8:54 Teemu Paasikivi
  2010-04-06  9:06 ` Johannes Berg
  2010-04-09  8:09 ` Johannes Berg
  0 siblings, 2 replies; 13+ messages in thread
From: Teemu Paasikivi @ 2010-04-06  8:54 UTC (permalink / raw)
  To: linville; +Cc: linux-wireless, Teemu Paasikivi

As scan_work is queued from work_work it needs to be checked if scan
has been started during execution of work_work. Otherwise, when hw
scan is used, the stack gets error about hw being busy with ongoing
scan. This causes the stack to abort scan without notifying the driver
about it. This leads to a situation where the hw is scanning and the stack
thinks it's not. Then when the scan finishes, the stack will complain by
warnings.

Signed-off-by: Teemu Paasikivi <ext-teemu.3.paasikivi@nokia.com>
---
 net/mac80211/work.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/net/mac80211/work.c b/net/mac80211/work.c
index 1e1ea30..7bd8670 100644
--- a/net/mac80211/work.c
+++ b/net/mac80211/work.c
@@ -919,11 +919,16 @@ static void ieee80211_work_work(struct work_struct *work)
 		run_again(local, jiffies + HZ/2);
 	}
 
-	if (list_empty(&local->work_list) && local->scan_req)
+	mutex_lock(&local->scan_mtx);
+
+	if (list_empty(&local->work_list) && local->scan_req &&
+	    !local->scanning)
 		ieee80211_queue_delayed_work(&local->hw,
 					     &local->scan_work,
 					     round_jiffies_relative(0));
 
+	mutex_unlock(&local->scan_mtx);
+
 	mutex_unlock(&local->work_mtx);
 
 	ieee80211_recalc_idle(local);
-- 
1.5.6.3


^ permalink raw reply related	[flat|nested] 13+ messages in thread
* [PATCH] mac80211: check whether scan is in progress before queueing scan_work
@ 2010-04-09 10:07 Teemu Paasikivi
  0 siblings, 0 replies; 13+ messages in thread
From: Teemu Paasikivi @ 2010-04-09 10:07 UTC (permalink / raw)
  To: linville; +Cc: linux-wireless, Paasikivi Teemu.3 (EXT-Ixonos/Tampere)

From: Paasikivi Teemu.3 (EXT-Ixonos/Tampere) <ext-teemu.3.paasikivi@nokia.com>

As scan_work is queued from work_work it needs to be checked if scan
has been started during execution of work_work. Otherwise, when hw
scan is used, the stack gets error about hw being busy with ongoing
scan. This causes the stack to abort scan without notifying the driver
about it. This leads to a situation where the hw is scanning and the stack
thinks it's not. Then when the scan finishes, the stack will complain by
warnings.

Signed-off-by: Teemu Paasikivi <ext-teemu.3.paasikivi@nokia.com>
Reviewed-by: Johannes Berg <johannes@sipsolutions.net>
---
 net/mac80211/work.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/net/mac80211/work.c b/net/mac80211/work.c
index 1e1ea30..7bd8670 100644
--- a/net/mac80211/work.c
+++ b/net/mac80211/work.c
@@ -919,11 +919,16 @@ static void ieee80211_work_work(struct work_struct *work)
 		run_again(local, jiffies + HZ/2);
 	}
 
-	if (list_empty(&local->work_list) && local->scan_req)
+	mutex_lock(&local->scan_mtx);
+
+	if (list_empty(&local->work_list) && local->scan_req &&
+	    !local->scanning)
 		ieee80211_queue_delayed_work(&local->hw,
 					     &local->scan_work,
 					     round_jiffies_relative(0));
 
+	mutex_unlock(&local->scan_mtx);
+
 	mutex_unlock(&local->work_mtx);
 
 	ieee80211_recalc_idle(local);
-- 
1.5.6.3


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

end of thread, other threads:[~2010-04-09 10:12 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-06  8:54 [PATCH] mac80211: check whether scan is in progress before queueing scan_work Teemu Paasikivi
2010-04-06  9:06 ` Johannes Berg
2010-04-06  9:08   ` Johannes Berg
2010-04-06 10:16   ` Teemu Paasikivi
2010-04-06 10:27     ` Johannes Berg
2010-04-06 10:29       ` Johannes Berg
2010-04-06 11:05         ` Teemu Paasikivi
2010-04-06 16:23           ` Dan Williams
2010-04-06 17:17             ` Johannes Berg
2010-04-06 18:07               ` Dan Williams
2010-04-07  6:09         ` Teemu Paasikivi
2010-04-09  8:09 ` Johannes Berg
  -- strict thread matches above, loose matches on Subject: below --
2010-04-09 10:07 Teemu Paasikivi

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