All of lore.kernel.org
 help / color / mirror / Atom feed
From: Miri Korenblit <miriam.rachel.korenblit@intel.com>
To: johannes@sipsolutions.net
Cc: linux-wireless@vger.kernel.org,
	Shaul Triebitz <shaul.triebitz@intel.com>
Subject: [PATCH 02/15] wifi: iwlwifi: mvm: consider having one active link
Date: Mon, 11 Mar 2024 08:28:02 +0200	[thread overview]
Message-ID: <20240311081938.6c50061bf69b.I05b0ac7fa7149eabaa5570a6f65b0d9bfb09a6f1@changeid> (raw)
In-Reply-To: <20240311062815.4099838-1-miriam.rachel.korenblit@intel.com>

From: Shaul Triebitz <shaul.triebitz@intel.com>

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 warnning.

Fixes: 8c9bef26e98b ("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>
---
 drivers/net/wireless/intel/iwlwifi/mvm/d3.c | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/d3.c b/drivers/net/wireless/intel/iwlwifi/mvm/d3.c
index ca2c6d0b605e..1a235b0c5593 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/d3.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/d3.c
@@ -1260,15 +1260,15 @@ static int __iwl_mvm_suspend(struct ieee80211_hw *hw,
 	if (IS_ERR_OR_NULL(vif))
 		return 1;
 
-	if (ieee80211_vif_is_mld(vif) && vif->cfg.assoc) {
+	if (hweight16(vif->active_links) > 1) {
 		/*
-		 * Select the 'best' link. May need to revisit, it seems
-		 * better to not optimize for throughput but rather range,
-		 * reliability and power here - and select 2.4 GHz ...
+		 * Select the 'best' link.
+		 * May need to revisit, it seems better to not optimize
+		 * for throughput but rather range, reliability and
+		 * power here - and select 2.4 GHz ...
 		 */
-		primary_link =
-			iwl_mvm_mld_get_primary_link(mvm, vif,
-						     vif->active_links);
+		primary_link = iwl_mvm_mld_get_primary_link(mvm, vif,
+							    vif->active_links);
 
 		if (WARN_ONCE(primary_link < 0, "no primary link in 0x%x\n",
 			      vif->active_links))
@@ -1277,6 +1277,8 @@ static int __iwl_mvm_suspend(struct ieee80211_hw *hw,
 		ret = ieee80211_set_active_links(vif, BIT(primary_link));
 		if (ret)
 			return ret;
+	} else if (vif->active_links) {
+		primary_link = __ffs(vif->active_links);
 	} else {
 		primary_link = 0;
 	}
-- 
2.34.1


  parent reply	other threads:[~2024-03-11  6:28 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-11  6:28 [PATCH 00/15] wifi: iwlwifi: updates - 2024-03-11 Miri Korenblit
2024-03-11  6:28 ` [PATCH 01/15] wifi: iwlwifi: mvm: pick the version of SESSION_PROTECTION_NOTIF Miri Korenblit
2024-03-11  6:28 ` Miri Korenblit [this message]
2024-03-11  6:28 ` [PATCH 03/15] wifi: iwlwifi: fix firmware API kernel doc Miri Korenblit
2024-03-11  6:28 ` [PATCH 04/15] wifi: iwlwifi: mvm: Move beacon filtering to be per link Miri Korenblit
2024-03-11  6:28 ` [PATCH 05/15] wifi: iwlwifi: mvm: Configure the link mapping for completeness Miri Korenblit
2024-03-11  6:28 ` [PATCH 06/15] wifi: iwlwifi: mvm: fix the sta id in offload Miri Korenblit
2024-03-11  6:28 ` [PATCH 07/15] wifi: iwlwifi: mvm: stop assuming sta id 0 in d3 Miri Korenblit
2024-03-11  6:28 ` [PATCH 08/15] wifi: iwlwifi: mvm: skip keys of other links Miri Korenblit
2024-03-11  6:28 ` [PATCH 09/15] wifi: iwlwifi: mvm: support wowlan notif version 4 Miri Korenblit
2024-03-11  6:28 ` [PATCH 10/15] wifi: iwlwifi: mvm: fix flushing during quiet CSA Miri Korenblit
2024-03-11  6:28 ` [PATCH 11/15] wifi: iwlwifi: mvm: advertise IEEE80211_HW_HANDLES_QUIET_CSA Miri Korenblit
2024-03-11  6:28 ` [PATCH 12/15] wifi: iwlwifi: mvm: Refactor scan start Miri Korenblit
2024-03-11  6:28 ` [PATCH 13/15] wifi: iwlwifi: mvm: Introduce internal MLO passive scan Miri Korenblit
2024-03-11  6:28 ` [PATCH 14/15] wifi: iwlwifi: mvm: add debugfs for forcing unprotected ranging request Miri Korenblit
2024-03-11  6:28 ` [PATCH 15/15] wifi: iwlwifi: pcie: remove duplicate PCI IDs entry Miri Korenblit

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240311081938.6c50061bf69b.I05b0ac7fa7149eabaa5570a6f65b0d9bfb09a6f1@changeid \
    --to=miriam.rachel.korenblit@intel.com \
    --cc=johannes@sipsolutions.net \
    --cc=linux-wireless@vger.kernel.org \
    --cc=shaul.triebitz@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.