Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 32769814 authored by Arik Nemtsov's avatar Arik Nemtsov Committed by Johannes Berg
Browse files

mac80211: fix sched_scan restart on recovery



In case we were not suspended, the reconfig function returns without
configuring the scheduled scan.

Signed-off-by: default avatarArik Nemtsov <arikx.nemtsov@intel.com>
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent fab57a6c
Loading
Loading
Loading
Loading
+20 −20
Original line number Diff line number Diff line
@@ -1740,6 +1740,26 @@ int ieee80211_reconfig(struct ieee80211_local *local)
	ieee80211_wake_queues_by_reason(hw, IEEE80211_MAX_QUEUE_MAP,
					IEEE80211_QUEUE_STOP_REASON_SUSPEND);

	/*
	 * Reconfigure sched scan if it was interrupted by FW restart or
	 * suspend.
	 */
	mutex_lock(&local->mtx);
	sched_scan_sdata = rcu_dereference_protected(local->sched_scan_sdata,
						lockdep_is_held(&local->mtx));
	if (sched_scan_sdata && local->sched_scan_req)
		/*
		 * Sched scan stopped, but we don't want to report it. Instead,
		 * we're trying to reschedule.
		 */
		if (__ieee80211_request_sched_scan_start(sched_scan_sdata,
							 local->sched_scan_req))
			sched_scan_stopped = true;
	mutex_unlock(&local->mtx);

	if (sched_scan_stopped)
		cfg80211_sched_scan_stopped(local->hw.wiphy);

	/*
	 * If this is for hw restart things are still running.
	 * We may want to change that later, however.
@@ -1768,26 +1788,6 @@ int ieee80211_reconfig(struct ieee80211_local *local)
	WARN_ON(1);
#endif

	/*
	 * Reconfigure sched scan if it was interrupted by FW restart or
	 * suspend.
	 */
	mutex_lock(&local->mtx);
	sched_scan_sdata = rcu_dereference_protected(local->sched_scan_sdata,
						lockdep_is_held(&local->mtx));
	if (sched_scan_sdata && local->sched_scan_req)
		/*
		 * Sched scan stopped, but we don't want to report it. Instead,
		 * we're trying to reschedule.
		 */
		if (__ieee80211_request_sched_scan_start(sched_scan_sdata,
							 local->sched_scan_req))
			sched_scan_stopped = true;
	mutex_unlock(&local->mtx);

	if (sched_scan_stopped)
		cfg80211_sched_scan_stopped(local->hw.wiphy);

	return 0;
}