]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
wifi: iwlwifi: mld: refactor purging async notifications
authorMiri Korenblit <miriam.rachel.korenblit@intel.com>
Wed, 23 Apr 2025 06:16:36 +0000 (09:16 +0300)
committerJohannes Berg <johannes.berg@intel.com>
Wed, 23 Apr 2025 13:37:39 +0000 (15:37 +0200)
To cancel all async notifications, we need to:
- cancel async_handlers_wk
- empty async_handlers_list

Instead of having the callers to do both, do it in
iwl_mld_purge_async_handlers_list and rename it accordingly.

Note that the caller iwl_cleanup_mld didn't cancel the work, but it is
harmless.

Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Link: https://patch.msgid.link/20250423091408.e98aed77e836.Id9f858d9d553d406a24165b09db830df111befce@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
drivers/net/wireless/intel/iwlwifi/mld/mac80211.c
drivers/net/wireless/intel/iwlwifi/mld/mld.h
drivers/net/wireless/intel/iwlwifi/mld/notif.c
drivers/net/wireless/intel/iwlwifi/mld/notif.h

index 99e13cfd1e5feb693546302f238273dd8c572292..a7bddf7ab24f0eae152d87bfeccc1e703bf01277 100644 (file)
@@ -541,14 +541,10 @@ void iwl_mld_mac80211_stop(struct ieee80211_hw *hw, bool suspend)
            (IS_ENABLED(CONFIG_PM_SLEEP) && iwl_mld_no_wowlan_suspend(mld)))
                iwl_mld_stop_fw(mld);
 
-       /* HW is stopped, no more coming RX. OTOH, the worker can't run as the
-        * wiphy lock is held. Cancel it in case it was scheduled just before
-        * we stopped the HW.
+       /* HW is stopped, no more coming RX. Cancel all notifications in
+        * case they were sent just before stopping the HW.
         */
-       wiphy_work_cancel(mld->wiphy, &mld->async_handlers_wk);
-
-       /* Empty out the list, as the worker won't do that */
-       iwl_mld_purge_async_handlers_list(mld);
+       iwl_mld_cancel_async_notifications(mld);
 
        /* Clear in_hw_restart flag when stopping the hw, as mac80211 won't
         * execute the restart.
index 5eceaaf7696db6e30f28647f13c8ab5b3c3b45b5..c436eb4a6a6f5263478ab555fab6d324ef30fc20 100644 (file)
@@ -299,10 +299,10 @@ iwl_cleanup_mld(struct iwl_mld *mld)
 
        iwl_mld_low_latency_restart_cleanup(mld);
 
-       /* Empty the list of async notification handlers so we won't process
+       /* Cancel the async notification handlers so we won't process
         * notifications from the dead fw after the reconfig flow.
         */
-       iwl_mld_purge_async_handlers_list(mld);
+       iwl_mld_cancel_async_notifications(mld);
 }
 
 enum iwl_power_scheme {
index b8a3204c7847bdf99423db65922294e6bbe8ce3e..10f1bee89205adc673c7a017e413c69766ce587e 100644 (file)
@@ -662,10 +662,14 @@ void iwl_mld_async_handlers_wk(struct wiphy *wiphy, struct wiphy_work *wk)
        }
 }
 
-void iwl_mld_purge_async_handlers_list(struct iwl_mld *mld)
+void iwl_mld_cancel_async_notifications(struct iwl_mld *mld)
 {
        struct iwl_async_handler_entry *entry, *tmp;
 
+       lockdep_assert_wiphy(mld->wiphy);
+
+       wiphy_work_cancel(mld->wiphy, &mld->async_handlers_wk);
+
        spin_lock_bh(&mld->async_handlers_lock);
        list_for_each_entry_safe(entry, tmp, &mld->async_handlers_list, list) {
                iwl_mld_log_async_handler_op(mld, "Purged", &entry->rxb);
index 2eaa1d4e138ee08b435b8343f8e99697abb85478..adcdd9dec192d60159bfa89644dd85b664a086f8 100644 (file)
@@ -15,7 +15,7 @@ void iwl_mld_rx_rss(struct iwl_op_mode *op_mode, struct napi_struct *napi,
 
 void iwl_mld_async_handlers_wk(struct wiphy *wiphy, struct wiphy_work *wk);
 
-void iwl_mld_purge_async_handlers_list(struct iwl_mld *mld);
+void iwl_mld_cancel_async_notifications(struct iwl_mld *mld);
 
 enum iwl_mld_object_type {
        IWL_MLD_OBJECT_TYPE_NONE,