wifi: iwlwifi: mld: Block EMLSR only when ready to enter ROC
authorPagadala Yesu Anjaneyulu <pagadala.yesu.anjaneyulu@intel.com>
Fri, 9 May 2025 10:44:51 +0000 (13:44 +0300)
committerMiri Korenblit <miriam.rachel.korenblit@intel.com>
Sat, 10 May 2025 18:43:04 +0000 (21:43 +0300)
If one of the stages in starting a ROC failed,
the ROC will not start nor end so EMLSR will stay blocked forever.

Block EMLSR once all ROC conditions are validated and
clear EMLSR blocked reasons in mld_vif cleanup.

Signed-off-by: Pagadala Yesu Anjaneyulu <pagadala.yesu.anjaneyulu@intel.com>
Link: https://patch.msgid.link/20250509104454.2582160-13-miriam.rachel.korenblit@intel.com
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
drivers/net/wireless/intel/iwlwifi/mld/iface.c
drivers/net/wireless/intel/iwlwifi/mld/roc.c

index 3aacca5ed6a3a610b7e718e8296fe20f43e220d7..235b55e0fe5940af3f4400b27993ab38825f4ef3 100644 (file)
@@ -22,6 +22,8 @@ void iwl_mld_cleanup_vif(void *data, u8 *mac, struct ieee80211_vif *vif)
        struct iwl_mld *mld = mld_vif->mld;
        struct iwl_mld_link *link;
 
+       mld_vif->emlsr.blocked_reasons &= ~IWL_MLD_EMLSR_BLOCKED_ROC;
+
        if (mld_vif->aux_sta.sta_id != IWL_INVALID_STA)
                iwl_mld_free_internal_sta(mld, &mld_vif->aux_sta);
 
index ac52cc06e4d61517ffd88a2b4ec8959b42b49b62..cfd010c1ca8067020269bd23f5ff80ee941e0d2f 100644 (file)
@@ -49,13 +49,6 @@ int iwl_mld_start_roc(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
 
        lockdep_assert_wiphy(mld->wiphy);
 
-       ieee80211_iterate_active_interfaces_mtx(mld->hw,
-                                               IEEE80211_IFACE_ITER_NORMAL,
-                                               iwl_mld_vif_iter_emlsr_block_roc,
-                                               &ret);
-       if (ret)
-               return ret;
-
        /* TODO: task=Hotspot 2.0 */
        if (vif->type != NL80211_IFTYPE_P2P_DEVICE) {
                IWL_ERR(mld, "NOT SUPPORTED: ROC on vif->type %d\n",
@@ -79,6 +72,13 @@ int iwl_mld_start_roc(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
        if (WARN_ON(mld_vif->roc_activity != ROC_NUM_ACTIVITIES))
                return -EBUSY;
 
+       ieee80211_iterate_active_interfaces_mtx(mld->hw,
+                                               IEEE80211_IFACE_ITER_NORMAL,
+                                               iwl_mld_vif_iter_emlsr_block_roc,
+                                               &ret);
+       if (ret)
+               return ret;
+
        ret = iwl_mld_add_aux_sta(mld, aux_sta);
        if (ret)
                return ret;