Skip to content

Commit 847d735

Browse files
striebitjmberg-intel
authored andcommitted
wifi: iwlwifi: mvm: consider having one active link
Do not call iwl_mvm_mld_get_primary_link if only one link is active. In that case, the sole active link should be used. iwl_mvm_mld_get_primary_link returns -1 if only one link is active causing a warning. Fixes: 8c9bef2 ("wifi: iwlwifi: mvm: d3: implement suspend with MLO") Signed-off-by: Shaul Triebitz <shaul.triebitz@intel.com> Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com> Link: https://msgid.link/20240311081938.6c50061bf69b.I05b0ac7fa7149eabaa5570a6f65b0d9bfb09a6f1@changeid Signed-off-by: Johannes Berg <johannes.berg@intel.com>
1 parent bbe806c commit 847d735

1 file changed

Lines changed: 9 additions & 7 deletions

File tree

  • drivers/net/wireless/intel/iwlwifi/mvm

drivers/net/wireless/intel/iwlwifi/mvm/d3.c

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1260,15 +1260,15 @@ static int __iwl_mvm_suspend(struct ieee80211_hw *hw,
12601260
if (IS_ERR_OR_NULL(vif))
12611261
return 1;
12621262

1263-
if (ieee80211_vif_is_mld(vif) && vif->cfg.assoc) {
1263+
if (hweight16(vif->active_links) > 1) {
12641264
/*
1265-
* Select the 'best' link. May need to revisit, it seems
1266-
* better to not optimize for throughput but rather range,
1267-
* reliability and power here - and select 2.4 GHz ...
1265+
* Select the 'best' link.
1266+
* May need to revisit, it seems better to not optimize
1267+
* for throughput but rather range, reliability and
1268+
* power here - and select 2.4 GHz ...
12681269
*/
1269-
primary_link =
1270-
iwl_mvm_mld_get_primary_link(mvm, vif,
1271-
vif->active_links);
1270+
primary_link = iwl_mvm_mld_get_primary_link(mvm, vif,
1271+
vif->active_links);
12721272

12731273
if (WARN_ONCE(primary_link < 0, "no primary link in 0x%x\n",
12741274
vif->active_links))
@@ -1277,6 +1277,8 @@ static int __iwl_mvm_suspend(struct ieee80211_hw *hw,
12771277
ret = ieee80211_set_active_links(vif, BIT(primary_link));
12781278
if (ret)
12791279
return ret;
1280+
} else if (vif->active_links) {
1281+
primary_link = __ffs(vif->active_links);
12801282
} else {
12811283
primary_link = 0;
12821284
}

0 commit comments

Comments
 (0)