diff mbox series

[06/40] wifi: mac80211: flush wiphy work where appropriate

Message ID 20230828135927.4320ac0c3b18.I6367381100057ec84e8e7ebc6dfc4ac0b68282a4@changeid (mailing list archive)
State Accepted
Delegated to: Johannes Berg
Headers show
Series wifi: cfg80211/mac80211: locking cleanups | expand

Commit Message

Johannes Berg Aug. 28, 2023, 11:59 a.m. UTC
From: Johannes Berg <johannes.berg@intel.com>

Before converting more works to wiphy work, add
flushing in mac80211 where we also flush the
mac80211 workqueue. Not needed in suspend since
cfg80211 will have taken care of it.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 net/mac80211/main.c | 1 +
 net/mac80211/util.c | 1 +
 2 files changed, 2 insertions(+)
diff mbox series

Patch

diff --git a/net/mac80211/main.c b/net/mac80211/main.c
index 24315d7b3126..aeb21cfe789a 100644
--- a/net/mac80211/main.c
+++ b/net/mac80211/main.c
@@ -343,6 +343,7 @@  static void ieee80211_restart_work(struct work_struct *work)
 	rtnl_lock();
 	/* we might do interface manipulations, so need both */
 	wiphy_lock(local->hw.wiphy);
+	wiphy_work_flush(local->hw.wiphy, NULL);
 
 	WARN(test_bit(SCAN_HW_SCANNING, &local->scanning),
 	     "%s called with hardware scan in progress\n", __func__);
diff --git a/net/mac80211/util.c b/net/mac80211/util.c
index 8a6917cf63cf..6d8b73796dc5 100644
--- a/net/mac80211/util.c
+++ b/net/mac80211/util.c
@@ -2319,6 +2319,7 @@  void ieee80211_stop_device(struct ieee80211_local *local)
 	cancel_work_sync(&local->reconfig_filter);
 
 	flush_workqueue(local->workqueue);
+	wiphy_work_flush(local->hw.wiphy, NULL);
 	drv_stop(local);
 }