Skip to content

Commit 2bc533b

Browse files
elpjmberg-intel
authored andcommitted
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: Eliad Peller <eliadx.peller@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
1 parent 1a57081 commit 2bc533b

2 files changed

Lines changed: 9 additions & 0 deletions

File tree

‎net/mac80211/main.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,7 @@ static void ieee80211_restart_work(struct work_struct *work)
248248

249249
/* wait for scan work complete */
250250
flush_workqueue(local->workqueue);
251+
flush_work(&local->sched_scan_stopped_work);
251252

252253
WARN(test_bit(SCAN_HW_SCANNING, &local->scanning),
253254
"%s called with hardware scan in progress\n", __func__);

‎net/mac80211/scan.c‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1213,6 +1213,14 @@ void ieee80211_sched_scan_stopped(struct ieee80211_hw *hw)
12131213

12141214
trace_api_sched_scan_stopped(local);
12151215

1216+
/*
1217+
* this shouldn't really happen, so for simplicity
1218+
* simply ignore it, and let mac80211 reconfigure
1219+
* the sched scan later on.
1220+
*/
1221+
if (local->in_reconfig)
1222+
return;
1223+
12161224
schedule_work(&local->sched_scan_stopped_work);
12171225
}
12181226
EXPORT_SYMBOL(ieee80211_sched_scan_stopped);

0 commit comments

Comments
 (0)