Linux wireless drivers development
 help / color / mirror / Atom feed
From: Sasha Levin <sashal@kernel.org>
To: patches@lists.linux.dev, stable@vger.kernel.org
Cc: Kuan-Chung Chen <damon.chen@realtek.com>,
	Ping-Ke Shih <pkshih@realtek.com>,
	Sasha Levin <sashal@kernel.org>,
	linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH AUTOSEL 6.18] wifi: rtw89: mlo: rearrange MLSR link decision flow
Date: Mon, 31 Aug 2026 09:29:19 -0400	[thread overview]
Message-ID: <20260831133314.4125787-531-sashal@kernel.org> (raw)
In-Reply-To: <20260831133314.4125787-1-sashal@kernel.org>

From: Kuan-Chung Chen <damon.chen@realtek.com>

[ Upstream commit 7284f5be5d298c901be1fc9fda6a2476f5ffdbaf ]

The original MLSR link decision refers to RSSI, but it should be
based on the premise of an existing link. Otherwise, make a link
decision to select a new link from any available band.

Signed-off-by: Kuan-Chung Chen <damon.chen@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://patch.msgid.link/20260429132625.1659182-2-pkshih@realtek.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---

LLM Generated explanations, may be completely bogus:

Two background git history lookups were interrupted (one had used `git
log --all`, which is too slow in this repo).

The follow-up without `--all` completed: `rtw89_core_mlo_track` first
appears in this 6.18.43 tree at `5d324e5159d9e` (v6.18-rc8 era), so the
MLSR code the patch fixes is present here. That matches the earlier
analysis — **YES** for backport.

 drivers/net/wireless/realtek/rtw89/core.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/net/wireless/realtek/rtw89/core.c b/drivers/net/wireless/realtek/rtw89/core.c
