Commit 18db594a authored by Johannes Berg's avatar Johannes Berg

mac80211: fix scheduled scan rtnl deadlock

When changing cfg80211 to use RTNL locking, this caused a
deadlock in mac80211 as it calls cfg80211_sched_scan_stopped()
from a work item that's on a workqueue that is flushed with
the RTNL held.

Fix this by simply using schedule_work(), the work only needs
to finish running before the wiphy is unregistered, no other
synchronisation (e.g. with suspend) is really required since
for suspend userspace is already blocked anyway when we flush
the workqueue so will only pick up the event after resume.

Cc: stable@vger.kernel.org
Fixes: 5fe231e8 ("cfg80211: vastly simplify locking")
Reported-and-tested-by: default avatarEliad Peller <eliadx.peller@intel.com>
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent 84a3d1c9
...@@ -1047,6 +1047,7 @@ void ieee80211_unregister_hw(struct ieee80211_hw *hw) ...@@ -1047,6 +1047,7 @@ void ieee80211_unregister_hw(struct ieee80211_hw *hw)
cancel_work_sync(&local->restart_work); cancel_work_sync(&local->restart_work);
cancel_work_sync(&local->reconfig_filter); cancel_work_sync(&local->reconfig_filter);
flush_work(&local->sched_scan_stopped_work);
ieee80211_clear_tx_pending(local); ieee80211_clear_tx_pending(local);
rate_control_deinitialize(local); rate_control_deinitialize(local);
......
...@@ -1088,6 +1088,6 @@ void ieee80211_sched_scan_stopped(struct ieee80211_hw *hw) ...@@ -1088,6 +1088,6 @@ void ieee80211_sched_scan_stopped(struct ieee80211_hw *hw)
trace_api_sched_scan_stopped(local); trace_api_sched_scan_stopped(local);
ieee80211_queue_work(&local->hw, &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