aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2013-11-06 04:34:36 -0500
committerJohannes Berg <johannes.berg@intel.com>2013-11-25 10:50:04 -0500
commit18db594a1005d908d995a2fc8f5a7bf4286fdca0 (patch)
treea5a9f4ba683bcafd3f6491d8cfea3c27fdc0bcf9 /net/mac80211
parent84a3d1c97d024acd1d27ebbc10cb95784b11f4e7 (diff)
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: 5fe231e87372 ("cfg80211: vastly simplify locking") Reported-and-tested-by: Eliad Peller <eliadx.peller@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211')
-rw-r--r--net/mac80211/main.c1
-rw-r--r--net/mac80211/scan.c2
2 files changed, 2 insertions, 1 deletions
diff --git a/net/mac80211/main.c b/net/mac80211/main.c
index 21d5d44444d0..e765f77bb97a 100644
--- a/net/mac80211/main.c
+++ b/net/mac80211/main.c
@@ -1047,6 +1047,7 @@ void ieee80211_unregister_hw(struct ieee80211_hw *hw)
1047 1047
1048 cancel_work_sync(&local->restart_work); 1048 cancel_work_sync(&local->restart_work);
1049 cancel_work_sync(&local->reconfig_filter); 1049 cancel_work_sync(&local->reconfig_filter);
1050 flush_work(&local->sched_scan_stopped_work);
1050 1051
1051 ieee80211_clear_tx_pending(local); 1052 ieee80211_clear_tx_pending(local);
1052 rate_control_deinitialize(local); 1053 rate_control_deinitialize(local);
diff --git a/net/mac80211/scan.c b/net/mac80211/scan.c
index 5ad66a83ef7f..bcc4833d7542 100644
--- a/net/mac80211/scan.c
+++ b/net/mac80211/scan.c
@@ -1088,6 +1088,6 @@ void ieee80211_sched_scan_stopped(struct ieee80211_hw *hw)
1088 1088
1089 trace_api_sched_scan_stopped(local); 1089 trace_api_sched_scan_stopped(local);
1090 1090
1091 ieee80211_queue_work(&local->hw, &local->sched_scan_stopped_work); 1091 schedule_work(&local->sched_scan_stopped_work);
1092} 1092}
1093EXPORT_SYMBOL(ieee80211_sched_scan_stopped); 1093EXPORT_SYMBOL(ieee80211_sched_scan_stopped);