wifi: iwlwifi: mvm: don't always unblock EMLSR
authorMiri Korenblit <miriam.rachel.korenblit@intel.com>
Sun, 5 May 2024 06:19:49 +0000 (09:19 +0300)
committerJohannes Berg <johannes.berg@intel.com>
Mon, 6 May 2024 14:33:23 +0000 (16:33 +0200)
When an event occurs to unblock EMLSR, the code attempts to re-enable
EMLSR. However, the current implementation always tries to activate
EMLSR, regardless of whether the blocker was set before the unblocking
event or not. If EMLSR was already unblocked, there is no need to
re-activate it.

Fixes: 6cf7df9f013f ("wifi: iwlwifi: mvm: Add helper functions to update EMLSR status")
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240505091420.eb861402dac9.I6a1d9f774f5551cfab60ea37b71a62640496af9b@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
drivers/net/wireless/intel/iwlwifi/mvm/link.c

index 1ce52adf317368ad7cbdbb40f1f767e4961f6068..79f048f54a216fb81129efaa475346ea9a464d48 100644 (file)
@@ -956,9 +956,11 @@ void iwl_mvm_unblock_esr(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
        if (WARN_ON(!(reason & IWL_MVM_BLOCK_ESR_REASONS)))
                return;
 
-       if (mvmvif->esr_disable_reason & reason)
-               IWL_DEBUG_INFO(mvm, "Unblocking EMSLR mode. reason = 0x%x\n",
-                              reason);
+       /* No Change */
+       if (!(mvmvif->esr_disable_reason & reason))
+               return;
+
+       IWL_DEBUG_INFO(mvm, "Unblocking EMSLR mode. reason = 0x%x\n", reason);
 
        mvmvif->esr_disable_reason &= ~reason;