index 989c6b09b2706..c2bf839fd82a9 100644
--- a/drivers/net/wireless/realtek/rtw89/core.c
+++ b/drivers/net/wireless/realtek/rtw89/core.c
@@ -4276,13 +4276,19 @@ static void rtw89_core_mlsr_link_decision(struct rtw89_dev *rtwdev,
 {
 	unsigned int sel_link_id = IEEE80211_MLD_MAX_NUM_LINKS;
 	struct ieee80211_vif *vif = rtwvif_to_vif(rtwvif);
+	u8 decided_bands = BIT(RTW89_BAND_NUM) - 1;
 	struct rtw89_vif_link *rtwvif_link;
 	const struct rtw89_chan *chan;
 	unsigned long usable_links;
 	unsigned int link_id;
-	u8 decided_bands;
 	u8 rssi;
 
+	usable_links = ieee80211_vif_usable_links(vif);
+
+	rtwvif_link = rtw89_get_designated_link(rtwvif);
+	if (unlikely(!rtwvif_link))
+		goto select;
+
 	rssi = ewma_rssi_read(&rtwdev->phystat.bcn_rssi);
 	if (unlikely(!rssi))
 		return;
@@ -4294,12 +4300,6 @@ static void rtw89_core_mlsr_link_decision(struct rtw89_dev *rtwdev,
 	else
 		return;
 
-	usable_links = ieee80211_vif_usable_links(vif);
-
-	rtwvif_link = rtw89_get_designated_link(rtwvif);
-	if (unlikely(!rtwvif_link))
-		goto select;
-
 	chan = rtw89_chan_get(rtwdev, rtwvif_link->chanctx_idx);
 	if (decided_bands & BIT(chan->band_type))
 		return;
-- 
2.53.0


  parent reply	other threads:[~2026-08-31 13:49 UTC|newest]

Thread overview: 78+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-31 13:20 [PATCH AUTOSEL 6.18-5.10] wifi: cfg80211: validate IEs in cfg80211_wext_siwgenie() Sasha Levin
2026-08-31 13:20 ` [PATCH AUTOSEL 6.18-6.12] wifi: mt76: mt7925: handle 320MHz bandwidth in RXV and TXS Sasha Levin
2026-08-31 13:20 ` [PATCH AUTOSEL 6.18-6.12] wifi: iwlwifi: mvm: parse beacon notif per layout Sasha Levin
2026-08-31 13:21 ` [PATCH AUTOSEL 6.18] wifi: iwlwifi: mvm: fix P2P-Device binding handling Sasha Levin
2026-08-31 13:21 ` [PATCH AUTOSEL 6.18] wifi: nl80211: check link is beaconing for color change Sasha Levin
2026-08-31 13:21 ` [PATCH AUTOSEL 6.18-5.10] wifi: nl80211: Increase ie_len size to prevent truncated IEs in new peer notifications Sasha Levin
2026-08-31 13:21 ` [PATCH AUTOSEL 6.18-6.12] wifi: iwlwifi: pcie: null RX pointers after free Sasha Levin
2026-08-31 13:21 ` [PATCH AUTOSEL 6.18] wifi: ath12k: Prevent incorrect vif chanctx switch when handling multi-radio contexts Sasha Levin
2026-08-31 13:21 ` [PATCH AUTOSEL 6.18-5.15] wifi: iwlwifi: mvm: fix sched scan IE sizing Sasha Levin
2026-08-31 13:21 ` [PATCH AUTOSEL 6.18] wifi: iwlwifi: add support for AX231 Sasha Levin
2026-08-31 13:22 ` [PATCH AUTOSEL 6.18] wifi: iwlwifi: pcie: add two LNL PCI IDs Sasha Levin
2026-08-31 13:22 ` [PATCH AUTOSEL 6.18] wifi: iwlwifi: mld: fix an off-by-1 boundary check Sasha Levin
2026-08-31 13:22 ` [PATCH AUTOSEL 6.18] wifi: iwlwifi: adapt ND match notif sizing to fixed matches array Sasha Levin
2026-08-31 13:22 ` [PATCH AUTOSEL 6.18-6.12] wifi: iwlwifi: mvm: validate mac_link_id in session protect notif Sasha Levin
2026-08-31 13:22 ` [PATCH AUTOSEL 6.18-6.1] wifi: nl80211: reject beacons with bad HE operation Sasha Levin
2026-08-31 13:23 ` [PATCH AUTOSEL 6.18-6.1] wifi: iwlwifi: acpi: validate WGDS table revision index Sasha Levin
2026-08-31 13:23 ` [PATCH AUTOSEL 6.18-6.1] wifi: rtw89: pci: enable LTR based on pcie control register Sasha Levin
2026-08-31 13:23 ` [PATCH AUTOSEL 6.18] wifi: mac80211: unify link STA removal in vif link removal Sasha Levin
2026-08-31 13:24 ` [PATCH AUTOSEL 6.18-6.6] wifi: iwlwifi: mvm: validate sta_id in BA window status notif Sasha Levin
2026-08-31 13:24 ` [PATCH AUTOSEL 6.18] wifi: mac80211: avoid out-of-bounds access in monitor Sasha Levin
2026-08-31 13:24 ` [PATCH AUTOSEL 6.18] wifi: iwlwifi: fw: validate SMEM response size Sasha Levin
2026-08-31 13:24 ` [PATCH AUTOSEL 6.18] wifi: iwlwifi: mld: purge async notifications upon nic error Sasha Levin
2026-08-31 13:24 ` [PATCH AUTOSEL 6.18] wifi: mac80211: use chandef in ieee80211_get_sta_bw() Sasha Levin
2026-08-31 13:24 ` [PATCH AUTOSEL 6.18-5.10] wifi: iwlwifi: mvm: fix an off-by-1 boundary check Sasha Levin
2026-08-31 13:24 ` [PATCH AUTOSEL 6.18-6.12] wifi: iwlwifi: mvm: validate TX_CMD response layout Sasha Levin
2026-08-31 13:25 ` [PATCH AUTOSEL 6.18] wifi: iwlwifi: mld: honor BSS_CHANGED_BEACON_ENABLED Sasha Levin
2026-08-31 13:25 ` [PATCH AUTOSEL 6.18-5.10] wifi: ralink: RT2X00: init EEPROM properly Sasha Levin
2026-08-31 13:25 ` [PATCH AUTOSEL 6.18-6.1] wifi: rtw88: Add NULL check for chip->edcca_th in rtw_fw_adaptivity_result() Sasha Levin
2026-08-31 13:25 ` [PATCH AUTOSEL 6.18-5.15] wifi: cfg80211: validate rx/tx MLME callback frame lengths before access Sasha Levin
2026-08-31 13:25 ` [PATCH AUTOSEL 6.18-5.10] wifi: mt76: transform aspm_conf for pci_disable_link_state Sasha Levin
2026-08-31 13:25 ` [PATCH AUTOSEL 6.18-6.6] wifi: iwlwifi: mvm: fix a possible underflow Sasha Levin
2026-08-31 13:25 ` [PATCH AUTOSEL 6.18-6.12] wifi: mt76: mt7925: add Netgear A8500 USB device ID Sasha Levin
2026-08-31 13:25 ` [PATCH AUTOSEL 6.18-5.10] wifi: rsi: avoid reading TKIP MIC keys for non-TKIP ciphers Sasha Levin
2026-08-31 13:25 ` [PATCH AUTOSEL 6.18-5.10] wifi: mac80211: validate deauth frame length before reason access Sasha Levin
2026-08-31 13:25 ` [PATCH AUTOSEL 6.18-5.10] wifi: mwifiex: replace one-element arrays with flexible array members Sasha Levin
2026-08-31 13:25 ` [PATCH AUTOSEL 6.18] wifi: iwlwifi: mvm: validate sta_id in TLC notif Sasha Levin
2026-08-31 13:25 ` [PATCH AUTOSEL 6.18-6.12] wifi: mt76: mt7925: add 320MHz bandwidth to bss_rlm_tlv Sasha Levin
2026-08-31 13:26 ` [PATCH AUTOSEL 6.18-6.12] wifi: mt76: mt7925: populate EHT 320MHz MCS map in sta_rec Sasha Levin
2026-08-31 13:26 ` [PATCH AUTOSEL 6.18] wifi: iwlwifi: mld: disallow puncturing in US/CA for WH Sasha Levin
2026-08-31 13:26 ` [PATCH AUTOSEL 6.18] wifi: iwlwifi: mld: don't WARN on WoWLAN suspend w/o netdetect Sasha Levin
2026-08-31 13:26 ` [PATCH AUTOSEL 6.18-6.12] wifi: cfg80211: reject duplicate wiphy cipher suite entries Sasha Levin
2026-09-03  8:09   ` Yuqi Xu
2026-08-31 13:26 ` [PATCH AUTOSEL 6.18] wifi: iwlwifi: validate SEC_RT TLV minimum size Sasha Levin
2026-08-31 13:26 ` [PATCH AUTOSEL 6.18-5.10] wifi: mac80211: always allow transmitting null-data on TXQs Sasha Levin
2026-08-31 13:26 ` [PATCH AUTOSEL 6.18] wifi: iwlwifi: mld: validate reorder BAID Sasha Levin
2026-08-31 13:26 ` [PATCH AUTOSEL 6.18-5.10] wifi: mac80211_hwsim: reject undersized HWSIM_ATTR_TX_INFO Sasha Levin
2026-08-31 13:27 ` [PATCH AUTOSEL 6.18] wifi: rtw89: disable HTC field in AP mode Sasha Levin
2026-08-31 13:27 ` [PATCH AUTOSEL 6.18-6.12] wifi: mac80211: explicitly disable FTM responder on AP stop Sasha Levin
2026-08-31 13:27 ` [PATCH AUTOSEL 6.18-6.6] wifi: iwlwifi: mvm: add a check on the tid coming from the firmware Sasha Levin
2026-08-31 13:27 ` [PATCH AUTOSEL 6.18] wifi: rtw89: suspend DIG when remain-on-channel Sasha Levin
2026-08-31 13:27 ` [PATCH AUTOSEL 6.18] wifi: iwlwifi: mld: clear tzone on fail Sasha Levin
2026-08-31 13:27 ` [PATCH AUTOSEL 6.18] wifi: iwlwifi: mvm: validate MCC header before n_channels Sasha Levin
2026-08-31 13:27 ` [PATCH AUTOSEL 6.18] wifi: iwlwifi: fix the access to CNVR TOP registers Sasha Levin
2026-08-31 13:27 ` [PATCH AUTOSEL 6.18-6.12] wifi: mac80211: ibss: wait for in-flight TX on disconnect Sasha Levin
2026-08-31 13:28 ` [PATCH AUTOSEL 6.18] wifi: iwlwifi: pcie: fix ACPI DSM check Sasha Levin
2026-08-31 13:28 ` [PATCH AUTOSEL 6.18] wifi: mac80211: clarify beacon parsing with MBSSID/EMA Sasha Levin
2026-08-31 13:28 ` [PATCH AUTOSEL 6.18] wifi: cfg80211: harden cfg80211_defragment_element() Sasha Levin
2026-08-31 13:28 ` [PATCH AUTOSEL 6.18] wifi: iwlwifi: mld: call iwl_mld_free_ap_early_key() for AP only Sasha Levin
2026-08-31 13:28 ` [PATCH AUTOSEL 6.18-6.6] wifi: rtw89: phy: check length before parsing PHY status IE Sasha Levin
2026-08-31 13:28 ` [PATCH AUTOSEL 6.18-5.10] wifi: rsi: validate beacon length before fixed buffer copy Sasha Levin
2026-08-31 13:28 ` [PATCH AUTOSEL 6.18-5.10] wifi: iwlwifi: bound aligned TLV advance in FW parser Sasha Levin
2026-08-31 13:28 ` [PATCH AUTOSEL 6.18-6.12] wifi: rtw89: disable CSI STBC for VHT 160MHz Sasha Levin
2026-08-31 13:28 ` [PATCH AUTOSEL 6.18] wifi: iwlwifi: Transition to basic uAPSD with MAC_PM_POWER_TABLE API VER_3 Sasha Levin
2026-08-31 13:29 ` [PATCH AUTOSEL 6.18] wifi: iwlwifi: mvm: d3: validate D3 resume notification payloads Sasha Levin
2026-08-31 13:29 ` Sasha Levin [this message]
2026-08-31 13:29 ` [PATCH AUTOSEL 6.18-6.1] wifi: cfg80211: validate assoc response length before status and IE access Sasha Levin
2026-08-31 13:29 ` [PATCH AUTOSEL 6.18] wifi: iwlwifi: mld: validate txq_id in TX response handler Sasha Levin
2026-08-31 13:29 ` [PATCH AUTOSEL 6.18-5.10] wifi: libertas: reject short monitor TX frames Sasha Levin
2026-08-31 13:30 ` [PATCH AUTOSEL 6.18-5.10] wifi: mac80211: don't call ieee80211_handle_reconfig_failure when not needed Sasha Levin
2026-08-31 13:30 ` [PATCH AUTOSEL 6.18] wifi: rtw89: 8851bu: add Mercusys MA60XNB (2c4e:0128) Sasha Levin
2026-08-31 13:30 ` [PATCH AUTOSEL 6.18] wifi: iwlwifi: mvm: verify scan id reported by firmware Sasha Levin
2026-08-31 13:30 ` [PATCH AUTOSEL 6.18-5.10] wifi: libipw: fix key index receive bound checks Sasha Levin
2026-08-31 13:30 ` [PATCH AUTOSEL 6.18-6.1] wifi: ath11k: fix invalid data access in ath11k_dp_rx_h_undecap_nwifi Sasha Levin
2026-08-31 13:30 ` [PATCH AUTOSEL 6.18-6.6] wifi: iwlwifi: mvm: fix out-of-bounds tid_data access in BA notif Sasha Levin
2026-08-31 13:31 ` [PATCH AUTOSEL 6.18] wifi: mt76: route TDLS-peer frames as 3-addr non-DS in HW encap Sasha Levin
2026-08-31 13:31 ` [PATCH AUTOSEL 6.18] wifi: iwlwifi: mld: don't parse a notif before checking its length Sasha Levin
2026-08-31 13:31 ` [PATCH AUTOSEL 6.18] wifi: iwlwifi: mld: keep healthy link on EMLSR missed beacon exit Sasha Levin
2026-08-31 13:31 ` [PATCH AUTOSEL 6.18] wifi: ath9k: Obtain system GPIOS from descriptors Sasha Levin

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=20260831133314.4125787-531-sashal@kernel.org \
    --to=sashal@kernel.org \
    --cc=damon.chen@realtek.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=patches@lists.linux.dev \
    --cc=pkshih@realtek.com \
    --cc=stable@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox