From: Ping-Ke Shih <pkshih@realtek.com>
To: <linux-wireless@vger.kernel.org>
Cc: <gary.chang@realtek.com>, <kevin_yang@realtek.com>
Subject: [PATCH rtw-next 1/3] wifi: rtw89: ser: reset map of associated links when L2 SER
Date: Wed, 23 Sep 2026 15:27:39 +0800 [thread overview]
Message-ID: <20260923072741.54118-2-pkshih@realtek.com> (raw)
In-Reply-To: <20260923072741.54118-1-pkshih@realtek.com>
From: Zong-Zhe Yang <kevin_yang@realtek.com>
There is a map used to record the associated links by MAC ID, but L2 SER
(system error recovery) will invoke ieee80211_restart_hw to reset things.
After ieee80211_restart_hw, the associated links will re-configure, but
each associated link might not use the same MAC ID as the original one.
If an associated link doesn't and the old MAC ID is not re-used, the map
keeps the old pair of old MAC ID and it. And then, if somehow HW fills a
wrong MAC ID, e.g. the old MAC ID above, in RX, SW will still obtain the
associated link. Once the one is really disconnected, the memory will be
freed and this case will cause problems.
So, reset entire map of associated links before ieee80211_restart_hw call.
Signed-off-by: Zong-Zhe Yang <kevin_yang@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
---
drivers/net/wireless/realtek/rtw89/ser.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/drivers/net/wireless/realtek/rtw89/ser.c b/drivers/net/wireless/realtek/rtw89/ser.c
index 701440bd7be1..045dac0bd1db 100644
--- a/drivers/net/wireless/realtek/rtw89/ser.c
+++ b/drivers/net/wireless/realtek/rtw89/ser.c
@@ -354,6 +354,14 @@ static void ser_deinit_cam(struct rtw89_dev *rtwdev, struct rtw89_vif *rtwvif)
bitmap_zero(rtwdev->cam_info.ba_cam_map, RTW89_MAX_BA_CAM_NUM);
}
+static void ser_reset_assoc_links(struct rtw89_dev *rtwdev)
+{
+ for (int i = 0; i < RTW89_MAX_MAC_ID_NUM; i++)
+ rcu_assign_pointer(rtwdev->assoc_link_on_macid[i], NULL);
+
+ synchronize_rcu();
+}
+
static void ser_reset_mac_binding(struct rtw89_dev *rtwdev)
{
struct rtw89_vif *rtwvif;
@@ -362,6 +370,7 @@ static void ser_reset_mac_binding(struct rtw89_dev *rtwdev)
rtw89_for_each_rtwvif(rtwdev, rtwvif)
ser_deinit_cam(rtwdev, rtwvif);
+ ser_reset_assoc_links(rtwdev);
rtw89_core_release_all_bits_map(rtwdev->mac_id_map, RTW89_MAX_MAC_ID_NUM);
rtw89_for_each_rtwvif(rtwdev, rtwvif)
ser_reset_vif(rtwdev, rtwvif);
--
2.25.1
next prev parent reply other threads:[~2026-09-23 7:28 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-23 7:27 [PATCH rtw-next 0/3] wifi: rtw89: add out-of-bound checking and reset map for hw_reconfig flow Ping-Ke Shih
2026-09-23 7:27 ` Ping-Ke Shih [this message]
2026-09-30 2:17 ` [PATCH rtw-next 1/3] wifi: rtw89: ser: reset map of associated links when L2 SER Ping-Ke Shih
2026-09-23 7:27 ` [PATCH rtw-next 2/3] wifi: rtw89: wow: check AOAC report C2H event length Ping-Ke Shih
2026-09-23 7:27 ` [PATCH rtw-next 3/3] wifi: rtw89: wow: check AOAC report key index Ping-Ke Shih
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=20260923072741.54118-2-pkshih@realtek.com \
--to=pkshih@realtek.com \
--cc=gary.chang@realtek.com \
--cc=kevin_yang@realtek.com \
--cc=linux-wireless@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