Commit 2bc533bd authored by Eliad Peller's avatar Eliad Peller Committed by Johannes Berg

mac80211: handle sched_scan_stopped vs. hw restart race

On hw restart, mac80211 might try to reconfigure already
stopped sched scan, if ieee80211_sched_scan_stopped_work()
wasn't scheduled yet.

This in turn will keep the device driver with scheduled scan
configured, while both mac80211 and cfg80211 will clear
their sched scan state once the work is scheduled.

Fix it by ignoring ieee80211_sched_scan_stopped() calls
while in hw restart, and flush the work before starting
the reconfiguration.
Signed-off-by: default avatarEliad Peller <eliadx.peller@intel.com>
Signed-off-by: default avatarEmmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent 1a57081a
...@@ -248,6 +248,7 @@ static void ieee80211_restart_work(struct work_struct *work) ...@@ -248,6 +248,7 @@ static void ieee80211_restart_work(struct work_struct *work)
/* wait for scan work complete */ /* wait for scan work complete */
flush_workqueue(local->workqueue); flush_workqueue(local->workqueue);
flush_work(&local->sched_scan_stopped_work);
WARN(test_bit(SCAN_HW_SCANNING, &local->scanning), WARN(test_bit(SCAN_HW_SCANNING, &local->scanning),
"%s called with hardware scan in progress\n", __func__); "%s called with hardware scan in progress\n", __func__);
......
...@@ -1213,6 +1213,14 @@ void ieee80211_sched_scan_stopped(struct ieee80211_hw *hw) ...@@ -1213,6 +1213,14 @@ void ieee80211_sched_scan_stopped(struct ieee80211_hw *hw)
trace_api_sched_scan_stopped(local); trace_api_sched_scan_stopped(local);
/*
* this shouldn't really happen, so for simplicity
* simply ignore it, and let mac80211 reconfigure
* the sched scan later on.
*/
if (local->in_reconfig)
return;
schedule_work(&local->sched_scan_stopped_work); schedule_work(&local->sched_scan_stopped_work);
} }
EXPORT_SYMBOL(ieee80211_sched_scan_stopped); EXPORT_SYMBOL(ieee80211_sched_scan_stopped);
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment