wifi: iwlwifi: mld: fix iwl_mld_emlsr_disallowed_with_link() return
authorJohannes Berg <johannes.berg@intel.com>
Thu, 24 Apr 2025 12:38:20 +0000 (15:38 +0300)
committerJohannes Berg <johannes.berg@intel.com>
Fri, 25 Apr 2025 09:26:32 +0000 (11:26 +0200)
The return type of iwl_mld_emlsr_disallowed_with_link() is a u32
bitmap of exit reasons, but in the data structure confusion case
where the warning triggers, it returns false. Add a new reason
bit for this case so it doesn't return that EMLSR is possible.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Reviewed-by: Benjamin Berg <benjamin.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250424153620.d1f8465e2b5e.I58c463c70801231a79b04c1ff600f41afcbb04f5@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
drivers/net/wireless/intel/iwlwifi/mld/iface.h
drivers/net/wireless/intel/iwlwifi/mld/mlo.c

index ec14d0736cee6eda7bf4d129ee5fe82651a56197..1ae522431f3f1e172cd60cf613ea5275d21d72fe 100644 (file)
@@ -59,6 +59,7 @@ enum iwl_mld_emlsr_blocked {
  *     loaded enough to justify EMLSR.
  * @IWL_MLD_EMLSR_EXIT_RFI: Exit EMLSR due to RFI
  * @IWL_MLD_EMLSR_EXIT_FW_REQUEST: Exit EMLSR because the FW requested it
+ * @IWL_MLD_EMLSR_EXIT_INVALID: internal exit reason due to invalid data
  */
 enum iwl_mld_emlsr_exit {
        IWL_MLD_EMLSR_EXIT_BLOCK                = 0x1,
@@ -72,6 +73,7 @@ enum iwl_mld_emlsr_exit {
        IWL_MLD_EMLSR_EXIT_CHAN_LOAD            = 0x100,
        IWL_MLD_EMLSR_EXIT_RFI                  = 0x200,
        IWL_MLD_EMLSR_EXIT_FW_REQUEST           = 0x400,
+       IWL_MLD_EMLSR_EXIT_INVALID              = 0x800,
 };
 
 /**
index bf158af5f6f33a8f5735060c75f0b11eb19b13d9..5c92c0a6818d5b607ba0a14aafcda0b8518daeb2 100644 (file)
@@ -52,7 +52,8 @@ static void iwl_mld_print_emlsr_blocked(struct iwl_mld *mld, u32 mask)
        HOW(BT_COEX)                    \
        HOW(CHAN_LOAD)                  \
        HOW(RFI)                        \
-       HOW(FW_REQUEST)
+       HOW(FW_REQUEST)                 \
+       HOW(INVALID)
 
 static const char *
 iwl_mld_get_emlsr_exit_string(enum iwl_mld_emlsr_exit exit)
@@ -647,7 +648,7 @@ iwl_mld_emlsr_disallowed_with_link(struct iwl_mld *mld,
 
        conf = wiphy_dereference(wiphy, vif->link_conf[link->link_id]);
        if (WARN_ON_ONCE(!conf))
-               return false;
+               return IWL_MLD_EMLSR_EXIT_INVALID;
 
        if (link->chandef->chan->band == NL80211_BAND_2GHZ && mld->bt_is_active)
                ret |= IWL_MLD_EMLSR_EXIT_BT_COEX;