* [PATCH AUTOSEL 6.19-6.12] wifi: rtw89: ser: enable error IMR after recovering from L1
@ 2026-02-14 21:22 Sasha Levin
2026-02-14 21:22 ` [PATCH AUTOSEL 6.19-6.12] wifi: ath11k: Fix failure to connect to a 6 GHz AP Sasha Levin
` (31 more replies)
0 siblings, 32 replies; 33+ messages in thread
From: Sasha Levin @ 2026-02-14 21:22 UTC (permalink / raw)
To: patches, stable; +Cc: Zong-Zhe Yang, Ping-Ke Shih, Sasha Levin, linux-wireless
From: Zong-Zhe Yang <kevin_yang@realtek.com>
[ Upstream commit f4de946bdb379f543e3a599f8f048d741ad4a58e ]
After recovering from L1, explicitly enable error IMR to ensure next
L1 SER (system error recovery) can work normally.
Signed-off-by: Zong-Zhe Yang <kevin_yang@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://patch.msgid.link/20251223030651.480633-6-pkshih@realtek.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
LLM Generated explanations, may be completely bogus:
That's a different change (about FW event mode). The current commit is
standalone - it fixes the error IMR not being re-enabled after L1
recovery, which is an independent fix.
### Verdict
**This is a real bug fix**: After L1 SER recovery, error interrupts are
not re-enabled, preventing the device from detecting subsequent hardware
errors. This leaves the WiFi adapter in a degraded state where the next
error will render it non-functional.
**Meets stable criteria**:
- Fixes a real bug (error recovery mechanism broken after first L1
recovery)
- Small and contained change
- Low risk (calls existing, well-tested function at appropriate recovery
point)
- Affects real users (any user with rtw89 devices that experience L1
errors)
**Concerns for backport**:
- The struct change adds a new function pointer - this is structural but
necessary
- The patch should apply cleanly to recent stable trees that have the
rtw89 gen architecture
- Older stable trees may not have the `rtw89_mac_gen_def` infrastructure
at all
The fix is small, focused on a real bug in error recovery, and the risk
of regression is very low since it calls an existing function that's
already used during initialization.
**YES**
drivers/net/wireless/realtek/rtw89/mac.c | 1 +
drivers/net/wireless/realtek/rtw89/mac.h | 1 +
drivers/net/wireless/realtek/rtw89/mac_be.c | 1 +
drivers/net/wireless/realtek/rtw89/ser.c | 10 ++++++++++
4 files changed, 13 insertions(+)
diff --git a/drivers/net/wireless/realtek/rtw89/mac.c b/drivers/net/wireless/realtek/rtw89/mac.c
index d78fbe73e3657..b4c292c7e829d 100644
--- a/drivers/net/wireless/realtek/rtw89/mac.c
+++ b/drivers/net/wireless/realtek/rtw89/mac.c
@@ -7184,6 +7184,7 @@ const struct rtw89_mac_gen_def rtw89_mac_gen_ax = {
.check_mac_en = rtw89_mac_check_mac_en_ax,
.sys_init = sys_init_ax,
.trx_init = trx_init_ax,
+ .err_imr_ctrl = err_imr_ctrl_ax,
.hci_func_en = rtw89_mac_hci_func_en_ax,
.dmac_func_pre_en = rtw89_mac_dmac_func_pre_en_ax,
.dle_func_en = dle_func_en_ax,
diff --git a/drivers/net/wireless/realtek/rtw89/mac.h b/drivers/net/wireless/realtek/rtw89/mac.h
index 0007229d67537..a4ed1c545609e 100644
--- a/drivers/net/wireless/realtek/rtw89/mac.h
+++ b/drivers/net/wireless/realtek/rtw89/mac.h
@@ -1019,6 +1019,7 @@ struct rtw89_mac_gen_def {
enum rtw89_mac_hwmod_sel sel);
int (*sys_init)(struct rtw89_dev *rtwdev);
int (*trx_init)(struct rtw89_dev *rtwdev);
+ void (*err_imr_ctrl)(struct rtw89_dev *rtwdev, bool en);
void (*hci_func_en)(struct rtw89_dev *rtwdev);
void (*dmac_func_pre_en)(struct rtw89_dev *rtwdev);
void (*dle_func_en)(struct rtw89_dev *rtwdev, bool enable);
diff --git a/drivers/net/wireless/realtek/rtw89/mac_be.c b/drivers/net/wireless/realtek/rtw89/mac_be.c
index 556e5f98e8d41..9b9e646487346 100644
--- a/drivers/net/wireless/realtek/rtw89/mac_be.c
+++ b/drivers/net/wireless/realtek/rtw89/mac_be.c
@@ -2601,6 +2601,7 @@ const struct rtw89_mac_gen_def rtw89_mac_gen_be = {
.check_mac_en = rtw89_mac_check_mac_en_be,
.sys_init = sys_init_be,
.trx_init = trx_init_be,
+ .err_imr_ctrl = err_imr_ctrl_be,
.hci_func_en = rtw89_mac_hci_func_en_be,
.dmac_func_pre_en = rtw89_mac_dmac_func_pre_en_be,
.dle_func_en = dle_func_en_be,
diff --git a/drivers/net/wireless/realtek/rtw89/ser.c b/drivers/net/wireless/realtek/rtw89/ser.c
index f99e179f7ff9f..7fdc69578da31 100644
--- a/drivers/net/wireless/realtek/rtw89/ser.c
+++ b/drivers/net/wireless/realtek/rtw89/ser.c
@@ -431,6 +431,14 @@ static void hal_send_m4_event(struct rtw89_ser *ser)
rtw89_mac_set_err_status(rtwdev, MAC_AX_ERR_L1_RCVY_EN);
}
+static void hal_enable_err_imr(struct rtw89_ser *ser)
+{
+ struct rtw89_dev *rtwdev = container_of(ser, struct rtw89_dev, ser);
+ const struct rtw89_mac_gen_def *mac = rtwdev->chip->mac_def;
+
+ mac->err_imr_ctrl(rtwdev, true);
+}
+
/* state handler */
static void ser_idle_st_hdl(struct rtw89_ser *ser, u8 evt)
{
@@ -552,6 +560,8 @@ static void ser_do_hci_st_hdl(struct rtw89_ser *ser, u8 evt)
break;
case SER_EV_MAC_RESET_DONE:
+ hal_enable_err_imr(ser);
+
ser_state_goto(ser, SER_IDLE_ST);
break;
--
2.51.0
^ permalink raw reply related [flat|nested] 33+ messages in thread
* [PATCH AUTOSEL 6.19-6.12] wifi: ath11k: Fix failure to connect to a 6 GHz AP
2026-02-14 21:22 [PATCH AUTOSEL 6.19-6.12] wifi: rtw89: ser: enable error IMR after recovering from L1 Sasha Levin
@ 2026-02-14 21:22 ` Sasha Levin
2026-02-14 21:22 ` [PATCH AUTOSEL 6.19-6.1] wifi: rtw88: 8822b: Avoid WARNING in rtw8822b_config_trx_mode() Sasha Levin
` (30 subsequent siblings)
31 siblings, 0 replies; 33+ messages in thread
From: Sasha Levin @ 2026-02-14 21:22 UTC (permalink / raw)
To: patches, stable
Cc: Qian Zhang, Baochen Qiang, Jeff Johnson, Sasha Levin, jjohnson,
linux-wireless, ath11k
From: Qian Zhang <qian.zhang@oss.qualcomm.com>
[ Upstream commit 0bc8c48de6f06c0cac52dde024ffda4433de6234 ]
STA fails to connect to a 6 GHz AP with the following errors:
ath11k_pci 0000:01:00.0: failed to handle chan list with power type 1
wlp1s0: deauthenticating from c8:a3:e8:dd:41:e3 by local choice (Reason: 3=DEAUTH_LEAVING)
ath11k_reg_handle_chan_list() treats the update as redundant and
returns -EINVAL. That causes the connection attempt to fail.
Avoid unnecessary validation during association. Apply the regulatory
redundant check only when the power type is IEEE80211_REG_UNSET_AP,
which only occurs during core initialization.
Tested-on: WCN6855 hw2.1 PCI WLAN.HSP.1.1-03125-QCAHSPSWPL_V1_V2_SILICONZ_LITE-3.6510.41
Signed-off-by: Qian Zhang <qian.zhang@oss.qualcomm.com>
Reviewed-by: Baochen Qiang <baochen.qiang@oss.qualcomm.com>
Link: https://patch.msgid.link/20260108034607.812885-1-qian.zhang@oss.qualcomm.com
Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
LLM Generated explanations, may be completely bogus:
The key prerequisite is `e3d373ec4f02b` which added the 6 GHz regulatory
type support and the `power_type` parameter to
`ath11k_reg_handle_chan_list()`. This was merged in v6.9 cycle. For
stable trees that don't have this function signature, the patch wouldn't
apply anyway (and wouldn't be needed since 6 GHz support wouldn't exist
in the same form).
### Summary
**What the fix does**: Narrows a regulatory update redundancy check to
only apply during core initialization (`IEEE80211_REG_UNSET_AP`), not
during association with a 6 GHz AP. Also fixes a memory leak on the
early-return path by properly calling `ath11k_reg_reset_info()`.
**Why it matters for stable users**: Without this fix, users with ath11k
WiFi cards (WCN6855, etc.) cannot connect to 6 GHz WiFi 6E access points
at all. This is a complete connectivity failure, not a subtle
performance issue.
**Meets stable criteria**:
- Obviously correct and tested on real hardware
- Fixes a real, user-visible bug (WiFi connection failure)
- Fixes an important issue (complete loss of 6 GHz WiFi connectivity)
- Small and contained (5 lines of logic in 1 file)
- Does not introduce new features
- Also fixes a memory leak (bonus)
**Risk assessment**: Very low. The change is conservative — it only
narrows an existing condition. The worst case scenario is that the
redundancy check doesn't fire during association, which is the correct
behavior since the regulatory update should be processed during
association.
**Dependencies**: Requires `e3d373ec4f02b` (6 GHz regulatory type
support) in the stable tree. This limits backport to 6.9+ stable trees,
but for those trees this fix is important.
**YES**
drivers/net/wireless/ath/ath11k/reg.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/drivers/net/wireless/ath/ath11k/reg.c b/drivers/net/wireless/ath/ath11k/reg.c
index d62a2014315a0..49b79648752cf 100644
--- a/drivers/net/wireless/ath/ath11k/reg.c
+++ b/drivers/net/wireless/ath/ath11k/reg.c
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: BSD-3-Clause-Clear
/*
* Copyright (c) 2018-2019 The Linux Foundation. All rights reserved.
- * Copyright (c) 2021-2025 Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
*/
#include <linux/rtnetlink.h>
@@ -926,8 +926,11 @@ int ath11k_reg_handle_chan_list(struct ath11k_base *ab,
*/
if (ab->default_regd[pdev_idx] && !ab->new_regd[pdev_idx] &&
!memcmp((char *)ab->default_regd[pdev_idx]->alpha2,
- (char *)reg_info->alpha2, 2))
- goto retfail;
+ (char *)reg_info->alpha2, 2) &&
+ power_type == IEEE80211_REG_UNSET_AP) {
+ ath11k_reg_reset_info(reg_info);
+ return 0;
+ }
/* Intersect new rules with default regd if a new country setting was
* requested, i.e a default regd was already set during initialization
--
2.51.0
^ permalink raw reply related [flat|nested] 33+ messages in thread
* [PATCH AUTOSEL 6.19-6.1] wifi: rtw88: 8822b: Avoid WARNING in rtw8822b_config_trx_mode()
2026-02-14 21:22 [PATCH AUTOSEL 6.19-6.12] wifi: rtw89: ser: enable error IMR after recovering from L1 Sasha Levin
2026-02-14 21:22 ` [PATCH AUTOSEL 6.19-6.12] wifi: ath11k: Fix failure to connect to a 6 GHz AP Sasha Levin
@ 2026-02-14 21:22 ` Sasha Levin
2026-02-14 21:22 ` [PATCH AUTOSEL 6.19-6.12] wifi: rtw89: 8922a: add digital compensation for 2GHz Sasha Levin
` (29 subsequent siblings)
31 siblings, 0 replies; 33+ messages in thread
From: Sasha Levin @ 2026-02-14 21:22 UTC (permalink / raw)
To: patches, stable
Cc: Bitterblue Smith, Ping-Ke Shih, Sasha Levin, linux-wireless
From: Bitterblue Smith <rtl8821cerfe2@gmail.com>
[ Upstream commit 44d1f624bbdd2d60319374ba85f7195a28d00c90 ]
rtw8822b_set_antenna() can be called from userspace when the chip is
powered off. In that case a WARNING is triggered in
rtw8822b_config_trx_mode() because trying to read the RF registers
when the chip is powered off returns an unexpected value.
Call rtw8822b_config_trx_mode() in rtw8822b_set_antenna() only when
the chip is powered on.
------------[ cut here ]------------
write RF mode table fail
WARNING: CPU: 0 PID: 7183 at rtw8822b.c:824 rtw8822b_config_trx_mode.constprop.0+0x835/0x840 [rtw88_8822b]
CPU: 0 UID: 0 PID: 7183 Comm: iw Tainted: G W OE 6.17.5-arch1-1 #1 PREEMPT(full) 01c39fc421df2af799dd5e9180b572af860b40c1
Tainted: [W]=WARN, [O]=OOT_MODULE, [E]=UNSIGNED_MODULE
Hardware name: LENOVO 82KR/LNVNB161216, BIOS HBCN18WW 08/27/2021
RIP: 0010:rtw8822b_config_trx_mode.constprop.0+0x835/0x840 [rtw88_8822b]
Call Trace:
<TASK>
rtw8822b_set_antenna+0x57/0x70 [rtw88_8822b 370206f42e5890d8d5f48eb358b759efa37c422b]
rtw_ops_set_antenna+0x50/0x80 [rtw88_core 711c8fb4f686162be4625b1d0b8e8c6a5ac850fb]
ieee80211_set_antenna+0x60/0x100 [mac80211 f1845d85d2ecacf3b71867635a050ece90486cf3]
nl80211_set_wiphy+0x384/0xe00 [cfg80211 296485ee85696d2150309a6d21a7fbca83d3dbda]
? netdev_run_todo+0x63/0x550
genl_family_rcv_msg_doit+0xfc/0x160
genl_rcv_msg+0x1aa/0x2b0
? __pfx_nl80211_pre_doit+0x10/0x10 [cfg80211 296485ee85696d2150309a6d21a7fbca83d3dbda]
? __pfx_nl80211_set_wiphy+0x10/0x10 [cfg80211 296485ee85696d2150309a6d21a7fbca83d3dbda]
? __pfx_nl80211_post_doit+0x10/0x10 [cfg80211 296485ee85696d2150309a6d21a7fbca83d3dbda]
? __pfx_genl_rcv_msg+0x10/0x10
netlink_rcv_skb+0x59/0x110
genl_rcv+0x28/0x40
netlink_unicast+0x285/0x3c0
? __alloc_skb+0xdb/0x1a0
netlink_sendmsg+0x20d/0x430
____sys_sendmsg+0x39f/0x3d0
? import_iovec+0x2f/0x40
___sys_sendmsg+0x99/0xe0
? refill_obj_stock+0x12e/0x240
__sys_sendmsg+0x8a/0xf0
do_syscall_64+0x81/0x970
? do_syscall_64+0x81/0x970
? ksys_read+0x73/0xf0
? do_syscall_64+0x81/0x970
? count_memcg_events+0xc2/0x190
? handle_mm_fault+0x1d7/0x2d0
? do_user_addr_fault+0x21a/0x690
? exc_page_fault+0x7e/0x1a0
entry_SYSCALL_64_after_hwframe+0x76/0x7e
</TASK>
---[ end trace 0000000000000000 ]---
Link: https://github.com/lwfinger/rtw88/issues/366
Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>
Acked-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://patch.msgid.link/fb9a3444-9319-4aa2-8719-35a6308bf568@gmail.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
LLM Generated explanations, may be completely bogus:
## Analysis of commit: wifi: rtw88: 8822b: Avoid WARNING in
rtw8822b_config_trx_mode()
### 1. COMMIT MESSAGE ANALYSIS
The commit message is very clear and well-documented:
- **Problem**: `rtw8822b_set_antenna()` can be called from userspace
(via `iw` tool through nl80211/cfg80211/mac80211 path) when the WiFi
chip is powered off.
- **Symptom**: A `WARNING` is triggered in `rtw8822b_config_trx_mode()`
because reading RF registers while the chip is powered off returns
unexpected values.
- **Solution**: Only call `rtw8822b_config_trx_mode()` when the chip is
powered on (checked via `RTW_FLAG_POWERON` flag).
- **Evidence**: Full stack trace included showing the WARNING triggered
from userspace via `iw` command.
- **Link**: Bug report at https://github.com/lwfinger/rtw88/issues/366 —
real users reported this issue.
### 2. CODE CHANGE ANALYSIS
The change is minimal and surgical — a single conditional check:
```c
- rtw8822b_config_trx_mode(rtwdev, antenna_tx, antenna_rx, false);
+ if (test_bit(RTW_FLAG_POWERON, rtwdev->flags))
+ rtw8822b_config_trx_mode(rtwdev, antenna_tx, antenna_rx,
false);
```
This is a 2-line change (net +1 line) that:
- Wraps the call to `rtw8822b_config_trx_mode()` with a power-on state
check
- Uses the existing `RTW_FLAG_POWERON` flag — no new infrastructure
needed
- The antenna_tx/antenna_rx values are still saved to `hal->antenna_tx`
and `hal->antenna_rx` regardless of power state, so the configuration
will be applied when the chip powers on
### 3. CLASSIFICATION
- **Bug fix**: YES — fixes a WARNING triggered from userspace
- **Feature addition**: NO
- **Type**: Fixes improper state handling when userspace interacts with
the driver while hardware is powered off
### 4. SCOPE AND RISK ASSESSMENT
- **Lines changed**: 2 lines (1 removed, 2 added)
- **Files touched**: 1 file
(`drivers/net/wireless/realtek/rtw88/rtw8822b.c`)
- **Complexity**: Extremely low — trivial conditional guard
- **Risk of regression**: Very low. The only scenario where behavior
changes is when the chip is powered off, and in that case, trying to
configure RF registers was already broken (producing the WARNING). The
antenna settings are saved to HAL state regardless, so they'll be
applied at power-on.
- **Subsystem**: WiFi driver (rtw88) — a commonly used Realtek WiFi
driver
### 5. USER IMPACT
- **Who is affected**: Users of rtw88 8822b-based WiFi adapters (common
in many laptops)
- **Trigger**: Simply running `iw` commands to set antenna configuration
while the interface is down
- **Severity**: WARNING in kernel log, potentially confusing to users,
and the WARNING mechanism in the driver indicates an unexpected state
that could have further consequences
- **Real-world**: Bug was reported by actual users on GitHub issue
tracker
### 6. STABILITY INDICATORS
- **Acked-by**: Ping-Ke Shih (Realtek maintainer for this driver)
- **Signed-off-by**: Both the author and the subsystem maintainer
- **Bug report link**: Real user-reported issue with reproduction steps
### 7. DEPENDENCY CHECK
- The fix uses `RTW_FLAG_POWERON` and `test_bit()`, both of which have
been present in the rtw88 driver for a long time (since the driver's
introduction)
- No dependencies on other commits
- The `rtw8822b_set_antenna()` function and `rtw8822b_config_trx_mode()`
have been stable for many kernel versions
- This will apply cleanly to any stable tree that has the rtw88 driver
### 8. STABLE KERNEL CRITERIA
1. **Obviously correct and tested**: YES — the logic is trivially
correct: don't access hardware registers when hardware is off
2. **Fixes a real bug**: YES — a WARNING triggered from userspace
3. **Important issue**: YES — kernel WARNING from userspace interaction,
reproducible
4. **Small and contained**: YES — 2-line change in 1 file
5. **No new features**: CORRECT — pure bug fix
6. **Applies cleanly**: Very likely — minimal change to stable code
### Summary
This is a textbook stable backport candidate: a tiny, obviously correct
fix for a user-triggered WARNING in a commonly used WiFi driver. The fix
is minimal (2 lines), well-understood, properly reviewed by the
subsystem maintainer, and addresses a real user-reported issue. The risk
of regression is negligible.
**YES**
drivers/net/wireless/realtek/rtw88/rtw8822b.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/net/wireless/realtek/rtw88/rtw8822b.c b/drivers/net/wireless/realtek/rtw88/rtw8822b.c
index 89b6485b229a8..4d88cc2f41485 100644
--- a/drivers/net/wireless/realtek/rtw88/rtw8822b.c
+++ b/drivers/net/wireless/realtek/rtw88/rtw8822b.c
@@ -1005,7 +1005,8 @@ static int rtw8822b_set_antenna(struct rtw_dev *rtwdev,
hal->antenna_tx = antenna_tx;
hal->antenna_rx = antenna_rx;
- rtw8822b_config_trx_mode(rtwdev, antenna_tx, antenna_rx, false);
+ if (test_bit(RTW_FLAG_POWERON, rtwdev->flags))
+ rtw8822b_config_trx_mode(rtwdev, antenna_tx, antenna_rx, false);
return 0;
}
--
2.51.0
^ permalink raw reply related [flat|nested] 33+ messages in thread
* [PATCH AUTOSEL 6.19-6.12] wifi: rtw89: 8922a: add digital compensation for 2GHz
2026-02-14 21:22 [PATCH AUTOSEL 6.19-6.12] wifi: rtw89: ser: enable error IMR after recovering from L1 Sasha Levin
2026-02-14 21:22 ` [PATCH AUTOSEL 6.19-6.12] wifi: ath11k: Fix failure to connect to a 6 GHz AP Sasha Levin
2026-02-14 21:22 ` [PATCH AUTOSEL 6.19-6.1] wifi: rtw88: 8822b: Avoid WARNING in rtw8822b_config_trx_mode() Sasha Levin
@ 2026-02-14 21:22 ` Sasha Levin
2026-02-14 21:22 ` [PATCH AUTOSEL 6.19-6.18] wifi: rtw89: pci: validate sequence number of TX release report Sasha Levin
` (28 subsequent siblings)
31 siblings, 0 replies; 33+ messages in thread
From: Sasha Levin @ 2026-02-14 21:22 UTC (permalink / raw)
To: patches, stable; +Cc: Po-Hao Huang, Ping-Ke Shih, Sasha Levin, linux-wireless
From: Po-Hao Huang <phhuang@realtek.com>
[ Upstream commit 8da7e88682d58a7c2e2c2101e49d3c9c9ac481b0 ]
This fixes transmit power too low under 2GHz connection. Previously
we missed the settings of 2GHz, add the according calibrated tables.
Signed-off-by: Po-Hao Huang <phhuang@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://patch.msgid.link/20260117044157.2392958-10-pkshih@realtek.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
LLM Generated explanations, may be completely bogus:
## Analysis
### Commit Message Analysis
The commit says it "fixes transmit power too low under 2GHz connection"
by adding previously "missed" calibration tables for the 2GHz band. The
subject says "add digital compensation for 2GHz" — this is framed as
adding missing functionality rather than fixing a clear crash/corruption
bug.
### Code Change Analysis
Let me examine the changes in detail:
1. **New data tables added**: Three new static const arrays
(`rtw8922a_digital_pwr_comp_2g_s0_val`,
`rtw8922a_digital_pwr_comp_2g_s1_val`) containing calibration values
for 2GHz band, for path 0 (s0) and path 1 (s1). These are ~37 lines
of pure data.
2. **Function signature change**: `rtw8922a_set_digital_pwr_comp()`
changes the `bool enable` parameter to `u8 band`. This is a semantic
change — previously, for 2GHz, the function would write zeros to all
registers (effectively disabling compensation). Now it writes band-
specific calibration values.
3. **Logic change in `rtw8922a_set_digital_pwr_comp()`**: Previously, if
`enable` was false (2GHz band), all registers were set to 0 (`val =
enable ? digital_pwr_comp[i] : 0`). Now, the function always writes
calibration data, selecting the appropriate table based on band and
path.
4. **Logic change in `rtw8922a_digital_pwr_comp()`**: The `bool enable =
chan->band_type != RTW89_BAND_2G` is replaced with `u8 band =
chan->band_type`, and the band is passed through to the set function.
### Bug Assessment
The original code had a real functional deficiency: on 2GHz, digital
power compensation was completely disabled (all zeros written),
resulting in "transmit power too low." This means:
- **Real user impact**: WiFi connections on 2.4GHz band would have poor
signal/throughput on the RTW8922A chip
- **This is a bug fix**: The 2GHz compensation data was supposed to be
there but was missing. The existing code structure (with
enable/disable logic) was a workaround for having no 2GHz tables
### Scope and Risk Assessment
- **Files changed**: 1 file (rtw8922a.c)
- **Lines added**: ~47 lines of data tables + ~15 lines of logic changes
- **Lines removed**: ~10 lines
- **Scope**: Entirely contained within the RTW8922A WiFi driver
- **Risk**: Low — the change only affects the RTW8922A chip on 2GHz
band. The 5GHz/6GHz paths continue to use the same tables as before.
The logic is straightforward table selection based on band and path.
### Stable Kernel Criteria Check
1. **Obviously correct and tested**: The change is from the Realtek
driver maintainers themselves, adding calibration data they would
have tested. The logic is simple table selection.
2. **Fixes a real bug**: Yes — transmit power too low on 2GHz is a real
functional bug affecting WiFi connectivity.
3. **Important issue**: This affects basic WiFi functionality on 2.4GHz
for users of this chip. Low TX power means poor range, throughput,
and possibly connection drops.
4. **Small and contained**: Yes — single driver file, straightforward
table data addition and selection logic.
5. **No new features**: This restores intended functionality rather than
adding new capability. The driver already supported 2GHz band; it
just had wrong/missing calibration data.
### Concerns
- **RTW8922A is a newer chip**: This is a WiFi 7 (802.11be) chip. Need
to verify it exists in stable trees. The file `rtw8922a.c` was added
relatively recently, so it may not be present in older stable branches
(e.g., 6.1.y, 5.15.y). However, if it is present in a given stable
tree, this fix is clearly needed.
- **No explicit Fixes: tag**: Expected for candidates under review.
- **Data tables are large**: But they're static const data with zero
risk of runtime regression.
- **The `enable` parameter removal**: The old `val = enable ?
digital_pwr_comp[i] : 0` path (writing zeros for 2GHz) is completely
removed. This is the intended behavior change — from "disable on 2GHz"
to "use proper 2GHz tables."
### Verdict
This fixes a real functional bug (low transmit power on 2.4GHz WiFi) for
users of the RTW8922A chip. The fix is contained within a single driver,
adds only calibration data tables and simple selection logic, and comes
from the chip vendor's driver team. While it's a relatively new driver,
for any stable tree that contains this driver, the fix would be
important — 2.4GHz WiFi with too-low TX power is essentially broken for
many use cases.
The change is low-risk, driver-specific, and fixes a real user-facing
problem. It meets stable kernel criteria.
**YES**
drivers/net/wireless/realtek/rtw89/rtw8922a.c | 57 +++++++++++++++----
1 file changed, 47 insertions(+), 10 deletions(-)
diff --git a/drivers/net/wireless/realtek/rtw89/rtw8922a.c b/drivers/net/wireless/realtek/rtw89/rtw8922a.c
index 4bcf20612a455..52da0fa02da01 100644
--- a/drivers/net/wireless/realtek/rtw89/rtw8922a.c
+++ b/drivers/net/wireless/realtek/rtw89/rtw8922a.c
@@ -1770,6 +1770,32 @@ static int rtw8922a_ctrl_rx_path_tmac(struct rtw89_dev *rtwdev,
}
#define DIGITAL_PWR_COMP_REG_NUM 22
+static const u32 rtw8922a_digital_pwr_comp_2g_s0_val[][DIGITAL_PWR_COMP_REG_NUM] = {
+ {0x012C0064, 0x04B00258, 0x00432710, 0x019000A7, 0x06400320,
+ 0x0D05091D, 0x14D50FA0, 0x00000000, 0x01010000, 0x00000101,
+ 0x01010101, 0x02020201, 0x02010000, 0x03030202, 0x00000303,
+ 0x03020101, 0x06060504, 0x01010000, 0x06050403, 0x01000606,
+ 0x05040202, 0x07070706},
+ {0x012C0064, 0x04B00258, 0x00432710, 0x019000A7, 0x06400320,
+ 0x0D05091D, 0x14D50FA0, 0x00000000, 0x01010100, 0x00000101,
+ 0x01000000, 0x01010101, 0x01010000, 0x02020202, 0x00000404,
+ 0x03020101, 0x04040303, 0x02010000, 0x03030303, 0x00000505,
+ 0x03030201, 0x05050303},
+};
+
+static const u32 rtw8922a_digital_pwr_comp_2g_s1_val[][DIGITAL_PWR_COMP_REG_NUM] = {
+ {0x012C0064, 0x04B00258, 0x00432710, 0x019000A7, 0x06400320,
+ 0x0D05091D, 0x14D50FA0, 0x01010000, 0x01010101, 0x00000101,
+ 0x01010100, 0x01010101, 0x01010000, 0x02020202, 0x01000202,
+ 0x02020101, 0x03030202, 0x02010000, 0x05040403, 0x01000606,
+ 0x05040302, 0x07070605},
+ {0x012C0064, 0x04B00258, 0x00432710, 0x019000A7, 0x06400320,
+ 0x0D05091D, 0x14D50FA0, 0x00000000, 0x01010100, 0x00000101,
+ 0x01010000, 0x02020201, 0x02010100, 0x03030202, 0x01000404,
+ 0x04030201, 0x05050404, 0x01010100, 0x04030303, 0x01000505,
+ 0x03030101, 0x05050404},
+};
+
static const u32 rtw8922a_digital_pwr_comp_val[][DIGITAL_PWR_COMP_REG_NUM] = {
{0x012C0096, 0x044C02BC, 0x00322710, 0x015E0096, 0x03C8028A,
0x0BB80708, 0x17701194, 0x02020100, 0x03030303, 0x01000303,
@@ -1784,7 +1810,7 @@ static const u32 rtw8922a_digital_pwr_comp_val[][DIGITAL_PWR_COMP_REG_NUM] = {
};
static void rtw8922a_set_digital_pwr_comp(struct rtw89_dev *rtwdev,
- bool enable, u8 nss,
+ u8 band, u8 nss,
enum rtw89_rf_path path)
{
static const u32 ltpc_t0[2] = {R_BE_LTPC_T0_PATH0, R_BE_LTPC_T0_PATH1};
@@ -1792,14 +1818,25 @@ static void rtw8922a_set_digital_pwr_comp(struct rtw89_dev *rtwdev,
u32 addr, val;
u32 i;
- if (nss == 1)
- digital_pwr_comp = rtw8922a_digital_pwr_comp_val[0];
- else
- digital_pwr_comp = rtw8922a_digital_pwr_comp_val[1];
+ if (nss == 1) {
+ if (band == RTW89_BAND_2G)
+ digital_pwr_comp = path == RF_PATH_A ?
+ rtw8922a_digital_pwr_comp_2g_s0_val[0] :
+ rtw8922a_digital_pwr_comp_2g_s1_val[0];
+ else
+ digital_pwr_comp = rtw8922a_digital_pwr_comp_val[0];
+ } else {
+ if (band == RTW89_BAND_2G)
+ digital_pwr_comp = path == RF_PATH_A ?
+ rtw8922a_digital_pwr_comp_2g_s0_val[1] :
+ rtw8922a_digital_pwr_comp_2g_s1_val[1];
+ else
+ digital_pwr_comp = rtw8922a_digital_pwr_comp_val[1];
+ }
addr = ltpc_t0[path];
for (i = 0; i < DIGITAL_PWR_COMP_REG_NUM; i++, addr += 4) {
- val = enable ? digital_pwr_comp[i] : 0;
+ val = digital_pwr_comp[i];
rtw89_phy_write32(rtwdev, addr, val);
}
}
@@ -1808,7 +1845,7 @@ static void rtw8922a_digital_pwr_comp(struct rtw89_dev *rtwdev,
enum rtw89_phy_idx phy_idx)
{
const struct rtw89_chan *chan = rtw89_chan_get(rtwdev, RTW89_CHANCTX_0);
- bool enable = chan->band_type != RTW89_BAND_2G;
+ u8 band = chan->band_type;
u8 path;
if (rtwdev->mlo_dbcc_mode == MLO_1_PLUS_1_1RF) {
@@ -1816,10 +1853,10 @@ static void rtw8922a_digital_pwr_comp(struct rtw89_dev *rtwdev,
path = RF_PATH_A;
else
path = RF_PATH_B;
- rtw8922a_set_digital_pwr_comp(rtwdev, enable, 1, path);
+ rtw8922a_set_digital_pwr_comp(rtwdev, band, 1, path);
} else {
- rtw8922a_set_digital_pwr_comp(rtwdev, enable, 2, RF_PATH_A);
- rtw8922a_set_digital_pwr_comp(rtwdev, enable, 2, RF_PATH_B);
+ rtw8922a_set_digital_pwr_comp(rtwdev, band, 2, RF_PATH_A);
+ rtw8922a_set_digital_pwr_comp(rtwdev, band, 2, RF_PATH_B);
}
}
--
2.51.0
^ permalink raw reply related [flat|nested] 33+ messages in thread
* [PATCH AUTOSEL 6.19-6.18] wifi: rtw89: pci: validate sequence number of TX release report
2026-02-14 21:22 [PATCH AUTOSEL 6.19-6.12] wifi: rtw89: ser: enable error IMR after recovering from L1 Sasha Levin
` (2 preceding siblings ...)
2026-02-14 21:22 ` [PATCH AUTOSEL 6.19-6.12] wifi: rtw89: 8922a: add digital compensation for 2GHz Sasha Levin
@ 2026-02-14 21:22 ` Sasha Levin
2026-02-14 21:22 ` [PATCH AUTOSEL 6.19-5.10] wifi: iwlegacy: add missing mutex protection in il4965_store_tx_power() Sasha Levin
` (27 subsequent siblings)
31 siblings, 0 replies; 33+ messages in thread
From: Sasha Levin @ 2026-02-14 21:22 UTC (permalink / raw)
To: patches, stable; +Cc: Ping-Ke Shih, Sasha Levin, linux-wireless
From: Ping-Ke Shih <pkshih@realtek.com>
[ Upstream commit 957eda596c7665f2966970fd1dcc35fe299b38e8 ]
Hardware rarely reports abnormal sequence number in TX release report,
which will access out-of-bounds of wd_ring->pages array, causing NULL
pointer dereference.
BUG: kernel NULL pointer dereference, address: 0000000000000000
#PF: supervisor read access in kernel mode
#PF: error_code(0x0000) - not-present page
PGD 0 P4D 0
Oops: 0000 [#1] PREEMPT SMP NOPTI
CPU: 1 PID: 1085 Comm: irq/129-rtw89_p Tainted: G S U
6.1.145-17510-g2f3369c91536 #1 (HASH:69e8 1)
Call Trace:
<IRQ>
rtw89_pci_release_tx+0x18f/0x300 [rtw89_pci (HASH:4c83 2)]
rtw89_pci_napi_poll+0xc2/0x190 [rtw89_pci (HASH:4c83 2)]
net_rx_action+0xfc/0x460 net/core/dev.c:6578 net/core/dev.c:6645 net/core/dev.c:6759
handle_softirqs+0xbe/0x290 kernel/softirq.c:601
? rtw89_pci_interrupt_threadfn+0xc5/0x350 [rtw89_pci (HASH:4c83 2)]
__local_bh_enable_ip+0xeb/0x120 kernel/softirq.c:499 kernel/softirq.c:423
</IRQ>
<TASK>
rtw89_pci_interrupt_threadfn+0xf8/0x350 [rtw89_pci (HASH:4c83 2)]
? irq_thread+0xa7/0x340 kernel/irq/manage.c:0
irq_thread+0x177/0x340 kernel/irq/manage.c:1205 kernel/irq/manage.c:1314
? thaw_kernel_threads+0xb0/0xb0 kernel/irq/manage.c:1202
? irq_forced_thread_fn+0x80/0x80 kernel/irq/manage.c:1220
kthread+0xea/0x110 kernel/kthread.c:376
? synchronize_irq+0x1a0/0x1a0 kernel/irq/manage.c:1287
? kthread_associate_blkcg+0x80/0x80 kernel/kthread.c:331
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295
</TASK>
To prevent crash, validate rpp_info.seq before using.
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://patch.msgid.link/20260110022019.2254969-2-pkshih@realtek.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
LLM Generated explanations, may be completely bogus:
## Analysis
### Commit Message Analysis
The commit message is crystal clear about the bug:
- **Hardware rarely reports abnormal sequence numbers** in TX release
reports
- This causes **out-of-bounds access** on `wd_ring->pages` array
- Results in a **NULL pointer dereference** (kernel crash)
- A full crash trace is provided, showing this is a **reproducible,
real-world bug**
The crash trace shows it occurs in an IRQ context
(`rtw89_pci_release_tx` → `rtw89_pci_napi_poll` → `net_rx_action`),
meaning when this bug triggers, it crashes the system during normal
network operation.
### Code Change Analysis
The fix is extremely small and surgical — it adds a **bounds check** on
`rpp_info.seq` before it's used to index into the `wd_ring->pages`
array:
```c
if (unlikely(rpp_info.seq >= RTW89_PCI_TXWD_NUM_MAX)) {
rtw89_warn(rtwdev, "invalid seq %d\n", rpp_info.seq);
return;
}
```
This is placed right before the line:
```c
txwd = &wd_ring->pages[rpp_info.seq];
```
Without this check, an out-of-bounds `seq` value from the hardware leads
to accessing memory beyond the `pages` array, causing a NULL pointer
dereference (or potentially worse — arbitrary memory access).
The only other change is adding `unlikely()` to an existing check on
`rpp_info.txch == RTW89_TXCH_CH12`, which is a minor optimization hint
and completely safe.
### Bug Classification
This is a textbook **out-of-bounds array access / NULL pointer
dereference** fix:
- The `seq` value comes from hardware (parsed from the TX release report
via `parse_rpp`)
- Hardware can occasionally provide invalid/corrupt values
- No validation was performed before using `seq` as an array index
- Result: kernel crash (BUG: kernel NULL pointer dereference)
### Stable Kernel Criteria Assessment
1. **Obviously correct and tested**: Yes — it's a simple bounds check
before array access. The author (Realtek maintainer) clearly
understands the code.
2. **Fixes a real bug**: Yes — NULL pointer dereference causing kernel
crash, with a full stack trace demonstrating the issue.
3. **Important issue**: Yes — kernel crash/oops during normal WiFi
operation.
4. **Small and contained**: Yes — adds 4 lines of bounds checking code,
changes 1 line (adding `unlikely()`), in a single file.
5. **No new features**: Correct — pure bug fix.
6. **Applies cleanly**: The change is self-contained with no
dependencies on other commits.
### Risk Assessment
**Risk: Very Low**
- The fix only adds a validation check that returns early on invalid
input
- It cannot introduce regressions — it only rejects values that would
have caused a crash anyway
- The `RTW89_PCI_TXWD_NUM_MAX` constant is already used elsewhere in the
driver for allocating the `pages` array, so it's the correct bound
- Single file, single function, minimal change
**Benefit: High**
- Prevents kernel crashes for rtw89 WiFi users
- The rtw89 driver supports popular Realtek WiFi chips (RTW8852A,
RTW8852B, RTW8852C, etc.) used in many laptops
- The crash occurs during normal WiFi operation when hardware reports a
bad sequence number
### Author and Trust
- **Ping-Ke Shih** is the Realtek WiFi driver maintainer — highly
trusted for rtw89 changes
- The commit includes a detailed crash trace demonstrating the real-
world impact
- The kernel version in the trace (6.1.145) suggests this was actually
hit on a stable kernel
### Dependencies
None. The fix is completely self-contained. `RTW89_PCI_TXWD_NUM_MAX` is
already defined in the driver.
### Summary
This is an ideal stable backport candidate: a small, obviously correct
bounds check that prevents a kernel NULL pointer dereference crash in a
widely-used WiFi driver. It has zero regression risk, fixes a real bug
that users hit in production, and is authored by the subsystem
maintainer.
**YES**
drivers/net/wireless/realtek/rtw89/pci.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/drivers/net/wireless/realtek/rtw89/pci.c b/drivers/net/wireless/realtek/rtw89/pci.c
index a66fcdb0293b6..093960d7279f8 100644
--- a/drivers/net/wireless/realtek/rtw89/pci.c
+++ b/drivers/net/wireless/realtek/rtw89/pci.c
@@ -604,11 +604,16 @@ static void rtw89_pci_release_rpp(struct rtw89_dev *rtwdev, void *rpp)
info->parse_rpp(rtwdev, rpp, &rpp_info);
- if (rpp_info.txch == RTW89_TXCH_CH12) {
+ if (unlikely(rpp_info.txch == RTW89_TXCH_CH12)) {
rtw89_warn(rtwdev, "should no fwcmd release report\n");
return;
}
+ if (unlikely(rpp_info.seq >= RTW89_PCI_TXWD_NUM_MAX)) {
+ rtw89_warn(rtwdev, "invalid seq %d\n", rpp_info.seq);
+ return;
+ }
+
tx_ring = &rtwpci->tx.rings[rpp_info.txch];
wd_ring = &tx_ring->wd_ring;
txwd = &wd_ring->pages[rpp_info.seq];
--
2.51.0
^ permalink raw reply related [flat|nested] 33+ messages in thread
* [PATCH AUTOSEL 6.19-5.10] wifi: iwlegacy: add missing mutex protection in il4965_store_tx_power()
2026-02-14 21:22 [PATCH AUTOSEL 6.19-6.12] wifi: rtw89: ser: enable error IMR after recovering from L1 Sasha Levin
` (3 preceding siblings ...)
2026-02-14 21:22 ` [PATCH AUTOSEL 6.19-6.18] wifi: rtw89: pci: validate sequence number of TX release report Sasha Levin
@ 2026-02-14 21:22 ` Sasha Levin
2026-02-14 21:22 ` [PATCH AUTOSEL 6.19-6.6] wifi: rtw88: rtw8821cu: Add ID for Mercusys MU6H Sasha Levin
` (26 subsequent siblings)
31 siblings, 0 replies; 33+ messages in thread
From: Sasha Levin @ 2026-02-14 21:22 UTC (permalink / raw)
To: patches, stable
Cc: Ziyi Guo, Stanislaw Gruszka, Johannes Berg, Sasha Levin,
linux-wireless
From: Ziyi Guo <n7l8m4@u.northwestern.edu>
[ Upstream commit e31fa691d0b1c07b6094a6cf0cce894192c462b3 ]
il4965_store_tx_power() calls il_set_tx_power() without holding il->mutex.
However, il_set_tx_power() has lockdep_assert_held(&il->mutex) indicating
that callers must hold this lock.
All other callers of il_set_tx_power() properly acquire the mutex:
- il_bg_scan_completed() acquires mutex at common.c:1683
- il_mac_config() acquires mutex at common.c:5006
- il3945_commit_rxon() and il4965_commit_rxon() are called via work
queues that hold the mutex (like il4965_bg_alive_start)
Add mutex_lock()/mutex_unlock() around the il_set_tx_power() call in
the sysfs store function to fix the missing lock protection.
Signed-off-by: Ziyi Guo <n7l8m4@u.northwestern.edu>
Acked-by: Stanislaw Gruszka <stf_xl@wp.pl>
Link: https://patch.msgid.link/20260125194039.1196488-1-n7l8m4@u.northwestern.edu
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
LLM Generated explanations, may be completely bogus:
## Analysis
### Commit Message Analysis
The commit message is clear and well-documented. It identifies a
specific bug: `il4965_store_tx_power()` calls `il_set_tx_power()`
without holding `il->mutex`, but `il_set_tx_power()` requires this lock
(enforced via `lockdep_assert_held`). The message also documents that
all other callers properly acquire the mutex, making this the only call
site that's missing the protection.
### Code Change Analysis
The fix is minimal and surgical — exactly 2 lines added:
```c
mutex_lock(&il->mutex);
ret = il_set_tx_power(il, val, false);
mutex_unlock(&il->mutex);
```
This is a sysfs store handler (`il4965_store_tx_power`), which can be
triggered from userspace by writing to the `tx_power` sysfs attribute.
Without the mutex:
1. **lockdep warning**: The `lockdep_assert_held(&il->mutex)` in
`il_set_tx_power()` will fire a warning/splat every time a user
writes to this sysfs file.
2. **Race condition**: `il_set_tx_power()` modifies driver state that is
also accessed by other code paths (scan completion, mac80211 config,
rxon commits) which all hold the mutex. Without the mutex, concurrent
access from sysfs and these other paths could corrupt driver state,
potentially leading to firmware errors, crashes, or undefined
behavior.
### Classification
This is a **synchronization bug fix** — missing mutex protection around
a function that requires it. It falls squarely into the "race condition"
and "missing locking" categories of stable-worthy fixes.
### Scope and Risk Assessment
- **Lines changed**: 2 (adding mutex_lock/unlock)
- **Files touched**: 1
- **Risk**: Extremely low. Adding mutex protection around a single
function call in a sysfs handler is about as safe as it gets. The
mutex is already used throughout the driver, and all other callers of
`il_set_tx_power()` already hold it. There's no risk of deadlock since
this is a sysfs store handler (not called from any context that
already holds the mutex).
- **Subsystem**: iwlegacy wireless driver — a mature, legacy Intel WiFi
driver
### User Impact
- Any user with iwlegacy hardware who writes to the `tx_power` sysfs
attribute will trigger a lockdep splat (if lockdep is enabled) and
potentially experience a race condition
- The race could lead to corrupted driver state, firmware errors, or
crashes
- The sysfs interface is a user-facing control, so this is a realistic
trigger path
### Stability Indicators
- **Acked-by**: Stanislaw Gruszka (iwlegacy maintainer) — strong signal
- **Committed by**: Johannes Berg (Intel wireless maintainer) — strong
signal
- The fix pattern (adding mutex around a call that requires it) is well-
understood and obviously correct
### Dependency Check
This commit is completely self-contained. It adds standard
mutex_lock/unlock calls around an existing function call. No other
patches are needed. The iwlegacy driver and this specific code path have
existed in stable kernels for a very long time.
### Conclusion
This is a textbook stable backport candidate:
- **Obviously correct**: The function requires the mutex (has lockdep
assertion), all other callers hold it, this one doesn't — the fix adds
the missing lock
- **Fixes a real bug**: Missing synchronization causing potential races
and lockdep warnings
- **Small and contained**: 2 lines added, 1 file changed
- **No new features**: Pure bug fix
- **Low risk**: Standard locking pattern, well-tested by maintainer
review
- **Acked by subsystem maintainer**: Confirms the fix is appropriate
**YES**
drivers/net/wireless/intel/iwlegacy/4965-mac.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/net/wireless/intel/iwlegacy/4965-mac.c b/drivers/net/wireless/intel/iwlegacy/4965-mac.c
index 3588dec75ebdd..57fa866efd9f8 100644
--- a/drivers/net/wireless/intel/iwlegacy/4965-mac.c
+++ b/drivers/net/wireless/intel/iwlegacy/4965-mac.c
@@ -4606,7 +4606,9 @@ il4965_store_tx_power(struct device *d, struct device_attribute *attr,
if (ret)
IL_INFO("%s is not in decimal form.\n", buf);
else {
+ mutex_lock(&il->mutex);
ret = il_set_tx_power(il, val, false);
+ mutex_unlock(&il->mutex);
if (ret)
IL_ERR("failed setting tx power (0x%08x).\n", ret);
else
--
2.51.0
^ permalink raw reply related [flat|nested] 33+ messages in thread
* [PATCH AUTOSEL 6.19-6.6] wifi: rtw88: rtw8821cu: Add ID for Mercusys MU6H
2026-02-14 21:22 [PATCH AUTOSEL 6.19-6.12] wifi: rtw89: ser: enable error IMR after recovering from L1 Sasha Levin
` (4 preceding siblings ...)
2026-02-14 21:22 ` [PATCH AUTOSEL 6.19-5.10] wifi: iwlegacy: add missing mutex protection in il4965_store_tx_power() Sasha Levin
@ 2026-02-14 21:22 ` Sasha Levin
2026-02-14 21:22 ` [PATCH AUTOSEL 6.19-6.18] wifi: rtw89: Add support for MSI AX1800 Nano (GUAX18N) Sasha Levin
` (25 subsequent siblings)
31 siblings, 0 replies; 33+ messages in thread
From: Sasha Levin @ 2026-02-14 21:22 UTC (permalink / raw)
To: patches, stable
Cc: Hsiu-Ming Chang, Ping-Ke Shih, Sasha Levin, linux-wireless
From: Hsiu-Ming Chang <cges30901@gmail.com>
[ Upstream commit 77653c327e11c71c5363b18a53fbf2b92ed21da4 ]
Add support for Mercusys MU6H AC650 High Gain Wireless Dual Band USB
Adapter V1.30. It is based on RTL8811CU, usb device ID is 2c4e:0105.
Signed-off-by: Hsiu-Ming Chang <cges30901@gmail.com>
Acked-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://patch.msgid.link/20251205003245.5762-1-cges30901@gmail.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
LLM Generated explanations, may be completely bogus:
## Analysis: Adding USB Device ID for Mercusys MU6H to rtw8821cu driver
### Commit Message Analysis
The commit adds a USB device ID (vendor: 0x2c4e, product: 0x0105) for
the Mercusys MU6H AC650 High Gain Wireless Dual Band USB Adapter to the
existing rtw8821cu driver. The device is based on the RTL8811CU chipset.
### Code Change Analysis
The change is a **two-line addition** to the USB device ID table in
`drivers/net/wireless/realtek/rtw88/rtw8821cu.c`:
```c
{ USB_DEVICE_AND_INTERFACE_INFO(0x2c4e, 0x0105, 0xff, 0xff, 0xff),
.driver_info = (kernel_ulong_t)&(rtw8821c_hw_spec) }, /* Mercusys */
```
This follows the exact same pattern as every other entry in the table
(D-Link, Edimax, and the various Realtek-branded variants). The entry
uses the same `rtw8821c_hw_spec` hardware specification structure,
meaning the driver already fully supports this chipset — it just needs
to know about this particular vendor/product ID combination.
### Classification
This is a **new device ID addition** to an existing driver — one of the
explicitly listed exceptions that IS appropriate for stable backporting.
From the stable rules:
> **NEW DEVICE IDs (Very Common):** Adding PCI IDs, USB IDs, ACPI IDs,
etc. to existing drivers. These are trivial one-line additions that
enable hardware support. Rule: The driver must already exist in stable;
only the ID is new.
### Risk Assessment
- **Risk: Extremely low.** This is a pure data addition — a new entry in
a USB ID matching table. It cannot affect any existing functionality.
- **Scope: Minimal.** Two lines added, one file changed, no logic
changes.
- **Regression potential: Zero.** The new ID only matches a specific USB
device (0x2c4e:0x0105). No other device is affected.
### User Impact
- Users with this specific Mercusys MU6H adapter cannot use it at all
without this ID entry. With the entry, the existing (and already
working) rtw8821cu driver will automatically bind to the device.
- This is a consumer WiFi adapter, so real users on stable kernels would
benefit from this backport.
### Stability Indicators
- Acked-by the Realtek maintainer (Ping-Ke Shih)
- The pattern is identical to existing entries
- The rtw88 driver and rtw8821cu sub-driver already exist in stable
trees
### Dependencies
- None. This is a completely self-contained change.
### Conclusion
This is a textbook example of a device ID addition that should be
backported to stable. It enables hardware support for a specific USB
WiFi adapter using an already-existing, well-tested driver. The change
is trivial, zero-risk, and directly benefits users who own this device.
**YES**
drivers/net/wireless/realtek/rtw88/rtw8821cu.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/net/wireless/realtek/rtw88/rtw8821cu.c b/drivers/net/wireless/realtek/rtw88/rtw8821cu.c
index 7a0fffc359e25..8cd09d66655db 100644
--- a/drivers/net/wireless/realtek/rtw88/rtw8821cu.c
+++ b/drivers/net/wireless/realtek/rtw88/rtw8821cu.c
@@ -37,6 +37,8 @@ static const struct usb_device_id rtw_8821cu_id_table[] = {
.driver_info = (kernel_ulong_t)&(rtw8821c_hw_spec) }, /* Edimax */
{ USB_DEVICE_AND_INTERFACE_INFO(0x7392, 0xd811, 0xff, 0xff, 0xff),
.driver_info = (kernel_ulong_t)&(rtw8821c_hw_spec) }, /* Edimax */
+ { USB_DEVICE_AND_INTERFACE_INFO(0x2c4e, 0x0105, 0xff, 0xff, 0xff),
+ .driver_info = (kernel_ulong_t)&(rtw8821c_hw_spec) }, /* Mercusys */
{},
};
MODULE_DEVICE_TABLE(usb, rtw_8821cu_id_table);
--
2.51.0
^ permalink raw reply related [flat|nested] 33+ messages in thread
* [PATCH AUTOSEL 6.19-6.18] wifi: rtw89: Add support for MSI AX1800 Nano (GUAX18N)
2026-02-14 21:22 [PATCH AUTOSEL 6.19-6.12] wifi: rtw89: ser: enable error IMR after recovering from L1 Sasha Levin
` (5 preceding siblings ...)
2026-02-14 21:22 ` [PATCH AUTOSEL 6.19-6.6] wifi: rtw88: rtw8821cu: Add ID for Mercusys MU6H Sasha Levin
@ 2026-02-14 21:22 ` Sasha Levin
2026-02-14 21:22 ` [PATCH AUTOSEL 6.19-6.18] wifi: rtw89: mcc: reset probe counter when receiving beacon Sasha Levin
` (24 subsequent siblings)
31 siblings, 0 replies; 33+ messages in thread
From: Sasha Levin @ 2026-02-14 21:22 UTC (permalink / raw)
To: patches, stable; +Cc: Zenm Chen, Ping-Ke Shih, Sasha Levin, linux-wireless
From: Zenm Chen <zenmchen@gmail.com>
[ Upstream commit 3116f287b81fe777a00b93ab07ec3c270093b185 ]
Add the ID 0db0:f0c8 to the table to support an additional RTL8832BU
adapter: MSI AX1800 Nano (GUAX18N).
Compile tested only.
Link: https://github.com/morrownr/rtl8852bu-20250826/pull/2
Signed-off-by: Zenm Chen <zenmchen@gmail.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://patch.msgid.link/20260112004358.5516-1-zenmchen@gmail.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
LLM Generated explanations, may be completely bogus:
## Analysis
### Commit Overview
This commit adds a single USB device ID (`0x0db0:0xf0c8`) to the
`rtw_8852bu_id_table` in the rtw89 wireless driver to support the MSI
AX1800 Nano (GUAX18N) USB WiFi adapter, which uses the RTL8832BU
chipset.
### Classification: New Device ID Addition
This falls squarely into the **"NEW DEVICE IDs"** exception category for
stable backports:
- It adds a USB device ID to an **existing, already-supported driver**
(rtw89/rtw8852bu)
- The driver infrastructure is already in place; only the ID mapping is
new
- The same `rtw89_8852bu_info` driver_info structure is used, identical
to all other entries in the table
### Code Change Analysis
- **Size**: +2 lines (one `USB_DEVICE_AND_INTERFACE_INFO` entry)
- **Scope**: Single file, single table entry addition
- **Pattern**: Identical to every other entry in the table — `{
USB_DEVICE_AND_INTERFACE_INFO(vendor, product, 0xff, 0xff, 0xff),
.driver_info = (kernel_ulong_t)&rtw89_8852bu_info }`
- **Risk**: Essentially zero. The new entry only matches when the
specific USB device (`0x0db0:0xf0c8`) is present. It cannot affect any
other hardware or code path.
### User Impact
- Without this ID, users with the MSI AX1800 Nano adapter cannot use it
with the in-kernel rtw89 driver on stable kernels
- WiFi adapter support is a common and important need for end users
- The vendor (MSI, vendor ID `0x0db0`) already has another device
(`0x6931`) in the same table, confirming this is a known hardware
vendor for this chipset
### Risk Assessment
- **Risk**: Negligible — a device ID table addition cannot cause
regressions for existing users
- **Benefit**: Enables hardware support for a real commercial WiFi
adapter
- **Dependencies**: None — requires only that the rtw8852bu driver
exists in the stable tree
### Stability Considerations
- The commit note says "Compile tested only," which is typical for
device ID additions where the submitter may not have all test
infrastructure but the change is trivially correct by inspection
- The patch was accepted by the subsystem maintainer (Ping-Ke Shih from
Realtek)
### Dependency Check
The rtw8852bu USB driver needs to exist in the target stable tree. This
driver was added relatively recently, so this backport is only
applicable to stable branches that already contain the rtw89 USB
support.
### Conclusion
This is a textbook device ID addition — the most common and least risky
type of stable backport. It's a trivial 2-line addition that enables
real hardware for real users with zero regression risk.
**YES**
drivers/net/wireless/realtek/rtw89/rtw8852bu.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/net/wireless/realtek/rtw89/rtw8852bu.c b/drivers/net/wireless/realtek/rtw89/rtw8852bu.c
index 980d17ef68d0a..84cd3ec971f98 100644
--- a/drivers/net/wireless/realtek/rtw89/rtw8852bu.c
+++ b/drivers/net/wireless/realtek/rtw89/rtw8852bu.c
@@ -54,6 +54,8 @@ static const struct usb_device_id rtw_8852bu_id_table[] = {
.driver_info = (kernel_ulong_t)&rtw89_8852bu_info },
{ USB_DEVICE_AND_INTERFACE_INFO(0x0db0, 0x6931, 0xff, 0xff, 0xff),
.driver_info = (kernel_ulong_t)&rtw89_8852bu_info },
+ { USB_DEVICE_AND_INTERFACE_INFO(0x0db0, 0xf0c8, 0xff, 0xff, 0xff),
+ .driver_info = (kernel_ulong_t)&rtw89_8852bu_info },
{ USB_DEVICE_AND_INTERFACE_INFO(0x2001, 0x3327, 0xff, 0xff, 0xff),
.driver_info = (kernel_ulong_t)&rtw89_8852bu_info },
{ USB_DEVICE_AND_INTERFACE_INFO(0x3574, 0x6121, 0xff, 0xff, 0xff),
--
2.51.0
^ permalink raw reply related [flat|nested] 33+ messages in thread
* [PATCH AUTOSEL 6.19-6.18] wifi: rtw89: mcc: reset probe counter when receiving beacon
2026-02-14 21:22 [PATCH AUTOSEL 6.19-6.12] wifi: rtw89: ser: enable error IMR after recovering from L1 Sasha Levin
` (6 preceding siblings ...)
2026-02-14 21:22 ` [PATCH AUTOSEL 6.19-6.18] wifi: rtw89: Add support for MSI AX1800 Nano (GUAX18N) Sasha Levin
@ 2026-02-14 21:22 ` Sasha Levin
2026-02-14 21:22 ` [PATCH AUTOSEL 6.19-6.18] wifi: rtw89: setting TBTT AGG number when mac port initialization Sasha Levin
` (23 subsequent siblings)
31 siblings, 0 replies; 33+ messages in thread
From: Sasha Levin @ 2026-02-14 21:22 UTC (permalink / raw)
To: patches, stable
Cc: Chih-Kang Chang, Ping-Ke Shih, Sasha Levin, linux-wireless
From: Chih-Kang Chang <gary.chang@realtek.com>
[ Upstream commit 1b40c1c7571fcf926095ed92f25bd87900bdc8ed ]
For BE chips, needs to transmit QoS null data periodically to ensure
the connection with AP in GC+STA mode. However, in environments
with interference, the Qos null data might fail to transmit
successfully. Therefore, when receive the beacon from AP will
reset the QoS null data failure counter to avoid unnecessary
disconnection.
Signed-off-by: Chih-Kang Chang <gary.chang@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://patch.msgid.link/20251223030651.480633-13-pkshih@realtek.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
LLM Generated explanations, may be completely bogus:
Good — the tree shows the **pre-patch** version. The `last_sync_bcn_tsf`
field and `sync_bcn_tsf` already exist, so the infrastructure needed by
this commit is present. The commit itself makes a clean, self-contained
modification.
### 7. SUMMARY
**Problem**: In rtw89 WiFi driver, when operating in MCC (Multi-Channel
Concurrency) GC+STA mode, the driver uses QoS null data frames to verify
AP connectivity. In environments with interference, these frames can
fail even though the connection is actually alive (beacons are still
being received). This causes false `ieee80211_connection_loss()` calls,
disconnecting the user unnecessarily.
**Fix**: Before incrementing the probe failure counter, check if a
beacon has been received since the last check (by comparing
`sync_bcn_tsf` to `last_sync_bcn_tsf`). If a beacon was received, the
connection is still alive, so reset the counter instead of incrementing
it.
**Stable criteria assessment**:
- **Obviously correct**: Yes — the logic is simple: if we received a
beacon, the connection is alive, don't disconnect
- **Fixes a real bug**: Yes — false disconnection in interference-heavy
WiFi environments
- **Important issue**: Yes — unnecessary WiFi disconnection is a
significant user-facing issue
- **Small and contained**: Yes — ~10 lines of logic in 2 files, all
within the rtw89 driver
- **No new features**: Correct — this only improves connection loss
detection accuracy
- **Dependencies**: The `sync_bcn_tsf` and `last_sync_bcn_tsf` fields
already exist in the tree; the initialization in mac80211.c is trivial
**Risk**: Very low. The change is confined to the rtw89 driver's MCC
path, and the worst case (if somehow wrong) is that the original
disconnection behavior triggers slightly differently — still better than
the false disconnection scenario.
**YES**
drivers/net/wireless/realtek/rtw89/chan.c | 5 ++++-
drivers/net/wireless/realtek/rtw89/mac80211.c | 1 +
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/drivers/net/wireless/realtek/rtw89/chan.c b/drivers/net/wireless/realtek/rtw89/chan.c
index 86f1b39a967fe..8fe6a7ef738f7 100644
--- a/drivers/net/wireless/realtek/rtw89/chan.c
+++ b/drivers/net/wireless/realtek/rtw89/chan.c
@@ -2608,17 +2608,20 @@ bool rtw89_mcc_detect_go_bcn(struct rtw89_dev *rtwdev,
static void rtw89_mcc_detect_connection(struct rtw89_dev *rtwdev,
struct rtw89_mcc_role *role)
{
+ struct rtw89_vif_link *rtwvif_link = role->rtwvif_link;
struct ieee80211_vif *vif;
bool start_detect;
int ret;
ret = rtw89_core_send_nullfunc(rtwdev, role->rtwvif_link, true, false,
RTW89_MCC_PROBE_TIMEOUT);
- if (ret)
+ if (ret &&
+ READ_ONCE(rtwvif_link->sync_bcn_tsf) == rtwvif_link->last_sync_bcn_tsf)
role->probe_count++;
else
role->probe_count = 0;
+ rtwvif_link->last_sync_bcn_tsf = READ_ONCE(rtwvif_link->sync_bcn_tsf);
if (role->probe_count < RTW89_MCC_PROBE_MAX_TRIES)
return;
diff --git a/drivers/net/wireless/realtek/rtw89/mac80211.c b/drivers/net/wireless/realtek/rtw89/mac80211.c
index f39ca1c2ed100..d08eac3d99266 100644
--- a/drivers/net/wireless/realtek/rtw89/mac80211.c
+++ b/drivers/net/wireless/realtek/rtw89/mac80211.c
@@ -127,6 +127,7 @@ static int __rtw89_ops_add_iface_link(struct rtw89_dev *rtwdev,
rtwvif_link->reg_6ghz_power = RTW89_REG_6GHZ_POWER_DFLT;
rtwvif_link->rand_tsf_done = false;
rtwvif_link->detect_bcn_count = 0;
+ rtwvif_link->last_sync_bcn_tsf = 0;
rcu_read_lock();
--
2.51.0
^ permalink raw reply related [flat|nested] 33+ messages in thread
* [PATCH AUTOSEL 6.19-6.18] wifi: rtw89: setting TBTT AGG number when mac port initialization
2026-02-14 21:22 [PATCH AUTOSEL 6.19-6.12] wifi: rtw89: ser: enable error IMR after recovering from L1 Sasha Levin
` (7 preceding siblings ...)
2026-02-14 21:22 ` [PATCH AUTOSEL 6.19-6.18] wifi: rtw89: mcc: reset probe counter when receiving beacon Sasha Levin
@ 2026-02-14 21:22 ` Sasha Levin
2026-02-14 21:22 ` [PATCH AUTOSEL 6.19-6.18] wifi: rtw89: disable EHT protocol by chip capabilities Sasha Levin
` (22 subsequent siblings)
31 siblings, 0 replies; 33+ messages in thread
From: Sasha Levin @ 2026-02-14 21:22 UTC (permalink / raw)
To: patches, stable
Cc: Chih-Kang Chang, Ping-Ke Shih, Sasha Levin, linux-wireless
From: Chih-Kang Chang <gary.chang@realtek.com>
[ Upstream commit 5e5f83fba48381098b26a8b2513a6d5fc5c66ccb ]
When initializing mac port, needs to set TBTT AGG number to trigger TBTT
related interrupts. Otherwise, after sending join info H2C command with
disconnection mode, firmware will clear TBTT AGG number. Without the
setting from mac port initialization after that, this port will not be
able to transmit beacons.
Signed-off-by: Chih-Kang Chang <gary.chang@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://patch.msgid.link/20251223030651.480633-12-pkshih@realtek.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
LLM Generated explanations, may be completely bogus:
The `tbtt_agg` field has been part of the port register structure since
the initial driver addition. The register mask `B_AX_TBTT_AGG_NUM_MASK`
also exists. This means all necessary infrastructure is already in
stable trees.
### User Impact
This affects users running the rtw89 WiFi driver (Realtek 802.11ax
cards) in AP mode or any mode that requires beacon transmission. After a
disconnect/reconnect cycle, beacons stop being transmitted, making the
wireless interface non-functional for AP operations. This is a
significant functionality loss.
### Assessment
**Meets stable criteria:**
- **Obviously correct**: The function follows the exact same trivial
pattern as all other port config functions
- **Fixes a real bug**: Beacon transmission failure after
disconnect/reconnect
- **Small and contained**: ~15 lines, 1 file, mechanical pattern
- **No new features**: This restores expected behavior (setting a
hardware register during initialization)
- **No new APIs**: Internal driver change only
- **Low risk**: Uses existing register definitions and write helpers
**Concerns:**
- The commit is part of a series (patch 12 of a series based on the
Link), but it appears self-contained - it only adds a new function and
calls it. No dependencies on other patches in the series.
- The code is simple and the pattern is well-established in this driver.
The fix is small, surgical, restores critical WiFi AP functionality, and
follows established patterns in the driver. It meets all stable kernel
criteria.
**YES**
drivers/net/wireless/realtek/rtw89/mac.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/drivers/net/wireless/realtek/rtw89/mac.c b/drivers/net/wireless/realtek/rtw89/mac.c
index b4c292c7e829d..6734e5d5a5e22 100644
--- a/drivers/net/wireless/realtek/rtw89/mac.c
+++ b/drivers/net/wireless/realtek/rtw89/mac.c
@@ -4341,6 +4341,7 @@ static void rtw89_mac_bcn_drop(struct rtw89_dev *rtwdev,
#define BCN_HOLD_DEF 200
#define BCN_MASK_DEF 0
#define TBTT_ERLY_DEF 5
+#define TBTT_AGG_DEF 1
#define BCN_SET_UNIT 32
#define BCN_ERLY_SET_DLY (10 * 2)
@@ -4644,6 +4645,16 @@ static void rtw89_mac_port_cfg_tbtt_early(struct rtw89_dev *rtwdev,
B_AX_TBTTERLY_MASK, TBTT_ERLY_DEF);
}
+static void rtw89_mac_port_cfg_tbtt_agg(struct rtw89_dev *rtwdev,
+ struct rtw89_vif_link *rtwvif_link)
+{
+ const struct rtw89_mac_gen_def *mac = rtwdev->chip->mac_def;
+ const struct rtw89_port_reg *p = mac->port_base;
+
+ rtw89_write16_port_mask(rtwdev, rtwvif_link, p->tbtt_agg,
+ B_AX_TBTT_AGG_NUM_MASK, TBTT_AGG_DEF);
+}
+
static void rtw89_mac_port_cfg_bss_color(struct rtw89_dev *rtwdev,
struct rtw89_vif_link *rtwvif_link)
{
@@ -4904,6 +4915,7 @@ int rtw89_mac_port_update(struct rtw89_dev *rtwdev, struct rtw89_vif_link *rtwvi
rtw89_mac_port_cfg_bcn_hold_time(rtwdev, rtwvif_link);
rtw89_mac_port_cfg_bcn_mask_area(rtwdev, rtwvif_link);
rtw89_mac_port_cfg_tbtt_early(rtwdev, rtwvif_link);
+ rtw89_mac_port_cfg_tbtt_agg(rtwdev, rtwvif_link);
rtw89_mac_port_cfg_bss_color(rtwdev, rtwvif_link);
rtw89_mac_port_cfg_mbssid(rtwdev, rtwvif_link);
rtw89_mac_port_cfg_func_en(rtwdev, rtwvif_link, true);
--
2.51.0
^ permalink raw reply related [flat|nested] 33+ messages in thread
* [PATCH AUTOSEL 6.19-6.18] wifi: rtw89: disable EHT protocol by chip capabilities
2026-02-14 21:22 [PATCH AUTOSEL 6.19-6.12] wifi: rtw89: ser: enable error IMR after recovering from L1 Sasha Levin
` (8 preceding siblings ...)
2026-02-14 21:22 ` [PATCH AUTOSEL 6.19-6.18] wifi: rtw89: setting TBTT AGG number when mac port initialization Sasha Levin
@ 2026-02-14 21:22 ` Sasha Levin
2026-02-14 21:22 ` [PATCH AUTOSEL 6.19-5.10] wifi: ath10k: fix lock protection in ath10k_wmi_event_peer_sta_ps_state_chg() Sasha Levin
` (21 subsequent siblings)
31 siblings, 0 replies; 33+ messages in thread
From: Sasha Levin @ 2026-02-14 21:22 UTC (permalink / raw)
To: patches, stable; +Cc: Ping-Ke Shih, Sasha Levin, linux-wireless
From: Ping-Ke Shih <pkshih@realtek.com>
[ Upstream commit 7fd36ffedeedc97c44a10249a3f12d471bb2dc26 ]
For certain chip models, EHT protocol is disabled, and driver must follow
the capabilities. Otherwise, chips become unusable.
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://patch.msgid.link/20260110022019.2254969-5-pkshih@realtek.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
LLM Generated explanations, may be completely bogus:
## Analysis of commit: "wifi: rtw89: disable EHT protocol by chip
capabilities"
### 1. Commit Message Analysis
The commit message is clear and direct: "For certain chip models, EHT
protocol is disabled, and driver must follow the capabilities.
**Otherwise, chips become unusable.**"
This is a critical statement - it means that without this patch, certain
WiFi chips will not function at all. The word "unusable" indicates a
severe hardware functionality bug, not a minor issue or optimization.
### 2. Code Change Analysis
The change is spread across 4 files but is small and focused:
**fw.h**: Adds protocol level constants (11N=1, 11AC=2, 11AX=3, 11BE=4)
for the `RTW89_C2HREG_PHYCAP_W1_PROT` field. These are just defines for
values already communicated by firmware - not new features.
**core.h**: Adds a single `bool no_eht` field to `struct rtw89_hal`.
This is a runtime flag to track chip capability.
**mac.c** (`rtw89_mac_setup_phycap_part0`): Reads the protocol
capability from the firmware/hardware phycap register. If the chip
reports a protocol level below 11BE (EHT), it sets `hal->no_eht = true`.
This is reading hardware capabilities that already exist - the driver
was previously ignoring this information.
**core.c** (`rtw89_init_eht_cap`): Adds `|| hal->no_eht` to the existing
early-return check. Previously, only `RTW89_CHIP_AX` generation chips
would skip EHT capability initialization. Now, chips that report they
don't support EHT via their phycap register also skip it. Without this,
the driver would advertise EHT capabilities to the mac80211 stack for
hardware that doesn't support it, causing the chip to become unusable.
### 3. Bug Mechanism
The bug is:
1. Certain chip models report via firmware phycap that they don't
support EHT (802.11be)
2. The driver was ignoring this capability report
3. The driver would then advertise EHT support to mac80211/cfg80211
4. mac80211 would try to use EHT features with the chip
5. The chip cannot handle EHT, making it **unusable**
This is a classic hardware capability mismatch bug where the driver
doesn't properly respect hardware-reported capabilities.
### 4. Classification
This is a **bug fix** - it fixes a real hardware functionality issue.
It's not adding a new feature; it's reading an existing hardware
capability field that was being ignored, and using it to prevent
advertising unsupported features.
This falls into the category of **hardware quirks/workarounds** -
respecting chip capabilities to prevent malfunction.
### 5. Scope and Risk Assessment
- **Lines changed**: ~15 lines of actual logic (very small)
- **Files touched**: 4 files in the same driver subsystem
- **Risk**: Very low
- The `no_eht` flag defaults to `false` (zero-initialized), so
existing working chips are unaffected
- It only triggers for chips that explicitly report they don't support
EHT
- The check is additive (adds an OR condition to existing early-
return)
- No behavioral change for chips that already work correctly
### 6. User Impact
- **Severity**: HIGH - "chips become unusable" means complete loss of
WiFi functionality
- **Affected users**: Users with specific Realtek WiFi chip models that
don't support EHT
- **Impact without fix**: WiFi doesn't work at all on affected hardware
### 7. Stability and Dependencies
- The change is self-contained within the rtw89 driver
- No dependencies on other commits
- The `RTW89_C2HREG_PHYCAP_W1_PROT` field already existed in the
codebase (it was already defined); the commit just adds named
constants and actually uses the field
- The rtw89 driver exists in stable trees (it's been in the kernel since
5.16+)
### 8. Conclusion
This commit fixes a real, severe bug where certain Realtek WiFi chips
become completely unusable because the driver advertises EHT
capabilities the hardware doesn't support. The fix is:
- Small and surgical (adds one bool field, reads one existing register
field, adds one condition check)
- Obviously correct (respect hardware capability reports)
- Low risk (only affects chips that report no EHT support; no change for
others)
- High impact (fixes completely broken WiFi for affected users)
This meets all stable kernel criteria: it fixes a real bug, is small and
contained, doesn't add new features (it reads existing hardware data),
and has been tested.
**YES**
drivers/net/wireless/realtek/rtw89/core.c | 2 +-
drivers/net/wireless/realtek/rtw89/core.h | 1 +
drivers/net/wireless/realtek/rtw89/fw.h | 4 ++++
drivers/net/wireless/realtek/rtw89/mac.c | 5 +++++
4 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/drivers/net/wireless/realtek/rtw89/core.c b/drivers/net/wireless/realtek/rtw89/core.c
index d5b492ea76ef4..a00b5348b7622 100644
--- a/drivers/net/wireless/realtek/rtw89/core.c
+++ b/drivers/net/wireless/realtek/rtw89/core.c
@@ -5236,7 +5236,7 @@ static void rtw89_init_eht_cap(struct rtw89_dev *rtwdev,
u8 val, val_mcs13;
int sts = 8;
- if (chip->chip_gen == RTW89_CHIP_AX)
+ if (chip->chip_gen == RTW89_CHIP_AX || hal->no_eht)
return;
if (hal->no_mcs_12_13)
diff --git a/drivers/net/wireless/realtek/rtw89/core.h b/drivers/net/wireless/realtek/rtw89/core.h
index a9cb47ea0b935..46344ca8fa0c8 100644
--- a/drivers/net/wireless/realtek/rtw89/core.h
+++ b/drivers/net/wireless/realtek/rtw89/core.h
@@ -5037,6 +5037,7 @@ struct rtw89_hal {
bool support_cckpd;
bool support_igi;
bool no_mcs_12_13;
+ bool no_eht;
atomic_t roc_chanctx_idx;
u8 roc_link_index;
diff --git a/drivers/net/wireless/realtek/rtw89/fw.h b/drivers/net/wireless/realtek/rtw89/fw.h
index cedb4a47a769c..ba7c332911310 100644
--- a/drivers/net/wireless/realtek/rtw89/fw.h
+++ b/drivers/net/wireless/realtek/rtw89/fw.h
@@ -42,6 +42,10 @@ struct rtw89_c2hreg_phycap {
#define RTW89_C2HREG_PHYCAP_W0_BW GENMASK(31, 24)
#define RTW89_C2HREG_PHYCAP_W1_TX_NSS GENMASK(7, 0)
#define RTW89_C2HREG_PHYCAP_W1_PROT GENMASK(15, 8)
+#define RTW89_C2HREG_PHYCAP_W1_PROT_11N 1
+#define RTW89_C2HREG_PHYCAP_W1_PROT_11AC 2
+#define RTW89_C2HREG_PHYCAP_W1_PROT_11AX 3
+#define RTW89_C2HREG_PHYCAP_W1_PROT_11BE 4
#define RTW89_C2HREG_PHYCAP_W1_NIC GENMASK(23, 16)
#define RTW89_C2HREG_PHYCAP_W1_WL_FUNC GENMASK(31, 24)
#define RTW89_C2HREG_PHYCAP_W2_HW_TYPE GENMASK(7, 0)
diff --git a/drivers/net/wireless/realtek/rtw89/mac.c b/drivers/net/wireless/realtek/rtw89/mac.c
index 6734e5d5a5e22..fbce71cd5a05c 100644
--- a/drivers/net/wireless/realtek/rtw89/mac.c
+++ b/drivers/net/wireless/realtek/rtw89/mac.c
@@ -3061,6 +3061,7 @@ static int rtw89_mac_setup_phycap_part0(struct rtw89_dev *rtwdev)
struct rtw89_efuse *efuse = &rtwdev->efuse;
struct rtw89_mac_c2h_info c2h_info = {};
struct rtw89_hal *hal = &rtwdev->hal;
+ u8 protocol;
u8 tx_nss;
u8 rx_nss;
u8 tx_ant;
@@ -3108,6 +3109,10 @@ static int rtw89_mac_setup_phycap_part0(struct rtw89_dev *rtwdev)
rtw89_debug(rtwdev, RTW89_DBG_FW, "TX path diversity=%d\n", hal->tx_path_diversity);
rtw89_debug(rtwdev, RTW89_DBG_FW, "Antenna diversity=%d\n", hal->ant_diversity);
+ protocol = u32_get_bits(phycap->w1, RTW89_C2HREG_PHYCAP_W1_PROT);
+ if (protocol < RTW89_C2HREG_PHYCAP_W1_PROT_11BE)
+ hal->no_eht = true;
+
return 0;
}
--
2.51.0
^ permalink raw reply related [flat|nested] 33+ messages in thread
* [PATCH AUTOSEL 6.19-5.10] wifi: ath10k: fix lock protection in ath10k_wmi_event_peer_sta_ps_state_chg()
2026-02-14 21:22 [PATCH AUTOSEL 6.19-6.12] wifi: rtw89: ser: enable error IMR after recovering from L1 Sasha Levin
` (9 preceding siblings ...)
2026-02-14 21:22 ` [PATCH AUTOSEL 6.19-6.18] wifi: rtw89: disable EHT protocol by chip capabilities Sasha Levin
@ 2026-02-14 21:22 ` Sasha Levin
2026-02-14 21:22 ` [PATCH AUTOSEL 6.19-6.12] wifi: cfg80211: allow only one NAN interface, also in multi radio Sasha Levin
` (20 subsequent siblings)
31 siblings, 0 replies; 33+ messages in thread
From: Sasha Levin @ 2026-02-14 21:22 UTC (permalink / raw)
To: patches, stable
Cc: Ziyi Guo, Baochen Qiang, Jeff Johnson, Sasha Levin, jjohnson,
linux-wireless, ath10k
From: Ziyi Guo <n7l8m4@u.northwestern.edu>
[ Upstream commit 820ba7dd6859ef8b1eaf6014897e7aa4756fc65d ]
ath10k_wmi_event_peer_sta_ps_state_chg() uses lockdep_assert_held() to
assert that ar->data_lock should be held by the caller, but neither
ath10k_wmi_10_2_op_rx() nor ath10k_wmi_10_4_op_rx() acquire this lock
before calling this function.
The field arsta->peer_ps_state is documented as protected by
ar->data_lock in core.h, and other accessors (ath10k_peer_ps_state_disable,
ath10k_dbg_sta_read_peer_ps_state) properly acquire this lock.
Add spin_lock_bh()/spin_unlock_bh() around the peer_ps_state update,
and remove the lockdep_assert_held() to be aligned with new locking,
following the pattern used by other WMI event handlers in the driver.
Signed-off-by: Ziyi Guo <n7l8m4@u.northwestern.edu>
Reviewed-by: Baochen Qiang <baochen.qiang@oss.qualcomm.com>
Link: https://patch.msgid.link/20260123175611.767731-1-n7l8m4@u.northwestern.edu
[removed excess blank line]
Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
LLM Generated explanations, may be completely bogus:
## Analysis of wifi: ath10k: fix lock protection in
ath10k_wmi_event_peer_sta_ps_state_chg()
### 1. Commit Message Analysis
The commit message is clear and well-structured:
- **Subject**: Explicitly says "fix lock protection" — this is a
locking/synchronization bug fix
- **Body**: Explains that `lockdep_assert_held()` asserted
`ar->data_lock` should be held by callers, but **no caller actually
held it**. This means the assertion was always wrong (or always
disabled), and the field `arsta->peer_ps_state` was being accessed
without the required lock protection.
- **Reviewed-by**: Baochen Qiang from Qualcomm reviewed it, lending
credibility
- The commit references that `core.h` documents `peer_ps_state` as
protected by `ar->data_lock`, and other accessors properly acquire it
— meaning this was the only broken path.
### 2. Code Change Analysis
The change is minimal and surgical:
1. **Removes** `lockdep_assert_held(&ar->data_lock)` — the callers never
held this lock, so the assertion was incorrect (and likely only
checked with CONFIG_LOCKDEP enabled, which is why it didn't always
trigger)
2. **Adds** `spin_lock_bh(&ar->data_lock)` /
`spin_unlock_bh(&ar->data_lock)` around the single line
`arsta->peer_ps_state = __le32_to_cpu(ev->peer_ps_state)` — this is
the actual fix, properly protecting the field with the documented
lock
The lock scope is minimal — only around the single write to
`peer_ps_state`, placed after the RCU-protected station lookup and
before the RCU read unlock. This is clean and correct.
### 3. Bug Classification
This is a **data race / missing synchronization** bug:
- The field `peer_ps_state` is documented as requiring `ar->data_lock`
protection
- Other readers/writers of this field properly acquire the lock
- This WMI event handler was the only path that didn't hold the lock
- Without the lock, concurrent reads (from
`ath10k_dbg_sta_read_peer_ps_state`) and writes could race, leading to
torn reads or inconsistent state
### 4. Scope and Risk Assessment
- **Lines changed**: ~4 lines effective (remove 2 lines, add 3 lines
including lock/unlock)
- **Files changed**: 1 file (`drivers/net/wireless/ath/ath10k/wmi.c`)
- **Risk**: Very low. The change adds proper locking around a single
field access, following the established pattern used by all other
accessors. The lock is `spin_lock_bh`, which is safe in this softirq
context.
- **Could it break something?** Extremely unlikely — it adds a lock that
was already supposed to be held, and uses the same locking pattern as
other paths in the driver.
### 5. User Impact
- **Affected hardware**: ath10k WiFi devices (Qualcomm 802.11ac chipsets
— very common in laptops and embedded systems)
- **Trigger**: WMI peer power-save state change events from firmware
- **Consequence of bug**: Data race on `peer_ps_state` field. While this
is a 32-bit field and the race may not always cause visible corruption
on most architectures, it violates the documented locking contract and
could cause issues with lockdep-enabled kernels (warnings/splats). On
architectures without atomic 32-bit writes, it could cause torn reads.
- **Severity**: Medium — it's a real locking bug in a commonly-used WiFi
driver
### 6. Stability Indicators
- Reviewed by Qualcomm engineer (Baochen Qiang)
- Accepted by the ath10k maintainer (Jeff Johnson)
- Small, obvious, and following established patterns in the same driver
### 7. Dependency Check
- No dependencies on other commits
- The code being modified has existed in ath10k for a long time (the
`lockdep_assert_held` suggests the locking was always intended but
never correctly implemented in this path)
- Should apply cleanly to any stable tree that has the ath10k driver
with this function
### 8. Stable Kernel Criteria
- **Obviously correct?** Yes — adds the documented lock around a field
access
- **Fixes a real bug?** Yes — data race / missing synchronization
- **Small and contained?** Yes — 4 lines in 1 file
- **No new features?** Correct — pure bug fix
- **Tested?** Reviewed by subsystem experts, accepted by maintainer
### Conclusion
This is a textbook stable-worthy fix: a small, surgical correction to a
locking bug in a widely-used WiFi driver. It properly adds the lock that
was always documented as required but never acquired in this code path.
The risk is minimal and the fix follows established patterns in the same
driver.
**YES**
drivers/net/wireless/ath/ath10k/wmi.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/wireless/ath/ath10k/wmi.c b/drivers/net/wireless/ath/ath10k/wmi.c
index b4aad6604d6d9..ce22141e5efd9 100644
--- a/drivers/net/wireless/ath/ath10k/wmi.c
+++ b/drivers/net/wireless/ath/ath10k/wmi.c
@@ -5289,8 +5289,6 @@ ath10k_wmi_event_peer_sta_ps_state_chg(struct ath10k *ar, struct sk_buff *skb)
struct ath10k_sta *arsta;
u8 peer_addr[ETH_ALEN];
- lockdep_assert_held(&ar->data_lock);
-
ev = (struct wmi_peer_sta_ps_state_chg_event *)skb->data;
ether_addr_copy(peer_addr, ev->peer_macaddr.addr);
@@ -5305,7 +5303,9 @@ ath10k_wmi_event_peer_sta_ps_state_chg(struct ath10k *ar, struct sk_buff *skb)
}
arsta = (struct ath10k_sta *)sta->drv_priv;
+ spin_lock_bh(&ar->data_lock);
arsta->peer_ps_state = __le32_to_cpu(ev->peer_ps_state);
+ spin_unlock_bh(&ar->data_lock);
exit:
rcu_read_unlock();
--
2.51.0
^ permalink raw reply related [flat|nested] 33+ messages in thread
* [PATCH AUTOSEL 6.19-6.12] wifi: cfg80211: allow only one NAN interface, also in multi radio
2026-02-14 21:22 [PATCH AUTOSEL 6.19-6.12] wifi: rtw89: ser: enable error IMR after recovering from L1 Sasha Levin
` (10 preceding siblings ...)
2026-02-14 21:22 ` [PATCH AUTOSEL 6.19-5.10] wifi: ath10k: fix lock protection in ath10k_wmi_event_peer_sta_ps_state_chg() Sasha Levin
@ 2026-02-14 21:22 ` Sasha Levin
2026-02-14 21:22 ` [PATCH AUTOSEL 6.19-6.6] wifi: ath12k: fix preferred hardware mode calculation Sasha Levin
` (19 subsequent siblings)
31 siblings, 0 replies; 33+ messages in thread
From: Sasha Levin @ 2026-02-14 21:22 UTC (permalink / raw)
To: patches, stable
Cc: Miri Korenblit, Johannes Berg, Sasha Levin, johannes,
linux-wireless
From: Miri Korenblit <miriam.rachel.korenblit@intel.com>
[ Upstream commit e69fda4d07701373354e52b0321bd40311d743d0 ]
According to Wi-Fi Aware (TM) 4.0 specification 2.8, A NAN device can
have one NAN management interface. This applies also to multi radio
devices.
The current code allows a driver to support more than one NAN interface,
if those are not in the same radio.
Fix it.
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20260107135129.fdaecec0fe8a.I246b5ba6e9da3ec1481ff197e47f6ce0793d7118@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
LLM Generated explanations, may be completely bogus:
### Key Finding: Limited Stable Tree Applicability
The multi-radio interface combination checking (`combined_radio`
parameter) was introduced in commit `bd9813d13be43` which was merged in
the v6.13 cycle. This means:
- The bug being fixed **only exists in kernels 6.13+**
- Older stable trees (6.12.y, 6.6.y, 6.1.y, 5.15.y, etc.) don't have the
multi-radio combination checking code, so they don't have this bug
- Only 6.13.y and later stable trees would need this fix
### Assessment
**What the fix does**: Removes an incorrect exemption that allowed
multi-radio Wi-Fi devices to declare support for multiple NAN
interfaces, violating the Wi-Fi Aware specification.
**Severity**: Low-to-medium. This is a validation/spec-compliance fix.
The practical impact depends on whether any driver actually tries to
register multiple NAN interfaces across radios. If they do, NAN behavior
could be undefined per spec. The fix prevents such invalid
configurations from being accepted.
**Risk**: Very low. The change is tiny (removes one condition), is in a
validation path, and can only make the kernel *stricter* (reject invalid
configurations that were previously accepted). It cannot introduce new
crashes or regressions.
**Meets stable criteria**:
- Small and contained: Yes (removes ~4 lines)
- Fixes a real bug: Yes (incorrect validation allowing spec-violating
configurations)
- Obviously correct: Yes (reviewed by the wireless maintainer)
- No new features: Correct, it tightens existing validation
**Concerns**:
- Limited applicability (only 6.13+ stable trees)
- Low severity - this is spec compliance rather than a crash/corruption
fix
- The practical impact is limited since it only matters if a driver
declares >1 NAN interface across radios
This is a legitimate, low-risk bug fix that enforces correct Wi-Fi
specification compliance. While the severity is not high (no
crash/corruption), it's a clean, reviewed fix from the subsystem
maintainer that corrects incorrect behavior. It's applicable to recent
stable trees (6.13+) and carries essentially zero regression risk.
**YES**
net/wireless/core.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/net/wireless/core.c b/net/wireless/core.c
index 9a420d627d3ce..2028bf5686f2b 100644
--- a/net/wireless/core.c
+++ b/net/wireless/core.c
@@ -661,12 +661,8 @@ int wiphy_verify_iface_combinations(struct wiphy *wiphy,
c->limits[j].max > 1))
return -EINVAL;
- /* Only a single NAN can be allowed, avoid this
- * check for multi-radio global combination, since it
- * hold the capabilities of all radio combinations.
- */
- if (!combined_radio &&
- WARN_ON(types & BIT(NL80211_IFTYPE_NAN) &&
+ /* Only a single NAN can be allowed */
+ if (WARN_ON(types & BIT(NL80211_IFTYPE_NAN) &&
c->limits[j].max > 1))
return -EINVAL;
--
2.51.0
^ permalink raw reply related [flat|nested] 33+ messages in thread
* [PATCH AUTOSEL 6.19-6.6] wifi: ath12k: fix preferred hardware mode calculation
2026-02-14 21:22 [PATCH AUTOSEL 6.19-6.12] wifi: rtw89: ser: enable error IMR after recovering from L1 Sasha Levin
` (11 preceding siblings ...)
2026-02-14 21:22 ` [PATCH AUTOSEL 6.19-6.12] wifi: cfg80211: allow only one NAN interface, also in multi radio Sasha Levin
@ 2026-02-14 21:22 ` Sasha Levin
2026-02-14 21:22 ` [PATCH AUTOSEL 6.19-6.1] wifi: rtw88: fix DTIM period handling when conf->dtim_period is zero Sasha Levin
` (18 subsequent siblings)
31 siblings, 0 replies; 33+ messages in thread
From: Sasha Levin @ 2026-02-14 21:22 UTC (permalink / raw)
To: patches, stable
Cc: Baochen Qiang, Vasanthakumar Thiagarajan, Jeff Johnson,
Sasha Levin, jjohnson, linux-wireless, ath12k
From: Baochen Qiang <baochen.qiang@oss.qualcomm.com>
[ Upstream commit 7f852de0003219c431a6f2ffd951fd82a4673660 ]
For single pdev device like WCN7850/QCC2072, preferred_hw_mode is
initialized to WMI_HOST_HW_MODE_SINGLE. Later when firmware sends
supported modes to host, each mode is compared with the initial one
and if the priority of the new mode is higher, update the parameter
and store mode capability.
For WCN7850, this does not result in issue, as one of the supported
mode indeed has a higher priority. However the only available mode of
QCC2072 at this stage is WMI_HOST_HW_MODE_SINGLE, which fails the
comparison, hence mode capability is not stored. Subsequently driver
initialization fails.
Fix it by accepting a mode with the same priority.
Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.1.c5-00302-QCAHMTSWPL_V1.0_V2.0_SILICONZ-1.115823.3
Signed-off-by: Baochen Qiang <baochen.qiang@oss.qualcomm.com>
Reviewed-by: Vasanthakumar Thiagarajan <vasanthakumar.thiagarajan@oss.qualcomm.com>
Link: https://patch.msgid.link/20260112-ath12k-support-qcc2072-v2-4-fc8ce1e43969@oss.qualcomm.com
Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
LLM Generated explanations, may be completely bogus:
The code context confirms that `ath12k_hw_mode_pri_map` is a priority
mapping array where lower values mean higher priority. The
`WMI_HOST_HW_MODE_SINGLE` is in the array, and the fix ensures that when
a mode with equal priority is found, it's still accepted.
### Conclusion
This is a textbook stable backport candidate:
1. **Fixes a real bug**: Complete driver initialization failure on
QCC2072 hardware
2. **Obviously correct**: The logic error is clear — when the only
available mode has the same priority as the initial value, strict `<`
prevents it from being stored
3. **Minimal change**: Single character change (`<` to `<=`)
4. **No new features**: Just fixes the comparison logic
5. **Low risk**: For already-working hardware (WCN7850), the higher-
priority mode still wins; the `<=` only affects the equal-priority
case
6. **Tested and reviewed**: By Qualcomm engineers and the subsystem
maintainer
7. **High user impact**: Without this, an entire class of hardware
doesn't work
**YES**
drivers/net/wireless/ath/ath12k/wmi.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/wireless/ath/ath12k/wmi.c b/drivers/net/wireless/ath/ath12k/wmi.c
index 3ce5fcb0e4600..12f4d378f50d4 100644
--- a/drivers/net/wireless/ath/ath12k/wmi.c
+++ b/drivers/net/wireless/ath/ath12k/wmi.c
@@ -4545,7 +4545,7 @@ static int ath12k_wmi_hw_mode_caps(struct ath12k_base *soc,
pref = soc->wmi_ab.preferred_hw_mode;
- if (ath12k_hw_mode_pri_map[mode] < ath12k_hw_mode_pri_map[pref]) {
+ if (ath12k_hw_mode_pri_map[mode] <= ath12k_hw_mode_pri_map[pref]) {
svc_rdy_ext->pref_hw_mode_caps = *hw_mode_caps;
soc->wmi_ab.preferred_hw_mode = mode;
}
--
2.51.0
^ permalink raw reply related [flat|nested] 33+ messages in thread
* [PATCH AUTOSEL 6.19-6.1] wifi: rtw88: fix DTIM period handling when conf->dtim_period is zero
2026-02-14 21:22 [PATCH AUTOSEL 6.19-6.12] wifi: rtw89: ser: enable error IMR after recovering from L1 Sasha Levin
` (12 preceding siblings ...)
2026-02-14 21:22 ` [PATCH AUTOSEL 6.19-6.6] wifi: ath12k: fix preferred hardware mode calculation Sasha Levin
@ 2026-02-14 21:22 ` Sasha Levin
2026-02-14 21:22 ` [PATCH AUTOSEL 6.19-6.12] wifi: rtw89: mac: correct page number for CSI response Sasha Levin
` (17 subsequent siblings)
31 siblings, 0 replies; 33+ messages in thread
From: Sasha Levin @ 2026-02-14 21:22 UTC (permalink / raw)
To: patches, stable
Cc: Roman Peshkichev, Ping-Ke Shih, Sasha Levin, linux-wireless
From: Roman Peshkichev <roman.peshkichev@gmail.com>
[ Upstream commit 9f68fdcdc9dbf21be2a48feced90ff7f77d07443 ]
The function rtw_set_dtim_period() accepted an 'int' dtim_period parameter,
while mac80211 provides dtim_period as 'u8' in struct ieee80211_bss_conf.
In IBSS (ad-hoc) mode mac80211 may set dtim_period to 0.
The driver unconditionally wrote (dtim_period - 1) to
REG_DTIM_COUNTER_ROOT, which resulted in 0xFF when dtim_period was 0. This
caused delays in broadcast/multicast traffic processing and issues with
ad-hoc operation.
Convert the function parameter to u8 to match ieee80211_bss_conf and avoid
the underflow by writing 0 when dtim_period is 0.
Link: https://github.com/lwfinger/rtw88/issues/406
Signed-off-by: Roman Peshkichev <roman.peshkichev@gmail.com>
Acked-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://patch.msgid.link/20251125180937.22977-1-roman.peshkichev@gmail.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
LLM Generated explanations, may be completely bogus:
## Analysis
### Commit Message Analysis
The commit message clearly describes a **bug fix** for an integer
underflow issue in the rtw88 WiFi driver. Key points:
- **Bug mechanism**: When `dtim_period` is 0 (which happens in IBSS/ad-
hoc mode), the expression `dtim_period - 1` underflows. Since the
parameter was `int`, `0 - 1 = -1`, and when written via
`rtw_write8()`, this becomes `0xFF`.
- **Impact**: Writing `0xFF` to `REG_DTIM_COUNTER_ROOT` causes "delays
in broadcast/multicast traffic processing and issues with ad-hoc
operation."
- **Link**: References a real user-reported issue on GitHub
(lwfinger/rtw88#406).
- **Acked by**: Ping-Ke Shih, the Realtek maintainer, both acked and
signed off, indicating this is a vetted fix.
### Code Change Analysis
The change is extremely small and surgical — only **2 lines of
functional change** plus **2 lines of declaration change**:
1. **Parameter type change**: `int dtim_period` → `u8 dtim_period` —
matches the type in `struct ieee80211_bss_conf` (`u8`), which is
correct alignment with mac80211's API.
2. **Underflow guard**: `dtim_period - 1` → `dtim_period ? dtim_period -
1 : 0` — prevents the underflow when `dtim_period` is 0 by writing 0
instead of 0xFF.
3. **Header declaration update**: Matching function signature change in
`main.h`.
### Bug Classification
This is a clear **integer underflow bug** that causes real-world issues:
- The bug is triggered in IBSS (ad-hoc) mode, which is a legitimate and
used WiFi mode
- The consequence is broken broadcast/multicast traffic — a real
functional issue for users
- The fix is obviously correct: check for zero before subtracting
### Scope and Risk Assessment
- **Lines changed**: ~4 (2 functional + 2 declaration)
- **Files touched**: 2 (main.c and main.h, both in the same driver)
- **Risk**: Extremely low. The fix adds a simple conditional check and
corrects a type mismatch. It cannot introduce regressions — the only
behavior change is when `dtim_period == 0`, where the old behavior was
clearly wrong (writing 0xFF).
- **Subsystem**: WiFi driver (rtw88) — widely used Realtek WiFi chipset
driver
### Stable Kernel Criteria
1. **Obviously correct and tested**: Yes — trivial fix, acked by
maintainer, addresses a clearly documented bug
2. **Fixes a real bug**: Yes — integer underflow causing broken ad-hoc
WiFi operation
3. **Important issue**: Yes — broken WiFi functionality for ad-hoc mode
users
4. **Small and contained**: Yes — 4 lines changed in one driver
5. **No new features**: Correct — pure bug fix
6. **Applies cleanly**: The rtw88 driver has been in the kernel since
5.2, and this function is stable, so it should apply cleanly to
recent stable trees
### User Impact
Users of rtw88 WiFi chipsets (Realtek 8822BE, 8822CE, 8723DE, 8821CE —
very common in laptops) who use ad-hoc/IBSS mode would experience broken
broadcast/multicast traffic without this fix.
### Dependencies
None. This is a self-contained fix with no dependencies on other
commits.
### Conclusion
This is a textbook stable backport candidate: a small, obvious, low-risk
fix for a real bug (integer underflow) that causes user-visible problems
(broken WiFi ad-hoc mode). It's acked by the subsystem maintainer and
has a linked bug report demonstrating real-world impact.
**YES**
drivers/net/wireless/realtek/rtw88/main.c | 4 ++--
drivers/net/wireless/realtek/rtw88/main.h | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/net/wireless/realtek/rtw88/main.c b/drivers/net/wireless/realtek/rtw88/main.c
index fa0ed39cb1992..361ce0d40956d 100644
--- a/drivers/net/wireless/realtek/rtw88/main.c
+++ b/drivers/net/wireless/realtek/rtw88/main.c
@@ -730,10 +730,10 @@ void rtw_set_rx_freq_band(struct rtw_rx_pkt_stat *pkt_stat, u8 channel)
}
EXPORT_SYMBOL(rtw_set_rx_freq_band);
-void rtw_set_dtim_period(struct rtw_dev *rtwdev, int dtim_period)
+void rtw_set_dtim_period(struct rtw_dev *rtwdev, u8 dtim_period)
{
rtw_write32_set(rtwdev, REG_TCR, BIT_TCR_UPDATE_TIMIE);
- rtw_write8(rtwdev, REG_DTIM_COUNTER_ROOT, dtim_period - 1);
+ rtw_write8(rtwdev, REG_DTIM_COUNTER_ROOT, dtim_period ? dtim_period - 1 : 0);
}
void rtw_update_channel(struct rtw_dev *rtwdev, u8 center_channel,
diff --git a/drivers/net/wireless/realtek/rtw88/main.h b/drivers/net/wireless/realtek/rtw88/main.h
index 43ed6d6b42919..1ab70214ce36e 100644
--- a/drivers/net/wireless/realtek/rtw88/main.h
+++ b/drivers/net/wireless/realtek/rtw88/main.h
@@ -2226,7 +2226,7 @@ enum nl80211_band rtw_hw_to_nl80211_band(enum rtw_supported_band hw_band)
}
void rtw_set_rx_freq_band(struct rtw_rx_pkt_stat *pkt_stat, u8 channel);
-void rtw_set_dtim_period(struct rtw_dev *rtwdev, int dtim_period);
+void rtw_set_dtim_period(struct rtw_dev *rtwdev, u8 dtim_period);
void rtw_get_channel_params(struct cfg80211_chan_def *chandef,
struct rtw_channel_params *ch_param);
bool check_hw_ready(struct rtw_dev *rtwdev, u32 addr, u32 mask, u32 target);
--
2.51.0
^ permalink raw reply related [flat|nested] 33+ messages in thread
* [PATCH AUTOSEL 6.19-6.12] wifi: rtw89: mac: correct page number for CSI response
2026-02-14 21:22 [PATCH AUTOSEL 6.19-6.12] wifi: rtw89: ser: enable error IMR after recovering from L1 Sasha Levin
` (13 preceding siblings ...)
2026-02-14 21:22 ` [PATCH AUTOSEL 6.19-6.1] wifi: rtw88: fix DTIM period handling when conf->dtim_period is zero Sasha Levin
@ 2026-02-14 21:22 ` Sasha Levin
2026-02-14 21:23 ` [PATCH AUTOSEL 6.19-6.12] wifi: rtw88: Fix inadvertent sharing of struct ieee80211_supported_band data Sasha Levin
` (16 subsequent siblings)
31 siblings, 0 replies; 33+ messages in thread
From: Sasha Levin @ 2026-02-14 21:22 UTC (permalink / raw)
To: patches, stable; +Cc: Ping-Ke Shih, Sasha Levin, linux-wireless
From: Ping-Ke Shih <pkshih@realtek.com>
[ Upstream commit aa2a44d0d22d45d659b9f01638809b1735e46cff ]
For beamforming procedure, hardware reserve memory page for CSI response.
The unit of register is (value - 1), so add one accordingly as expected.
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://patch.msgid.link/20260110022019.2254969-7-pkshih@realtek.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
LLM Generated explanations, may be completely bogus:
## Analysis of commit: "wifi: rtw89: mac: correct page number for CSI
response"
### 1. Commit Message Analysis
The commit message states that for the beamforming procedure, hardware
reserves memory pages for CSI (Channel State Information) response. The
register expects a value where the unit is `(value - 1)`, meaning the
driver needs to write `pg_num + 1` to get the correct number of pages
reserved. The current code writes `pg_num` directly, which results in
one fewer page than intended.
This is a hardware register programming bug — an off-by-one error in how
a register value is interpreted.
### 2. Code Change Analysis
The change is a single-line fix:
```c
- rtw89_write32_mask(rtwdev, reg, B_BE_CSI_RESERVED_PAGE_NUM_MASK,
qt_cfg.pg_num);
+ rtw89_write32_mask(rtwdev, reg, B_BE_CSI_RESERVED_PAGE_NUM_MASK,
qt_cfg.pg_num + 1);
```
This is about as minimal and surgical as a fix can be. It corrects the
value written to the `R_BE_RESP_CSI_RESERVED_PAGE` register's page
number field by adding 1 to account for the hardware's `(value - 1)`
encoding.
### 3. Bug Classification
This is a **hardware register programming bug** (off-by-one). The
consequence is that the hardware reserves one fewer memory page than
needed for CSI response in beamforming. This could lead to:
- **Beamforming failures** or degraded WiFi performance
- Potential **memory corruption within the hardware's DLE (Data Link
Engine)** if CSI responses overflow the allocated pages
- Possible **firmware/hardware hangs** if the CSI response data
overwrites adjacent memory regions in the hardware
### 4. Scope and Risk Assessment
- **Lines changed**: 1 line
- **Files touched**: 1 file
(`drivers/net/wireless/realtek/rtw89/mac_be.c`)
- **Complexity**: Trivially simple — adds `+ 1` to a value
- **Risk of regression**: Extremely low. The fix aligns the driver with
the hardware's documented register encoding. Writing the wrong value
was the bug.
- **Subsystem**: WiFi driver (rtw89 — Realtek WiFi), which is a commonly
used wireless driver
### 5. User Impact
- **Who is affected**: Users of Realtek WiFi chipsets supported by the
rtw89 driver (specifically the "BE" generation, likely WiFi 7 chips
like RTL8922AE)
- **Severity**: Medium-high. Beamforming is important for WiFi
performance and reliability. With incorrect page reservation, users
may experience degraded throughput, connection instability, or
potential hardware issues
- **Real-world impact**: Any user with this hardware would be affected
during beamforming operations
### 6. Stability Indicators
- **Author**: Ping-Ke Shih (pkshih@realtek.com) — the primary maintainer
of the rtw89 driver at Realtek. Highly trusted for this subsystem.
- **Obviously correct**: The commit message clearly explains the
hardware register encoding, and the fix directly addresses it.
### 7. Dependency Check
This is a standalone fix. It doesn't depend on other patches (it's patch
7 of a series, but this particular change is self-contained — it just
corrects a value written to a register). The function
`resp_pktctl_init_be()` and the register definitions need to exist in
the stable tree.
### 8. Stable Kernel Criteria Assessment
- **Obviously correct**: Yes — the hardware register uses `(value - 1)`
encoding, so writing `pg_num + 1` is the correct value
- **Fixes a real bug**: Yes — off-by-one in hardware register
programming causes incorrect page reservation
- **Small and contained**: Yes — single line change in a single file
- **No new features**: Correct — this is purely a bug fix
- **Tested**: From the Realtek driver maintainer, submitted through
proper channels
### Risk vs. Benefit
- **Risk**: Negligible. A one-line arithmetic correction to a hardware
register value, authored by the subsystem maintainer.
- **Benefit**: Fixes beamforming page allocation for rtw89 BE-generation
WiFi hardware, preventing potential performance degradation or
hardware issues.
### Concerns
The only concern is whether the `mac_be.c` file exists in the target
stable trees. The "BE" generation support was added relatively recently,
so this fix would only apply to stable kernels that already include
rtw89 BE support. But if the code exists in the stable tree, this fix is
clearly appropriate.
**YES**
drivers/net/wireless/realtek/rtw89/mac_be.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/wireless/realtek/rtw89/mac_be.c b/drivers/net/wireless/realtek/rtw89/mac_be.c
index 9b9e646487346..dee5ff71b75fe 100644
--- a/drivers/net/wireless/realtek/rtw89/mac_be.c
+++ b/drivers/net/wireless/realtek/rtw89/mac_be.c
@@ -1175,7 +1175,7 @@ static int resp_pktctl_init_be(struct rtw89_dev *rtwdev, u8 mac_idx)
reg = rtw89_mac_reg_by_idx(rtwdev, R_BE_RESP_CSI_RESERVED_PAGE, mac_idx);
rtw89_write32_mask(rtwdev, reg, B_BE_CSI_RESERVED_START_PAGE_MASK, qt_cfg.pktid);
- rtw89_write32_mask(rtwdev, reg, B_BE_CSI_RESERVED_PAGE_NUM_MASK, qt_cfg.pg_num);
+ rtw89_write32_mask(rtwdev, reg, B_BE_CSI_RESERVED_PAGE_NUM_MASK, qt_cfg.pg_num + 1);
return 0;
}
--
2.51.0
^ permalink raw reply related [flat|nested] 33+ messages in thread
* [PATCH AUTOSEL 6.19-6.12] wifi: rtw88: Fix inadvertent sharing of struct ieee80211_supported_band data
2026-02-14 21:22 [PATCH AUTOSEL 6.19-6.12] wifi: rtw89: ser: enable error IMR after recovering from L1 Sasha Levin
` (14 preceding siblings ...)
2026-02-14 21:22 ` [PATCH AUTOSEL 6.19-6.12] wifi: rtw89: mac: correct page number for CSI response Sasha Levin
@ 2026-02-14 21:23 ` Sasha Levin
2026-02-14 21:23 ` [PATCH AUTOSEL 6.19] wifi: rtw89: 8852au: add support for TP TX30U Plus Sasha Levin
` (15 subsequent siblings)
31 siblings, 0 replies; 33+ messages in thread
From: Sasha Levin @ 2026-02-14 21:23 UTC (permalink / raw)
To: patches, stable
Cc: Bitterblue Smith, Ping-Ke Shih, Sasha Levin, linux-wireless
From: Bitterblue Smith <rtl8821cerfe2@gmail.com>
[ Upstream commit fcac0f23d4d20b11014a39f8e2527cdc12ec9c82 ]
Internally wiphy writes to individual channels in this structure,
so we must not share one static definition of channel list between
multiple device instances, because that causes hard to debug
breakage.
For example, with two rtw88 driven devices in the system, channel
information may get incoherent, preventing channel use.
Copied from commit 0ae36391c804 ("wifi: rtw89: Fix inadverent sharing
of struct ieee80211_supported_band data").
Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>
Acked-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://patch.msgid.link/e94ad653-2b6d-4284-a33c-8c694f88955b@gmail.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
LLM Generated explanations, may be completely bogus:
This is a relevant finding: `devm_kmemdup_array()` was introduced in
v6.15 cycle (February 2025). This means for older stable trees (6.12.y,
6.6.y, 6.1.y, 5.15.y), this function won't exist and the backport would
need adaptation. However, this is a minor concern - it can be replaced
with `devm_kmemdup()` with a manual size calculation.
### 6. USER IMPACT
- **Affected users:** Anyone with two or more rtw88 WiFi adapters in
their system (e.g., RTL8822CE + RTL8821CE, or built-in + USB adapter)
- **Symptom:** Channel information becomes corrupt; certain WiFi
channels become unusable
- **Severity:** Medium-High. WiFi connectivity issues are significant
for users
- **Driver popularity:** rtw88 supports many common Realtek WiFi chips
(RTL8822BE, RTL8822CE, RTL8821CE, RTL8723DE) found in many laptops
### 7. DEPENDENCY CHECK
The main dependency concern is `devm_kmemdup_array()`, which was added
in v6.15. For older stable trees, this would need to be adapted
(trivially, by using `devm_kmemdup()` with `sband->n_channels *
sizeof(*sband->channels)` manually). The rest of the code is standard
and should exist in all stable trees that have the rtw88 driver.
### Summary
**What it fixes:** Data corruption bug where multiple rtw88 WiFi device
instances share the same static channel/bitrate arrays through shallow
copying. When one device's wiphy modifies channel data, it corrupts the
other device's data.
**Stable criteria met:**
- Obviously correct (deep copy instead of shallow copy)
- Fixes a real bug (channel data corruption with multiple devices)
- Small and contained (~30 new lines in one file)
- No new features
- Already proven pattern (same fix in rtw89)
- Acked by Realtek maintainer
**Risk:** Very low. The change only affects rtw88 driver initialization,
uses standard kernel APIs, and devres handles cleanup automatically.
**Concern:** `devm_kmemdup_array()` may need adaptation for older stable
trees, but this is a trivial mechanical change.
**YES**
drivers/net/wireless/realtek/rtw88/main.c | 34 +++++++++++++++++++----
1 file changed, 29 insertions(+), 5 deletions(-)
diff --git a/drivers/net/wireless/realtek/rtw88/main.c b/drivers/net/wireless/realtek/rtw88/main.c
index 2004d714530a3..e1de638164862 100644
--- a/drivers/net/wireless/realtek/rtw88/main.c
+++ b/drivers/net/wireless/realtek/rtw88/main.c
@@ -1658,16 +1658,41 @@ static u16 rtw_get_max_scan_ie_len(struct rtw_dev *rtwdev)
return len;
}
+static struct ieee80211_supported_band *
+rtw_sband_dup(struct rtw_dev *rtwdev,
+ const struct ieee80211_supported_band *sband)
+{
+ struct ieee80211_supported_band *dup;
+
+ dup = devm_kmemdup(rtwdev->dev, sband, sizeof(*sband), GFP_KERNEL);
+ if (!dup)
+ return NULL;
+
+ dup->channels = devm_kmemdup_array(rtwdev->dev, sband->channels,
+ sband->n_channels,
+ sizeof(*sband->channels),
+ GFP_KERNEL);
+ if (!dup->channels)
+ return NULL;
+
+ dup->bitrates = devm_kmemdup_array(rtwdev->dev, sband->bitrates,
+ sband->n_bitrates,
+ sizeof(*sband->bitrates),
+ GFP_KERNEL);
+ if (!dup->bitrates)
+ return NULL;
+
+ return dup;
+}
+
static void rtw_set_supported_band(struct ieee80211_hw *hw,
const struct rtw_chip_info *chip)
{
struct ieee80211_supported_band *sband;
struct rtw_dev *rtwdev = hw->priv;
- struct device *dev = rtwdev->dev;
if (chip->band & RTW_BAND_2G) {
- sband = devm_kmemdup(dev, &rtw_band_2ghz, sizeof(*sband),
- GFP_KERNEL);
+ sband = rtw_sband_dup(rtwdev, &rtw_band_2ghz);
if (!sband)
goto err_out;
if (chip->ht_supported)
@@ -1676,8 +1701,7 @@ static void rtw_set_supported_band(struct ieee80211_hw *hw,
}
if (chip->band & RTW_BAND_5G) {
- sband = devm_kmemdup(dev, &rtw_band_5ghz, sizeof(*sband),
- GFP_KERNEL);
+ sband = rtw_sband_dup(rtwdev, &rtw_band_5ghz);
if (!sband)
goto err_out;
if (chip->ht_supported)
--
2.51.0
^ permalink raw reply related [flat|nested] 33+ messages in thread
* [PATCH AUTOSEL 6.19] wifi: rtw89: 8852au: add support for TP TX30U Plus
2026-02-14 21:22 [PATCH AUTOSEL 6.19-6.12] wifi: rtw89: ser: enable error IMR after recovering from L1 Sasha Levin
` (15 preceding siblings ...)
2026-02-14 21:23 ` [PATCH AUTOSEL 6.19-6.12] wifi: rtw88: Fix inadvertent sharing of struct ieee80211_supported_band data Sasha Levin
@ 2026-02-14 21:23 ` Sasha Levin
2026-02-14 21:23 ` [PATCH AUTOSEL 6.19-6.6] wifi: ath11k: add pm quirk for Thinkpad Z13/Z16 Gen1 Sasha Levin
` (14 subsequent siblings)
31 siblings, 0 replies; 33+ messages in thread
From: Sasha Levin @ 2026-02-14 21:23 UTC (permalink / raw)
To: patches, stable; +Cc: Jan Gerber, Ping-Ke Shih, Sasha Levin, linux-wireless
From: Jan Gerber <j@mailb.org>
[ Upstream commit a2f1fc9ab6fb0d5c9d701a516c342944258fb20e ]
the device shows up like this and everything seams to work:
Bus 004 Device 003: ID 3625:010d Realtek 802.11ax WLAN Adapter
Signed-off-by: Jan Gerber <j@mailb.org>
Acked-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://patch.msgid.link/20251212005515.2059533-1-j@mailb.org
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
LLM Generated explanations, may be completely bogus:
## Analysis: wifi: rtw89: 8852au: add support for TP TX30U Plus
### Commit Message Analysis
This commit adds a new USB device ID (`0x3625:0x010d`) for the TP TX30U
Plus WiFi adapter to the existing `rtw8852au` driver. The commit message
indicates the device was tested and works ("everything seams to work").
It was acked by the Realtek subsystem maintainer (Ping-Ke Shih).
### Code Change Analysis
The change is a **two-line addition** of a single USB device ID entry to
an existing device ID table:
```c
{ USB_DEVICE_AND_INTERFACE_INFO(0x3625, 0x010d, 0xff, 0xff, 0xff),
.driver_info = (kernel_ulong_t)&rtw89_8852au_info },
```
This is inserted in sorted order among existing entries. Notably, the
same vendor (`0x3625`) already has another device (`0x010f`) in the
table, so this vendor's devices are already known to work with this
driver.
### Classification: New Device ID Addition
This falls squarely into the **"NEW DEVICE IDs"** exception category for
stable backports:
1. **The driver already exists** in stable trees - `rtw8852au` is an
established driver
2. **Only the ID is new** - no driver code changes whatsoever
3. **Same vendor already supported** - `0x3625:0x010f` is already in the
table, meaning the `0x3625` vendor's devices are known to work
4. **Trivially correct** - it's a mechanical two-line addition following
the exact same pattern as every other entry in the table
### Risk Assessment
- **Risk: Essentially zero.** Adding a USB device ID to a table cannot
break existing functionality. It only enables the existing driver to
bind to a new USB VID:PID combination.
- **Scope: Minimal.** Two lines, one file, one table entry.
- **Dependencies: None.** The driver infrastructure is already in place.
### User Impact
- Users with the TP TX30U Plus WiFi adapter on stable kernels currently
have **no WiFi support** for this device
- With this backport, their device would be recognized and work with the
existing driver
- This is the kind of fix that directly enables hardware for real users
### Stability Indicators
- Acked and signed off by Realtek's kernel maintainer (Ping-Ke Shih)
- Tested by the submitter with real hardware
- Same vendor's other device already works with this driver
### Conclusion
This is a textbook device ID addition - the most common and safest type
of stable backport. It enables real hardware for real users with zero
risk of regression. The change is trivially correct, tested, and
acknowledged by the subsystem maintainer.
**YES**
drivers/net/wireless/realtek/rtw89/rtw8852au.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/net/wireless/realtek/rtw89/rtw8852au.c b/drivers/net/wireless/realtek/rtw89/rtw8852au.c
index ca782469c455d..74a976c984ad8 100644
--- a/drivers/net/wireless/realtek/rtw89/rtw8852au.c
+++ b/drivers/net/wireless/realtek/rtw89/rtw8852au.c
@@ -60,6 +60,8 @@ static const struct usb_device_id rtw_8852au_id_table[] = {
.driver_info = (kernel_ulong_t)&rtw89_8852au_info },
{ USB_DEVICE_AND_INTERFACE_INFO(0x2357, 0x0141, 0xff, 0xff, 0xff),
.driver_info = (kernel_ulong_t)&rtw89_8852au_info },
+ { USB_DEVICE_AND_INTERFACE_INFO(0x3625, 0x010d, 0xff, 0xff, 0xff),
+ .driver_info = (kernel_ulong_t)&rtw89_8852au_info },
{ USB_DEVICE_AND_INTERFACE_INFO(0x3625, 0x010f, 0xff, 0xff, 0xff),
.driver_info = (kernel_ulong_t)&rtw89_8852au_info },
{},
--
2.51.0
^ permalink raw reply related [flat|nested] 33+ messages in thread
* [PATCH AUTOSEL 6.19-6.6] wifi: ath11k: add pm quirk for Thinkpad Z13/Z16 Gen1
2026-02-14 21:22 [PATCH AUTOSEL 6.19-6.12] wifi: rtw89: ser: enable error IMR after recovering from L1 Sasha Levin
` (16 preceding siblings ...)
2026-02-14 21:23 ` [PATCH AUTOSEL 6.19] wifi: rtw89: 8852au: add support for TP TX30U Plus Sasha Levin
@ 2026-02-14 21:23 ` Sasha Levin
2026-02-14 21:23 ` [PATCH AUTOSEL 6.19] wifi: rtw89: Add default ID 28de:2432 for RTL8832CU Sasha Levin
` (13 subsequent siblings)
31 siblings, 0 replies; 33+ messages in thread
From: Sasha Levin @ 2026-02-14 21:23 UTC (permalink / raw)
To: patches, stable
Cc: Ross Vandegrift, Baochen Qiang, Mark Pearson, Jeff Johnson,
Sasha Levin, jjohnson, linux-wireless, ath11k
From: Ross Vandegrift <ross@kallisti.us>
[ Upstream commit 4015b1972763d7d513172276e51439f37e622a92 ]
Z16 Gen1 has the wakeup-from-suspend issues from [1] but was never added
to the appropriate quirk list. I've tested this patch on top of 6.18.2,
it fixes the issue for me on 21D4
Mark Pearson provided the other product IDs covering the second Z16 Gen1
and both Z13 Gen1 identifiers. They share the same firmware, and folks
in the bugzilla report do indeed see the problem on Z13.
[1] - https://bugzilla.kernel.org/show_bug.cgi?id=219196
Signed-off-by: Ross Vandegrift <ross@kallisti.us>
Reviewed-by: Baochen Qiang <baochen.qiang@oss.qualcomm.com>
Tested-by: Mark Pearson <mpearson-lenovo@squebb.ca>
Reviewed-by: Mark Pearson <mpearson-lenovo@squebb.ca>
Link: https://patch.msgid.link/wj7o2kmb7g54stdjvxp2hjqrnutnq3jbf4s2uh4ctvmlxdq7tf@nbkj2ebakhrd
Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
LLM Generated explanations, may be completely bogus:
## Analysis
### Commit Message Analysis
This commit adds DMI-based power management quirk entries for Lenovo
ThinkPad Z13 Gen1 and Z16 Gen1 laptops to the `ath11k_pm_quirk_table[]`.
The commit message clearly states:
- The Z16 Gen1 has known wakeup-from-suspend issues documented in kernel
bugzilla #219196
- The fix has been tested on actual hardware (21D4 model)
- Additional product IDs were provided by Mark Pearson (Lenovo engineer)
covering both Z13 Gen1 and Z16 Gen1 variants
- The devices share the same firmware and users in the bugzilla confirm
the problem exists on Z13 as well
### Code Change Analysis
The change adds exactly 4 new DMI table entries to the existing
`ath11k_pm_quirk_table[]` array:
- Z13 G1: product names "21D2" and "21D3"
- Z16 G1: product names "21D4" and "21D5"
Each entry follows the identical pattern as every other entry in the
table:
```c
{
.driver_data = (void *)ATH11K_PM_WOW,
.matches = {
DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"),
DMI_MATCH(DMI_PRODUCT_NAME, "XXXX"),
},
},
```
This is a pure data addition — no logic changes, no new code paths, no
new APIs.
### Classification: Hardware Quirk/Workaround
This falls squarely into the **QUIRKS and WORKAROUNDS** exception
category explicitly called out in the stable kernel rules. It adds
hardware-specific quirk entries for devices with broken suspend/resume
behavior. The quirk table and the `ATH11K_PM_WOW` mechanism already
exist in the kernel — this merely extends coverage to additional laptop
models.
### Risk Assessment
- **Risk: Extremely low.** Adding DMI match entries to an existing quirk
table cannot break anything for other users. The entries only activate
on the specific Lenovo product IDs listed.
- **Scope: Minimal.** Only one file changed, only data additions, no
logic changes.
- **Testing: Strong.** The commit has `Tested-by:` from Mark Pearson
(Lenovo), `Reviewed-by:` from both the Qualcomm ath11k maintainer
(Baochen Qiang) and Mark Pearson, and was tested by the author on
actual hardware.
### User Impact
- **Problem:** WiFi fails to work properly after suspend/resume on
ThinkPad Z13/Z16 Gen1 laptops — a critical issue for laptop users.
- **Affected users:** All owners of these specific Lenovo ThinkPad
models using the ath11k WiFi driver.
- **Severity:** High — broken suspend/resume on a laptop is a
significant usability issue that affects daily use.
- **Bugzilla link:** The issue is documented with multiple users
confirming it.
### Dependency Check
No dependencies on other commits. The quirk table infrastructure already
exists in stable trees. The entries follow the exact same format as
existing entries.
### Conclusion
This is a textbook stable backport candidate: a small, zero-risk, data-
only addition of hardware quirk entries to an existing table, fixing a
real and well-documented suspend/resume bug on specific laptop models,
with proper testing and review from both the hardware vendor and the
subsystem maintainer.
**YES**
drivers/net/wireless/ath/ath11k/core.c | 28 ++++++++++++++++++++++++++
1 file changed, 28 insertions(+)
diff --git a/drivers/net/wireless/ath/ath11k/core.c b/drivers/net/wireless/ath/ath11k/core.c
index 812686173ac8a..03dddc1cd003a 100644
--- a/drivers/net/wireless/ath/ath11k/core.c
+++ b/drivers/net/wireless/ath/ath11k/core.c
@@ -994,6 +994,34 @@ static const struct dmi_system_id ath11k_pm_quirk_table[] = {
DMI_MATCH(DMI_PRODUCT_NAME, "21F9"),
},
},
+ {
+ .driver_data = (void *)ATH11K_PM_WOW,
+ .matches = { /* Z13 G1 */
+ DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"),
+ DMI_MATCH(DMI_PRODUCT_NAME, "21D2"),
+ },
+ },
+ {
+ .driver_data = (void *)ATH11K_PM_WOW,
+ .matches = { /* Z13 G1 */
+ DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"),
+ DMI_MATCH(DMI_PRODUCT_NAME, "21D3"),
+ },
+ },
+ {
+ .driver_data = (void *)ATH11K_PM_WOW,
+ .matches = { /* Z16 G1 */
+ DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"),
+ DMI_MATCH(DMI_PRODUCT_NAME, "21D4"),
+ },
+ },
+ {
+ .driver_data = (void *)ATH11K_PM_WOW,
+ .matches = { /* Z16 G1 */
+ DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"),
+ DMI_MATCH(DMI_PRODUCT_NAME, "21D5"),
+ },
+ },
{}
};
--
2.51.0
^ permalink raw reply related [flat|nested] 33+ messages in thread
* [PATCH AUTOSEL 6.19] wifi: rtw89: Add default ID 28de:2432 for RTL8832CU
2026-02-14 21:22 [PATCH AUTOSEL 6.19-6.12] wifi: rtw89: ser: enable error IMR after recovering from L1 Sasha Levin
` (17 preceding siblings ...)
2026-02-14 21:23 ` [PATCH AUTOSEL 6.19-6.6] wifi: ath11k: add pm quirk for Thinkpad Z13/Z16 Gen1 Sasha Levin
@ 2026-02-14 21:23 ` Sasha Levin
2026-02-14 21:23 ` [PATCH AUTOSEL 6.19-6.18] wifi: ath12k: fix mac phy capability parsing Sasha Levin
` (12 subsequent siblings)
31 siblings, 0 replies; 33+ messages in thread
From: Sasha Levin @ 2026-02-14 21:23 UTC (permalink / raw)
To: patches, stable; +Cc: Shin-Yi Lin, Ping-Ke Shih, Sasha Levin, linux-wireless
From: Shin-Yi Lin <isaiah@realtek.com>
[ Upstream commit 5f65ebf9aaf00c7443252136066138435ec03958 ]
Add 28de:2432 for RTL8832CU-based adapters that use this default ID.
Signed-off-by: Shin-Yi Lin <isaiah@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://patch.msgid.link/20260114014906.21829-1-pkshih@realtek.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
LLM Generated explanations, may be completely bogus:
## Analysis: Adding USB Device ID 28de:2432 for RTL8832CU
### Commit Message Analysis
This commit adds a single USB device ID (`28de:2432`) to the existing
`rtw89` wireless driver for RTL8832CU-based USB WiFi adapters. The
vendor ID `0x28de` belongs to Valve Corporation (known for Steam Deck
and other gaming hardware), suggesting this is a WiFi adapter used in a
Valve product.
### Code Change Analysis
The change is minimal and mechanical:
- **One entry added** to the `rtw_8852cu_id_table[]` array in
`rtw8852cu.c`
- The new entry follows the exact same pattern as all other entries in
the table
- Uses `USB_DEVICE_AND_INTERFACE_INFO(0x28de, 0x2432, 0xff, 0xff, 0xff)`
with the same `rtw89_8852cu_info` driver info structure
- The entry is inserted in vendor ID order (between `0x0db0` and
`0x35b2`), maintaining table organization
### Classification: New Device ID Addition
This is a textbook **new device ID addition** to an existing driver —
one of the explicitly allowed exception categories for stable backports:
1. **The driver already exists** in stable trees (rtw89/rtw8852cu has
been in the kernel)
2. **Only the USB ID is new** — no new code paths, no new functionality
3. **Enables existing hardware** to be recognized by an already-working
driver
4. **Zero risk of regression** — the new ID entry only matches devices
with that specific vendor/product ID; all other devices are
completely unaffected
### Scope and Risk Assessment
- **Lines changed**: 2 (one USB_DEVICE_AND_INTERFACE_INFO entry)
- **Files touched**: 1
- **Risk**: Essentially zero — adding a device ID to a table cannot
break existing functionality
- **Complexity**: None — this is a data-only change
### User Impact
- **Without this patch**: Users with RTL8832CU adapters using vendor ID
`28de:2432` (likely Valve hardware) have no WiFi support — the device
is simply not recognized
- **With this patch**: The adapter works out of the box with the
existing rtw89 driver
- **Impact level**: HIGH for affected users (WiFi is essential), ZERO
for everyone else
### Dependency Check
This commit is fully self-contained. It depends only on:
- The rtw89 driver existing (it does in stable trees)
- The `rtw89_8852cu_info` structure existing (it does, defined in the
same file)
No other patches are needed.
### Stability Indicators
- Authored by Realtek engineers (Shin-Yi Lin, Ping-Ke Shih) — the chip
vendor themselves
- The pattern is identical to all other entries in the table, well-
established and tested
### Conclusion
This is a classic device ID addition — the most straightforward type of
stable backport. It enables WiFi hardware for users who currently have
no support, with zero risk to anyone else. It perfectly matches the "New
Device IDs" exception category in the stable kernel rules.
**YES**
drivers/net/wireless/realtek/rtw89/rtw8852cu.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/net/wireless/realtek/rtw89/rtw8852cu.c b/drivers/net/wireless/realtek/rtw89/rtw8852cu.c
index 2708b523ca141..3b9825c92a0d9 100644
--- a/drivers/net/wireless/realtek/rtw89/rtw8852cu.c
+++ b/drivers/net/wireless/realtek/rtw89/rtw8852cu.c
@@ -46,6 +46,8 @@ static const struct usb_device_id rtw_8852cu_id_table[] = {
.driver_info = (kernel_ulong_t)&rtw89_8852cu_info },
{ USB_DEVICE_AND_INTERFACE_INFO(0x0db0, 0x991d, 0xff, 0xff, 0xff),
.driver_info = (kernel_ulong_t)&rtw89_8852cu_info },
+ { USB_DEVICE_AND_INTERFACE_INFO(0x28de, 0x2432, 0xff, 0xff, 0xff),
+ .driver_info = (kernel_ulong_t)&rtw89_8852cu_info },
{ USB_DEVICE_AND_INTERFACE_INFO(0x35b2, 0x0502, 0xff, 0xff, 0xff),
.driver_info = (kernel_ulong_t)&rtw89_8852cu_info },
{ USB_DEVICE_AND_INTERFACE_INFO(0x35bc, 0x0101, 0xff, 0xff, 0xff),
--
2.51.0
^ permalink raw reply related [flat|nested] 33+ messages in thread
* [PATCH AUTOSEL 6.19-6.18] wifi: ath12k: fix mac phy capability parsing
2026-02-14 21:22 [PATCH AUTOSEL 6.19-6.12] wifi: rtw89: ser: enable error IMR after recovering from L1 Sasha Levin
` (18 preceding siblings ...)
2026-02-14 21:23 ` [PATCH AUTOSEL 6.19] wifi: rtw89: Add default ID 28de:2432 for RTL8832CU Sasha Levin
@ 2026-02-14 21:23 ` Sasha Levin
2026-02-14 21:23 ` [PATCH AUTOSEL 6.19-6.1] wifi: rtw89: pci: restore LDO setting after device resume Sasha Levin
` (11 subsequent siblings)
31 siblings, 0 replies; 33+ messages in thread
From: Sasha Levin @ 2026-02-14 21:23 UTC (permalink / raw)
To: patches, stable
Cc: Baochen Qiang, Vasanthakumar Thiagarajan, Jeff Johnson,
Sasha Levin, jjohnson, linux-wireless, ath12k
From: Baochen Qiang <baochen.qiang@oss.qualcomm.com>
[ Upstream commit b5151c9b6e3a347416a4b4b55fc00195526d8771 ]
Currently ath12k_pull_mac_phy_cap_svc_ready_ext() assumes only one band
supported in each phy, hence it skips 5 GHz band if 2 GHz band support
is detected. This does not work for device which gets only one phy but
has both bands supported, such as QCC2072.
Change to check each band individually to fix this issue.
Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.1.c5-00302-QCAHMTSWPL_V1.0_V2.0_SILICONZ-1.115823.3
Signed-off-by: Baochen Qiang <baochen.qiang@oss.qualcomm.com>
Reviewed-by: Vasanthakumar Thiagarajan <vasanthakumar.thiagarajan@oss.qualcomm.com>
Link: https://patch.msgid.link/20260112-ath12k-support-qcc2072-v2-6-fc8ce1e43969@oss.qualcomm.com
Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
LLM Generated explanations, may be completely bogus:
### Dependency Concerns
The investigation reveals an important dependency issue:
- The constants were **renamed** from
`WMI_HOST_WLAN_2G_CAP`/`WMI_HOST_WLAN_5G_CAP` to
`WMI_HOST_WLAN_2GHZ_CAP`/`WMI_HOST_WLAN_5GHZ_CAP` in March 2025
(commit `6a88093f79ea0`). If backporting to a stable tree that
predates this rename, the constant names would need adjustment.
- The `nss_ratio` fields were added in June 2025 - older stable trees
may not have these.
- The ath12k driver itself was introduced in November 2022, so stable
trees from 6.1.y onward should have the driver.
The core logic change (if/else if → independent if checks) is self-
contained and the fix concept applies regardless of these naming
differences, though minor backport adjustments to constant names may be
needed for older stable trees.
### Risk vs. Benefit
- **Benefit:** Fixes a real functional bug where dual-band single-PHY
WiFi devices (like QCC2072) cannot use 5 GHz band at all. This is a
significant hardware functionality issue.
- **Risk:** Very low. The logic change is straightforward and doesn't
affect single-band devices. The only behavioral change for dual-band
devices is that both bands are now properly initialized instead of
only one.
### Conclusion
This is a clear bug fix in a wireless driver that prevents hardware from
working correctly. The fix is:
- Small and contained (single function, single file)
- Obviously correct (the if/else if logic was clearly wrong for dual-
band PHYs)
- Tested and reviewed
- Low risk of regression
- Fixes a real user-visible issue (5 GHz band not working)
The only minor concern is that backporting may require adjusting
constant names for older stable trees, but this is a trivial mechanical
adjustment.
**YES**
drivers/net/wireless/ath/ath12k/wmi.c | 22 ++++++++++++++--------
1 file changed, 14 insertions(+), 8 deletions(-)
diff --git a/drivers/net/wireless/ath/ath12k/wmi.c b/drivers/net/wireless/ath/ath12k/wmi.c
index 12f4d378f50d4..1613492b38350 100644
--- a/drivers/net/wireless/ath/ath12k/wmi.c
+++ b/drivers/net/wireless/ath/ath12k/wmi.c
@@ -496,6 +496,7 @@ ath12k_pull_mac_phy_cap_svc_ready_ext(struct ath12k_wmi_pdev *wmi_handle,
struct ath12k_band_cap *cap_band;
struct ath12k_pdev_cap *pdev_cap = &pdev->cap;
struct ath12k_fw_pdev *fw_pdev;
+ u32 supported_bands;
u32 phy_map;
u32 hw_idx, phy_idx = 0;
int i;
@@ -519,14 +520,19 @@ ath12k_pull_mac_phy_cap_svc_ready_ext(struct ath12k_wmi_pdev *wmi_handle,
return -EINVAL;
mac_caps = wmi_mac_phy_caps + phy_idx;
+ supported_bands = le32_to_cpu(mac_caps->supported_bands);
+
+ if (!(supported_bands & WMI_HOST_WLAN_2GHZ_CAP) &&
+ !(supported_bands & WMI_HOST_WLAN_5GHZ_CAP))
+ return -EINVAL;
pdev->pdev_id = ath12k_wmi_mac_phy_get_pdev_id(mac_caps);
pdev->hw_link_id = ath12k_wmi_mac_phy_get_hw_link_id(mac_caps);
- pdev_cap->supported_bands |= le32_to_cpu(mac_caps->supported_bands);
+ pdev_cap->supported_bands |= supported_bands;
pdev_cap->ampdu_density = le32_to_cpu(mac_caps->ampdu_density);
fw_pdev = &ab->fw_pdev[ab->fw_pdev_count];
- fw_pdev->supported_bands = le32_to_cpu(mac_caps->supported_bands);
+ fw_pdev->supported_bands = supported_bands;
fw_pdev->pdev_id = ath12k_wmi_mac_phy_get_pdev_id(mac_caps);
fw_pdev->phy_id = le32_to_cpu(mac_caps->phy_id);
ab->fw_pdev_count++;
@@ -535,10 +541,12 @@ ath12k_pull_mac_phy_cap_svc_ready_ext(struct ath12k_wmi_pdev *wmi_handle,
* band to band for a single radio, need to see how this should be
* handled.
*/
- if (le32_to_cpu(mac_caps->supported_bands) & WMI_HOST_WLAN_2GHZ_CAP) {
+ if (supported_bands & WMI_HOST_WLAN_2GHZ_CAP) {
pdev_cap->tx_chain_mask = le32_to_cpu(mac_caps->tx_chain_mask_2g);
pdev_cap->rx_chain_mask = le32_to_cpu(mac_caps->rx_chain_mask_2g);
- } else if (le32_to_cpu(mac_caps->supported_bands) & WMI_HOST_WLAN_5GHZ_CAP) {
+ }
+
+ if (supported_bands & WMI_HOST_WLAN_5GHZ_CAP) {
pdev_cap->vht_cap = le32_to_cpu(mac_caps->vht_cap_info_5g);
pdev_cap->vht_mcs = le32_to_cpu(mac_caps->vht_supp_mcs_5g);
pdev_cap->he_mcs = le32_to_cpu(mac_caps->he_supp_mcs_5g);
@@ -548,8 +556,6 @@ ath12k_pull_mac_phy_cap_svc_ready_ext(struct ath12k_wmi_pdev *wmi_handle,
WMI_NSS_RATIO_EN_DIS_GET(mac_caps->nss_ratio);
pdev_cap->nss_ratio_info =
WMI_NSS_RATIO_INFO_GET(mac_caps->nss_ratio);
- } else {
- return -EINVAL;
}
/* tx/rx chainmask reported from fw depends on the actual hw chains used,
@@ -565,7 +571,7 @@ ath12k_pull_mac_phy_cap_svc_ready_ext(struct ath12k_wmi_pdev *wmi_handle,
pdev_cap->rx_chain_mask_shift =
find_first_bit((unsigned long *)&pdev_cap->rx_chain_mask, 32);
- if (le32_to_cpu(mac_caps->supported_bands) & WMI_HOST_WLAN_2GHZ_CAP) {
+ if (supported_bands & WMI_HOST_WLAN_2GHZ_CAP) {
cap_band = &pdev_cap->band[NL80211_BAND_2GHZ];
cap_band->phy_id = le32_to_cpu(mac_caps->phy_id);
cap_band->max_bw_supported = le32_to_cpu(mac_caps->max_bw_supported_2g);
@@ -585,7 +591,7 @@ ath12k_pull_mac_phy_cap_svc_ready_ext(struct ath12k_wmi_pdev *wmi_handle,
le32_to_cpu(mac_caps->he_ppet2g.ppet16_ppet8_ru3_ru0[i]);
}
- if (le32_to_cpu(mac_caps->supported_bands) & WMI_HOST_WLAN_5GHZ_CAP) {
+ if (supported_bands & WMI_HOST_WLAN_5GHZ_CAP) {
cap_band = &pdev_cap->band[NL80211_BAND_5GHZ];
cap_band->phy_id = le32_to_cpu(mac_caps->phy_id);
cap_band->max_bw_supported =
--
2.51.0
^ permalink raw reply related [flat|nested] 33+ messages in thread
* [PATCH AUTOSEL 6.19-6.1] wifi: rtw89: pci: restore LDO setting after device resume
2026-02-14 21:22 [PATCH AUTOSEL 6.19-6.12] wifi: rtw89: ser: enable error IMR after recovering from L1 Sasha Levin
` (19 preceding siblings ...)
2026-02-14 21:23 ` [PATCH AUTOSEL 6.19-6.18] wifi: ath12k: fix mac phy capability parsing Sasha Levin
@ 2026-02-14 21:23 ` Sasha Levin
2026-02-14 21:23 ` [PATCH AUTOSEL 6.19-5.10] wifi: iwlegacy: add missing mutex protection in il3945_store_measurement() Sasha Levin
` (10 subsequent siblings)
31 siblings, 0 replies; 33+ messages in thread
From: Sasha Levin @ 2026-02-14 21:23 UTC (permalink / raw)
To: patches, stable
Cc: Dian-Syuan Yang, Ping-Ke Shih, Sasha Levin, linux-wireless
From: Dian-Syuan Yang <dian_syuan0116@realtek.com>
[ Upstream commit af1e82232b988f8fc6d635c60609765e49221a64 ]
The LDO (Low Dropout Regulator) setting is missing after suspend/resume
in some platforms, and it will cause card loss. Therefore, reconfigure
this setting to avoid it.
Signed-off-by: Dian-Syuan Yang <dian_syuan0116@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://patch.msgid.link/20260127085036.44060-6-pkshih@realtek.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
LLM Generated explanations, may be completely bogus:
### 3. CLASSIFICATION
This is a **suspend/resume bug fix** for a WiFi driver. The
`rtw89_pci_hci_ldo()` function is called during initial PCI setup (line
3065) but was missing from the resume path. After suspend/resume, the
LDO regulator configuration is lost, causing the WiFi card to disappear
entirely ("card loss").
The function `rtw89_pci_hci_ldo()` configures LDO-related bits in
`R_AX_SYS_SDIO_CTRL` for RTL8852A/885xB chips and RTL8852C chips. This
is a hardware register configuration that must be restored after power
cycling (suspend/resume).
### 4. SCOPE AND RISK ASSESSMENT
- **Change size**: 1 line added — minimal
- **Files touched**: 1 file (`drivers/net/wireless/realtek/rtw89/pci.c`)
- **Risk**: Extremely low — this calls an existing function that is
already called during normal initialization. It's simply calling it
again in the resume path to restore hardware state.
- **Subsystem**: WiFi driver (rtw89 — Realtek WiFi)
### 5. USER IMPACT
- **Who is affected**: Users with Realtek RTW89 WiFi adapters (RTL8852A,
RTL885xB, RTL8852C) who use suspend/resume
- **Severity**: HIGH — "card loss" means the WiFi card completely stops
working after resume, requiring a reboot
- **Real-world impact**: Laptop users who suspend their machines
regularly will lose WiFi functionality every time they resume
### 6. STABILITY
- The fix is from Realtek engineers (Dian-Syuan Yang, Ping-Ke Shih) who
maintain this driver
- It calls an existing, well-tested function — no new code paths are
introduced
- The pattern is well-established: many PCI drivers need to restore
register settings after resume
### 7. DEPENDENCY CHECK
The function `rtw89_pci_hci_ldo()` already exists in the codebase. The
`rtw89_pci_l2_hci_ldo()` call was already in the resume path. This
single-line addition has no dependencies on other commits.
### Summary
This is a textbook stable backport candidate:
- **Fixes a real bug**: WiFi card loss after suspend/resume
- **Obviously correct**: Restores hardware register configuration that
was present during init but missing during resume
- **Small and contained**: Single line addition calling an existing
function
- **No new features**: Just restoring existing hardware configuration
- **Low risk**: Calls well-tested existing code
- **High impact**: Affects laptop users who use suspend/resume with
these WiFi chips
- **From the hardware vendor**: Written by Realtek engineers who
understand the hardware
**YES**
drivers/net/wireless/realtek/rtw89/pci.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/net/wireless/realtek/rtw89/pci.c b/drivers/net/wireless/realtek/rtw89/pci.c
index b8135cf15d13c..fb4469a76bc03 100644
--- a/drivers/net/wireless/realtek/rtw89/pci.c
+++ b/drivers/net/wireless/realtek/rtw89/pci.c
@@ -4605,6 +4605,7 @@ static int __maybe_unused rtw89_pci_resume(struct device *dev)
rtw89_write32_clr(rtwdev, R_AX_PCIE_PS_CTRL_V1,
B_AX_SEL_REQ_ENTR_L1);
}
+ rtw89_pci_hci_ldo(rtwdev);
rtw89_pci_l2_hci_ldo(rtwdev);
rtw89_pci_basic_cfg(rtwdev, true);
--
2.51.0
^ permalink raw reply related [flat|nested] 33+ messages in thread
* [PATCH AUTOSEL 6.19-5.10] wifi: iwlegacy: add missing mutex protection in il3945_store_measurement()
2026-02-14 21:22 [PATCH AUTOSEL 6.19-6.12] wifi: rtw89: ser: enable error IMR after recovering from L1 Sasha Levin
` (20 preceding siblings ...)
2026-02-14 21:23 ` [PATCH AUTOSEL 6.19-6.1] wifi: rtw89: pci: restore LDO setting after device resume Sasha Levin
@ 2026-02-14 21:23 ` Sasha Levin
2026-02-14 21:23 ` [PATCH AUTOSEL 6.19] wifi: rtw89: Add support for D-Link VR Air Bridge (DWA-F18) Sasha Levin
` (9 subsequent siblings)
31 siblings, 0 replies; 33+ messages in thread
From: Sasha Levin @ 2026-02-14 21:23 UTC (permalink / raw)
To: patches, stable
Cc: Ziyi Guo, Stanislaw Gruszka, Johannes Berg, Sasha Levin,
linux-wireless
From: Ziyi Guo <n7l8m4@u.northwestern.edu>
[ Upstream commit 4dd1dda65265ecbc9f43ffc08e333684cf715152 ]
il3945_store_measurement() calls il3945_get_measurement() which internally
calls il_send_cmd_sync() without holding il->mutex. However,
il_send_cmd_sync() has lockdep_assert_held(&il->mutex) indicating that
callers must hold this lock.
Other sysfs store functions in the same file properly acquire the mutex:
- il3945_store_flags() acquires mutex at 3945-mac.c:3110
- il3945_store_filter_flags() acquires mutex at 3945-mac.c:3144
Add mutex_lock()/mutex_unlock() around the il3945_get_measurement() call
in the sysfs store function to fix the missing lock protection.
Signed-off-by: Ziyi Guo <n7l8m4@u.northwestern.edu>
Acked-by: Stanislaw Gruszka <stf_xl@wp.pl>
Link: https://patch.msgid.link/20260125193005.1090429-1-n7l8m4@u.northwestern.edu
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
LLM Generated explanations, may be completely bogus:
## Analysis
### Commit Message Analysis
The commit message is clear and well-documented. It identifies:
- **The bug**: `il3945_store_measurement()` calls
`il3945_get_measurement()` → `il_send_cmd_sync()` without holding
`il->mutex`
- **The evidence**: `il_send_cmd_sync()` has
`lockdep_assert_held(&il->mutex)`, meaning this will trigger a lockdep
warning at runtime
- **The pattern**: Other sysfs store functions in the same file
(`il3945_store_flags()`, `il3945_store_filter_flags()`) already
properly acquire the mutex
- **The fix**: Add `mutex_lock()`/`mutex_unlock()` around the call
### Code Change Analysis
The diff is minimal — only 2 lines added:
```c
mutex_lock(&il->mutex);
il3945_get_measurement(il, ¶ms, type);
mutex_unlock(&il->mutex);
```
This is a textbook missing-lock fix. The function is a sysfs store
handler (called from userspace via writing to a sysfs file), which calls
into the driver's command submission path without the required
synchronization.
**Bug mechanism**: Without the mutex, concurrent access to
`il_send_cmd_sync()` from this sysfs path and other paths (e.g., normal
driver operation, other sysfs handlers) can result in:
1. **Data races** on shared driver state
2. **Lockdep warnings** at runtime (guaranteed to fire)
3. Potential **corruption of command submission state** leading to
firmware communication errors or crashes
### Classification
This is a **synchronization bug fix** — a missing lock acquisition. It
falls squarely into the "race conditions" category of stable-worthy
fixes.
### Scope and Risk Assessment
- **Lines changed**: 2 (extremely minimal)
- **Files touched**: 1
- **Risk**: Very low — adding lock acquisition around a single function
call, following the exact same pattern as sibling functions in the
same file
- **Subsystem**: iwlegacy wireless driver (older Intel WiFi),
mature/stable code
- **Could this break something?**: The mutex is already used throughout
the driver. The only concern would be deadlock if
`il3945_get_measurement()` were called with the mutex already held,
but since this is a sysfs entry point (userspace-initiated), it's a
fresh call path — no lock is held on entry.
### User Impact
- Users with Intel 3945 WiFi hardware who trigger this sysfs interface
will hit the lockdep warning
- More critically, the lack of synchronization could lead to corruption
of the driver's command channel, potentially causing firmware hangs or
crashes
- The iwlegacy driver, while old, still has active users on older
hardware
### Stability Indicators
- **Acked-by**: Stanislaw Gruszka (former iwlegacy maintainer)
- **Committed by**: Johannes Berg (WiFi subsystem maintainer)
- The fix follows an existing, well-established pattern in the same file
### Dependency Check
- No dependencies on other commits
- The `il->mutex` and the function being called have existed in the
driver since its inception
- This code exists in all stable trees that include the iwlegacy driver
### Verdict
This is a small, obviously correct, well-reviewed fix for a real
synchronization bug. It:
- Fixes a lockdep assertion violation (guaranteed to trigger)
- Prevents potential race conditions in command submission
- Is only 2 lines, touching 1 file
- Follows the exact same pattern as adjacent code
- Has maintainer acks
- Has zero risk of regression
This meets all stable kernel criteria perfectly.
**YES**
drivers/net/wireless/intel/iwlegacy/3945-mac.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/net/wireless/intel/iwlegacy/3945-mac.c b/drivers/net/wireless/intel/iwlegacy/3945-mac.c
index 104748fcdc33e..54991f31c52c5 100644
--- a/drivers/net/wireless/intel/iwlegacy/3945-mac.c
+++ b/drivers/net/wireless/intel/iwlegacy/3945-mac.c
@@ -3224,7 +3224,9 @@ il3945_store_measurement(struct device *d, struct device_attribute *attr,
D_INFO("Invoking measurement of type %d on " "channel %d (for '%s')\n",
type, params.channel, buf);
+ mutex_lock(&il->mutex);
il3945_get_measurement(il, ¶ms, type);
+ mutex_unlock(&il->mutex);
return count;
}
--
2.51.0
^ permalink raw reply related [flat|nested] 33+ messages in thread
* [PATCH AUTOSEL 6.19] wifi: rtw89: Add support for D-Link VR Air Bridge (DWA-F18)
2026-02-14 21:22 [PATCH AUTOSEL 6.19-6.12] wifi: rtw89: ser: enable error IMR after recovering from L1 Sasha Levin
` (21 preceding siblings ...)
2026-02-14 21:23 ` [PATCH AUTOSEL 6.19-5.10] wifi: iwlegacy: add missing mutex protection in il3945_store_measurement() Sasha Levin
@ 2026-02-14 21:23 ` Sasha Levin
2026-02-14 21:23 ` [PATCH AUTOSEL 6.19-6.6] wifi: rtw89: wow: add reason codes for disassociation in WoWLAN mode Sasha Levin
` (8 subsequent siblings)
31 siblings, 0 replies; 33+ messages in thread
From: Sasha Levin @ 2026-02-14 21:23 UTC (permalink / raw)
To: patches, stable; +Cc: Zenm Chen, Ping-Ke Shih, Sasha Levin, linux-wireless
From: Zenm Chen <zenmchen@gmail.com>
[ Upstream commit 292c0bc8acb687de7e83fc454bb98af19187b6bf ]
Add the ID 2001:3323 to the table to support an additional RTL8832AU
adapter: D-Link VR Air Bridge (DWA-F18).
Compile tested only.
Link: https://github.com/morrownr/rtw89/pull/44
Signed-off-by: Zenm Chen <zenmchen@gmail.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://patch.msgid.link/20260112004759.6028-1-zenmchen@gmail.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
LLM Generated explanations, may be completely bogus:
## Analysis: Adding USB Device ID for D-Link VR Air Bridge (DWA-F18)
### Commit Message Analysis
The commit adds a single USB device ID (2001:3323) to the
`rtw_8852au_id_table` in the rtw89 WiFi driver. This enables an
existing, already-supported RTL8832AU chipset-based adapter — the D-Link
VR Air Bridge (DWA-F18) — to be recognized by the driver.
The commit message is straightforward: "Add the ID 2001:3323 to the
table to support an additional RTL8832AU adapter." It notes "Compile
tested only," which is typical for device ID additions since the
hardware behavior is identical to other already-supported devices with
the same chipset.
### Code Change Analysis
The change is exactly **2 lines added**, inserting a new
`USB_DEVICE_AND_INTERFACE_INFO` entry into the existing device ID table:
```c
{ USB_DEVICE_AND_INTERFACE_INFO(0x2001, 0x3323, 0xff, 0xff, 0xff),
.driver_info = (kernel_ulong_t)&rtw89_8852au_info },
```
This follows the exact same pattern as all other entries in the table.
The vendor ID `0x2001` is D-Link, and other D-Link devices (`0x3321`,
`0x332c`) are already in the table. The `.driver_info` points to the
same `rtw89_8852au_info` structure used by all entries.
### Classification: New Device ID
This falls squarely into the **"New Device IDs"** exception category for
stable backporting:
- The driver (`rtw89/rtw8852au`) already exists in stable trees
- Only a USB device ID is being added — no new code paths, no new logic
- The device uses the same RTL8832AU chipset as other already-supported
adapters
- The change is trivially correct by inspection
### Risk Assessment
- **Risk: Extremely Low** — A device ID addition cannot break any
existing functionality. It only affects matching for the specific USB
VID:PID 2001:3323, which previously had no driver match at all.
- **Scope: Minimal** — 2 lines in a single file, following an
established pattern.
- **Regression potential: Near zero** — No existing behavior is
modified.
### User Impact
Without this patch, users with the D-Link DWA-F18 VR Air Bridge cannot
use their WiFi adapter at all with the in-kernel rtw89 driver. With it,
the device is automatically recognized. This has real-world impact for
users of this specific hardware.
### Dependencies
This commit has no dependencies beyond the rtw89 USB driver
infrastructure already being present in the stable tree. The
`rtw8852au.c` driver and the `rtw89_8852au_info` structure are already
defined.
### Stability Indicators
- Signed off by the rtw89 subsystem maintainer (Ping-Ke Shih from
Realtek)
- Follows established patterns identically
- Community-contributed with a linked PR showing user demand
### Conclusion
This is a textbook example of a device ID addition that is appropriate
for stable backporting. It enables hardware support for a specific USB
WiFi adapter using an existing, well-tested driver. The change is
trivial, risk-free, and provides direct benefit to users with this
hardware.
**YES**
drivers/net/wireless/realtek/rtw89/rtw8852au.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/net/wireless/realtek/rtw89/rtw8852au.c b/drivers/net/wireless/realtek/rtw89/rtw8852au.c
index 74a976c984ad8..ccdbcc178c2a4 100644
--- a/drivers/net/wireless/realtek/rtw89/rtw8852au.c
+++ b/drivers/net/wireless/realtek/rtw89/rtw8852au.c
@@ -52,6 +52,8 @@ static const struct usb_device_id rtw_8852au_id_table[] = {
.driver_info = (kernel_ulong_t)&rtw89_8852au_info },
{ USB_DEVICE_AND_INTERFACE_INFO(0x2001, 0x3321, 0xff, 0xff, 0xff),
.driver_info = (kernel_ulong_t)&rtw89_8852au_info },
+ { USB_DEVICE_AND_INTERFACE_INFO(0x2001, 0x3323, 0xff, 0xff, 0xff),
+ .driver_info = (kernel_ulong_t)&rtw89_8852au_info },
{ USB_DEVICE_AND_INTERFACE_INFO(0x2001, 0x332c, 0xff, 0xff, 0xff),
.driver_info = (kernel_ulong_t)&rtw89_8852au_info },
{ USB_DEVICE_AND_INTERFACE_INFO(0x2357, 0x013f, 0xff, 0xff, 0xff),
--
2.51.0
^ permalink raw reply related [flat|nested] 33+ messages in thread
* [PATCH AUTOSEL 6.19-6.6] wifi: rtw89: wow: add reason codes for disassociation in WoWLAN mode
2026-02-14 21:22 [PATCH AUTOSEL 6.19-6.12] wifi: rtw89: ser: enable error IMR after recovering from L1 Sasha Levin
` (22 preceding siblings ...)
2026-02-14 21:23 ` [PATCH AUTOSEL 6.19] wifi: rtw89: Add support for D-Link VR Air Bridge (DWA-F18) Sasha Levin
@ 2026-02-14 21:23 ` Sasha Levin
2026-02-14 21:23 ` [PATCH AUTOSEL 6.19-6.12] wifi: rtw89: fix unable to receive probe responses under MLO connection Sasha Levin
` (7 subsequent siblings)
31 siblings, 0 replies; 33+ messages in thread
From: Sasha Levin @ 2026-02-14 21:23 UTC (permalink / raw)
To: patches, stable; +Cc: Chin-Yen Lee, Ping-Ke Shih, Sasha Levin, linux-wireless
From: Chin-Yen Lee <timlee@realtek.com>
[ Upstream commit 2fd8f953f25173d14981d8736b6f5bfcd757e51b ]
Some APs disconnect clients by sending a Disassociation frame
rather than a Deauthentication frame. Since these frames use
different reason codes in WoWLAN mode, this commit adds support
for handling Disassociation to prevent missed disconnection events.
Signed-off-by: Chin-Yen Lee <timlee@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://patch.msgid.link/20260110022019.2254969-3-pkshih@realtek.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
LLM Generated explanations, may be completely bogus:
## Analysis
### Commit Message Analysis
The commit adds handling for disassociation frames in WoWLAN (Wake-on-
Wireless-LAN) mode. The problem described is that some APs disconnect
clients by sending a Disassociation frame rather than a Deauthentication
frame. Without this patch, if an AP sends a Disassociation frame while
the system is in WoWLAN suspend, the driver doesn't recognize the wake
reason code (`0x4`), and the disconnection event is missed — the system
either doesn't wake up properly or wakes up without reporting the
correct reason to userspace.
### Code Change Analysis
The change is minimal and surgical:
1. **wow.h**: Adds a new enum value `RTW89_WOW_RSN_RX_DISASSOC = 0x4` to
the existing `rtw89_wake_reason` enum. This is a firmware-defined
reason code that the hardware/firmware already produces — the driver
just wasn't handling it.
2. **wow.c**: Adds a new `case RTW89_WOW_RSN_RX_DISASSOC:` in the switch
statement in `rtw89_wow_show_wakeup_reason()`, which sets
`wakeup.disconnect = true` (same as deauth and disconnect cases) and
logs a debug message.
The pattern is identical to the existing `RTW89_WOW_RSN_RX_DEAUTH` case
— same behavior, just for a different frame type.
### Bug Classification
This fixes a **real functional bug**: missed disconnection events during
WoWLAN suspend. When an AP sends a disassociation frame (which is a
legitimate and common way to disconnect a client per IEEE 802.11), the
driver fails to properly report the wakeup reason. This means:
- The system may not wake up when the user expects it to (missed wake
event)
- Or if it does wake, the wakeup reason isn't properly communicated to
cfg80211/userspace
- The unhandled reason code falls through to the `default` case in the
switch
### Scope and Risk Assessment
- **Size**: ~10 lines added across 2 files
- **Risk**: Extremely low — it's adding a case to a switch statement
that mirrors existing cases
- **Self-contained**: No dependencies on other commits
- **No new features**: This is handling a firmware-defined reason code
that the hardware already produces; the driver was simply missing the
handler
- **No API changes**: No new userspace-visible APIs
### User Impact
This affects any user of rtw89 WiFi hardware who uses WoWLAN.
Disassociation frames are commonly sent by APs (especially enterprise
APs during maintenance, roaming scenarios, or policy enforcement).
Missing these events means WoWLAN doesn't work correctly in real-world
scenarios — which is a functional bug for laptop users relying on wake-
on-disconnect.
### Comparison to Stable Criteria
This is analogous to a **hardware quirk/workaround** — it handles a case
that the firmware already supports but the driver wasn't processing. It:
- Fixes a real bug (missed disconnection events)
- Is obviously correct (mirrors existing deauth handling)
- Is small and contained
- Does not introduce new features
- Applies cleanly
### Concerns
- The code exists in stable trees (rtw89 driver has been in the kernel
for several versions)
- No dependencies on other commits
- The enum value `0x4` is firmware-defined and presumably has been
supported by the firmware for some time
### Decision
This is a small, surgical bug fix that prevents missed WoWLAN
disconnection events. It's clearly correct, mirrors existing code
patterns, has negligible risk, and fixes a real-world user-facing issue
with WiFi hardware.
**YES**
drivers/net/wireless/realtek/rtw89/wow.c | 4 ++++
drivers/net/wireless/realtek/rtw89/wow.h | 1 +
2 files changed, 5 insertions(+)
diff --git a/drivers/net/wireless/realtek/rtw89/wow.c b/drivers/net/wireless/realtek/rtw89/wow.c
index 46aba4cb2ee9e..534966b4d9c43 100644
--- a/drivers/net/wireless/realtek/rtw89/wow.c
+++ b/drivers/net/wireless/realtek/rtw89/wow.c
@@ -809,6 +809,10 @@ static void rtw89_wow_show_wakeup_reason(struct rtw89_dev *rtwdev)
reason = rtw89_read8(rtwdev, wow_reason_reg);
switch (reason) {
+ case RTW89_WOW_RSN_RX_DISASSOC:
+ wakeup.disconnect = true;
+ rtw89_debug(rtwdev, RTW89_DBG_WOW, "WOW: Rx disassoc\n");
+ break;
case RTW89_WOW_RSN_RX_DEAUTH:
wakeup.disconnect = true;
rtw89_debug(rtwdev, RTW89_DBG_WOW, "WOW: Rx deauth\n");
diff --git a/drivers/net/wireless/realtek/rtw89/wow.h b/drivers/net/wireless/realtek/rtw89/wow.h
index d2ba6cebc2a6b..71e07f482174f 100644
--- a/drivers/net/wireless/realtek/rtw89/wow.h
+++ b/drivers/net/wireless/realtek/rtw89/wow.h
@@ -33,6 +33,7 @@
enum rtw89_wake_reason {
RTW89_WOW_RSN_RX_PTK_REKEY = 0x1,
RTW89_WOW_RSN_RX_GTK_REKEY = 0x2,
+ RTW89_WOW_RSN_RX_DISASSOC = 0x4,
RTW89_WOW_RSN_RX_DEAUTH = 0x8,
RTW89_WOW_RSN_DISCONNECT = 0x10,
RTW89_WOW_RSN_RX_MAGIC_PKT = 0x21,
--
2.51.0
^ permalink raw reply related [flat|nested] 33+ messages in thread
* [PATCH AUTOSEL 6.19-6.12] wifi: rtw89: fix unable to receive probe responses under MLO connection
2026-02-14 21:22 [PATCH AUTOSEL 6.19-6.12] wifi: rtw89: ser: enable error IMR after recovering from L1 Sasha Levin
` (23 preceding siblings ...)
2026-02-14 21:23 ` [PATCH AUTOSEL 6.19-6.6] wifi: rtw89: wow: add reason codes for disassociation in WoWLAN mode Sasha Levin
@ 2026-02-14 21:23 ` Sasha Levin
2026-02-14 21:23 ` [PATCH AUTOSEL 6.19-6.18] wifi: rtw89: regd: 6 GHz power type marks default when inactive Sasha Levin
` (6 subsequent siblings)
31 siblings, 0 replies; 33+ messages in thread
From: Sasha Levin @ 2026-02-14 21:23 UTC (permalink / raw)
To: patches, stable; +Cc: Po-Hao Huang, Ping-Ke Shih, Sasha Levin, linux-wireless
From: Po-Hao Huang <phhuang@realtek.com>
[ Upstream commit 6f6d7a325fbde4f025ee1b1277f6f44727e21223 ]
During MLO connections, A1 of the probe responses we received are
in link address, these frames will then be dropped by mac80211 due to
not matching the MLD address in ieee80211_scan_accept_presp().
Fix this by using MLD address to scan when not using random MAC address.
Signed-off-by: Po-Hao Huang <phhuang@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://patch.msgid.link/20260114013950.19704-13-pkshih@realtek.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
LLM Generated explanations, may be completely bogus:
## Analysis of commit: "wifi: rtw89: fix unable to receive probe
responses under MLO connection"
### 1. Commit Message Analysis
The commit message is clear and describes a real user-visible bug:
- **Problem**: During MLO (Multi-Link Operation) connections, probe
responses have A1 (destination address) set to the link address, but
mac80211's `ieee80211_scan_accept_presp()` checks against the MLD
address. This causes all probe responses to be dropped during
scanning.
- **Impact**: WiFi scanning is completely broken under MLO connections —
the device cannot receive probe responses, which means it cannot
discover or reconnect to access points while in an MLO connection.
- **Fix**: Use the MLD address (from `vif->addr`) instead of the link
address when initiating scans under MLO, unless random MAC scanning is
requested.
The word "fix" is in the subject, and the description clearly explains a
real functional bug.
### 2. Code Change Analysis
The change is minimal and surgical:
1. **One new variable declaration**: `struct ieee80211_vif *vif =
rtwvif_link_to_vif(rtwvif_link);` — retrieves the VIF structure to
access the MLD address.
2. **Two new lines of logic** added to the MAC address selection:
```c
else if (ieee80211_vif_is_mld(vif))
ether_addr_copy(mac_addr, vif->addr);
```
This is inserted between the random MAC address case and the default
link address case. The logic flow becomes:
- If random MAC scanning → use random MAC (unchanged)
- **NEW**: If MLO connection → use MLD address (`vif->addr`)
- Else → use link address (unchanged, existing behavior)
This is a clean, well-structured conditional addition that doesn't alter
existing behavior for non-MLO cases.
### 3. Classification
This is a **bug fix** — it fixes broken WiFi scanning functionality
under MLO connections. Without this fix, probe responses are silently
dropped, making scanning non-functional in MLO mode.
### 4. Scope and Risk Assessment
- **Lines changed**: ~4 lines (1 variable declaration, 2 lines of new
conditional logic, 1 existing line unchanged)
- **Files changed**: 1 file (`drivers/net/wireless/realtek/rtw89/fw.c`)
- **Risk**: Very low. The change only affects the MLO path (guarded by
`ieee80211_vif_is_mld()`), so non-MLO operation is completely
unaffected. The fix is logically correct — when in MLO mode, using the
MLD address is the right thing to do since that's what mac80211
expects.
### 5. User Impact
- **Who is affected**: Users of Realtek rtw89 WiFi adapters using MLO
(WiFi 7 / 802.11be) connections.
- **Severity**: High for affected users — scanning is completely broken
under MLO, meaning the device can't discover networks while connected
via MLO.
- **Growing user base**: As WiFi 7 adoption grows, more users will
encounter this issue.
### 6. Stability Indicators
- **Author**: Po-Hao Huang (phhuang@realtek.com) — Realtek engineer with
deep knowledge of the driver
- **Signed-off-by**: Ping-Ke Shih (pkshih@realtek.com) — the rtw89
maintainer
- **Link**: Proper patch submission via mailing list
### 7. Dependency Check
The change uses:
- `rtwvif_link_to_vif()` — likely a helper that exists in the driver
- `ieee80211_vif_is_mld()` — a mac80211 API function
- `vif->addr` — standard VIF field
The key question is whether MLO support (and `ieee80211_vif_is_mld()`)
exists in stable trees. MLO/WiFi 7 support is relatively recent (merged
in 6.5+ timeframe). This fix would only be relevant for stable trees
that already have MLO support in rtw89.
### 8. Stable Kernel Criteria Assessment
- **Obviously correct**: Yes — using MLD address for MLO scans is the
correct behavior per 802.11be spec
- **Fixes a real bug**: Yes — scanning is completely broken under MLO
- **Small and contained**: Yes — 4 lines in 1 file
- **No new features**: Correct — this fixes existing MLO scanning
functionality
- **Tested**: Yes — from Realtek engineers, went through mainline
### Conclusion
This is a small, surgical, well-understood bug fix that addresses a
complete functional failure (broken WiFi scanning under MLO
connections). It affects only MLO paths, has zero risk to non-MLO users,
and is authored by the hardware vendor's driver team. It meets all
stable kernel criteria for backporting (to kernels that have MLO support
in rtw89).
**YES**
drivers/net/wireless/realtek/rtw89/fw.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/net/wireless/realtek/rtw89/fw.c b/drivers/net/wireless/realtek/rtw89/fw.c
index 7b9d9989e5170..2f68a04cc028f 100644
--- a/drivers/net/wireless/realtek/rtw89/fw.c
+++ b/drivers/net/wireless/realtek/rtw89/fw.c
@@ -8114,6 +8114,7 @@ int rtw89_hw_scan_start(struct rtw89_dev *rtwdev,
struct cfg80211_scan_request *req = &scan_req->req;
const struct rtw89_chan *chan = rtw89_chan_get(rtwdev,
rtwvif_link->chanctx_idx);
+ struct ieee80211_vif *vif = rtwvif_link_to_vif(rtwvif_link);
struct rtw89_vif *rtwvif = rtwvif_link->rtwvif;
struct rtw89_chanctx_pause_parm pause_parm = {
.rsn = RTW89_CHANCTX_PAUSE_REASON_HW_SCAN,
@@ -8142,6 +8143,8 @@ int rtw89_hw_scan_start(struct rtw89_dev *rtwdev,
if (req->flags & NL80211_SCAN_FLAG_RANDOM_ADDR)
get_random_mask_addr(mac_addr, req->mac_addr,
req->mac_addr_mask);
+ else if (ieee80211_vif_is_mld(vif))
+ ether_addr_copy(mac_addr, vif->addr);
else
ether_addr_copy(mac_addr, rtwvif_link->mac_addr);
--
2.51.0
^ permalink raw reply related [flat|nested] 33+ messages in thread
* [PATCH AUTOSEL 6.19-6.18] wifi: rtw89: regd: 6 GHz power type marks default when inactive
2026-02-14 21:22 [PATCH AUTOSEL 6.19-6.12] wifi: rtw89: ser: enable error IMR after recovering from L1 Sasha Levin
` (24 preceding siblings ...)
2026-02-14 21:23 ` [PATCH AUTOSEL 6.19-6.12] wifi: rtw89: fix unable to receive probe responses under MLO connection Sasha Levin
@ 2026-02-14 21:23 ` Sasha Levin
2026-02-14 21:23 ` [PATCH AUTOSEL 6.19] wifi: cfg80211: treat deprecated INDOOR_SP_AP_OLD control value as LPI mode Sasha Levin
` (5 subsequent siblings)
31 siblings, 0 replies; 33+ messages in thread
From: Sasha Levin @ 2026-02-14 21:23 UTC (permalink / raw)
To: patches, stable; +Cc: Zong-Zhe Yang, Ping-Ke Shih, Sasha Levin, linux-wireless
From: Zong-Zhe Yang <kevin_yang@realtek.com>
[ Upstream commit 8c96752d99c0b094af68317a8c701b09bd0862d9 ]
When inactive, 6 GHz power type has been assigned to the default one,
but missed to mark the local control variable, dflt, true. Then, this
might let some 6 GHz power info of disconnected APs keep being taken
into account under certain cases.
So, mark default when inactive.
Signed-off-by: Zong-Zhe Yang <kevin_yang@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://patch.msgid.link/20251229030926.27004-12-pkshih@realtek.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
LLM Generated explanations, may be completely bogus:
## Commit Analysis: wifi: rtw89: regd: 6 GHz power type marks default
when inactive
### 1. Commit Message Analysis
The commit message clearly describes a bug: when a 6 GHz connection
becomes inactive, the code correctly sets the power type to the default
value (`RTW89_REG_6GHZ_POWER_DFLT`), but **fails to set the local
variable `dflt = true`**. This is a logic error where two related state
updates are out of sync.
The consequence: "this might let some 6 GHz power info of disconnected
APs keep being taken into account under certain cases." This means stale
power configuration from a previously connected AP could persist and
affect regulatory behavior.
### 2. Code Change Analysis
The fix is a **single line addition**: `dflt = true;` in the `else`
(inactive) branch.
Let me trace the logic:
- `dflt` is a boolean that tracks whether the default power type is in
use
- In the `active` branch, when the `default:` case of the switch is hit,
both `reg_6ghz_power = RTW89_REG_6GHZ_POWER_DFLT` AND `dflt = true`
are set
- In the `else` (inactive) branch, `reg_6ghz_power =
RTW89_REG_6GHZ_POWER_DFLT` is set but `dflt` was **not** being set to
`true`
The `dflt` variable is then checked at line `if (!dflt &&
blocked[rtwvif_link->reg_6ghz_power])`. When `dflt` is false and the
power type is `RTW89_REG_6GHZ_POWER_DFLT`, the code would incorrectly
check `blocked[RTW89_REG_6GHZ_POWER_DFLT]`, which could cause the
function to return `-EINVAL` erroneously when the link is inactive, or
it could allow stale power type information to persist.
### 3. Bug Classification
This is a **logic bug** — specifically a missing state update that
causes inconsistent behavior. When a WiFi interface goes inactive on 6
GHz:
- The power type is correctly reset to default
- But `dflt` stays false (from initialization), so the "blocked" check
below could still evaluate the default power type against the blocked
list, potentially returning an error when it shouldn't
This affects regulatory domain handling, which is important for proper
WiFi operation on 6 GHz bands.
### 4. Scope and Risk Assessment
- **Size**: 1 line added — minimal
- **Files touched**: 1 file
(`drivers/net/wireless/realtek/rtw89/regd.c`)
- **Risk**: Extremely low — it's adding a missing boolean assignment
that mirrors the behavior already present in the `default:` case of
the `active` branch
- **Correctness**: Obviously correct — the inactive branch sets the same
`RTW89_REG_6GHZ_POWER_DFLT` value as the default case in the active
branch, so it should also set `dflt = true`
### 5. User Impact
- Affects users of Realtek RTW89 WiFi adapters using 6 GHz bands
- Could cause incorrect regulatory power type handling when
disconnecting from 6 GHz APs
- In certain cases, stale power info from disconnected APs could be
used, potentially causing regulatory compliance issues or connectivity
problems
### 6. Stable Kernel Criteria
- **Obviously correct**: Yes — the fix is symmetric with the `default:`
case in the active branch
- **Fixes a real bug**: Yes — logic error causing inconsistent state
- **Small and contained**: Yes — 1 line in 1 file
- **No new features**: Correct — pure bug fix
- **Tested**: From Realtek maintainers (Zong-Zhe Yang, Ping-Ke Shih)
### 7. Dependencies
This fix is self-contained. The surrounding code structure (the switch
statement, the `dflt` variable, the `blocked[]` check) all exist in
stable kernels that have the rtw89 driver with 6 GHz support.
### Conclusion
This is a clean, minimal, obviously-correct bug fix that addresses a
real logic error in WiFi regulatory power type handling. It has
negligible risk of regression and fixes a genuine issue for users of
Realtek WiFi adapters on 6 GHz networks.
**YES**
drivers/net/wireless/realtek/rtw89/regd.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/net/wireless/realtek/rtw89/regd.c b/drivers/net/wireless/realtek/rtw89/regd.c
index 209d84909f885..c3425ed44732e 100644
--- a/drivers/net/wireless/realtek/rtw89/regd.c
+++ b/drivers/net/wireless/realtek/rtw89/regd.c
@@ -1142,6 +1142,7 @@ static int rtw89_reg_6ghz_power_recalc(struct rtw89_dev *rtwdev,
}
} else {
rtwvif_link->reg_6ghz_power = RTW89_REG_6GHZ_POWER_DFLT;
+ dflt = true;
}
rcu_read_unlock();
--
2.51.0
^ permalink raw reply related [flat|nested] 33+ messages in thread
* [PATCH AUTOSEL 6.19] wifi: cfg80211: treat deprecated INDOOR_SP_AP_OLD control value as LPI mode
2026-02-14 21:22 [PATCH AUTOSEL 6.19-6.12] wifi: rtw89: ser: enable error IMR after recovering from L1 Sasha Levin
` (25 preceding siblings ...)
2026-02-14 21:23 ` [PATCH AUTOSEL 6.19-6.18] wifi: rtw89: regd: 6 GHz power type marks default when inactive Sasha Levin
@ 2026-02-14 21:23 ` Sasha Levin
2026-02-14 21:23 ` [PATCH AUTOSEL 6.19-6.12] wifi: rtw88: Use devm_kmemdup() in rtw_set_supported_band() Sasha Levin
` (4 subsequent siblings)
31 siblings, 0 replies; 33+ messages in thread
From: Sasha Levin @ 2026-02-14 21:23 UTC (permalink / raw)
To: patches, stable
Cc: Pagadala Yesu Anjaneyulu, Johannes Berg, Miri Korenblit,
Sasha Levin, johannes, linux-wireless
From: Pagadala Yesu Anjaneyulu <pagadala.yesu.anjaneyulu@intel.com>
[ Upstream commit fd5bfcf430ea2fdbb3e78fd0b82ceb0ab02b72ee ]
Although value 4 (INDOOR_SP_AP_OLD) is deprecated in IEEE standards,
existing APs may still use this control value. Since this value is
based on the old specification, we cannot trust such APs implement
proper power controls.
Therefore, move IEEE80211_6GHZ_CTRL_REG_INDOOR_SP_AP_OLD case
from SP_AP to LPI_AP power type handling to prevent potential
power limit violations.
Signed-off-by: Pagadala Yesu Anjaneyulu <pagadala.yesu.anjaneyulu@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20260111163601.6b5a36d3601e.I1704ee575fd25edb0d56f48a0a3169b44ef72ad0@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
LLM Generated explanations, may be completely bogus:
## Analysis of wifi: cfg80211: treat deprecated INDOOR_SP_AP_OLD control
value as LPI mode
### 1. Commit Message Analysis
The commit addresses a **power limit violation** issue in 6 GHz WiFi
regulatory handling. The key points:
- Value 4 (`INDOOR_SP_AP_OLD`) is deprecated in IEEE standards but still
used by existing APs in the field
- Since APs using this deprecated value may not implement proper power
controls, the commit treats them as LPI (Low Power Indoor) instead of
SP (Standard Power)
- This **prevents potential power limit violations** — a regulatory
compliance and safety issue
The commit is reviewed by Johannes Berg (wireless subsystem maintainer)
and signed off by Intel WiFi developers, indicating high confidence in
correctness.
### 2. Code Change Analysis
The change is extremely minimal — a single line is moved from one `case`
group to another in a `switch` statement:
```c
// BEFORE: INDOOR_SP_AP_OLD was grouped with SP_AP → returned
IEEE80211_REG_SP_AP
// AFTER: INDOOR_SP_AP_OLD is grouped with LPI_AP → returns
IEEE80211_REG_LPI_AP
```
This is a **two-line diff** (one line added, one line removed) in a
`static inline` function in a header file. The change is purely about
reclassifying a deprecated control value to use more conservative
(lower) power limits.
### 3. Classification: Bug Fix
This is a **correctness/safety fix**, not a feature:
- **Regulatory compliance**: Using SP (Standard Power) when the AP
doesn't implement proper power controls can violate regulatory power
limits for 6 GHz spectrum
- **Real-world impact**: Existing APs in the field still use this
deprecated value 4, so real users encounter this
- **Conservative approach**: Moving to LPI (Low Power Indoor) is the
safe default — it restricts power rather than allowing potentially
excessive power
This is analogous to a **hardware quirk/workaround** — dealing with
real-world devices that use a deprecated specification value.
### 4. Scope and Risk Assessment
- **Size**: Minimal — moving one `case` label from one group to another
- **Risk**: Extremely low — the change is to use MORE conservative power
limits, not less
- **Subsystem**: WiFi/cfg80211 — widely used networking subsystem
- **Side effects**: Devices connecting to APs using the deprecated value
will use lower power, which is safer. In the worst case, this means
slightly reduced range, which is far better than violating regulatory
limits.
### 5. User Impact
- **Who is affected**: Any user with a 6 GHz WiFi device connecting to
an AP that uses the deprecated `INDOOR_SP_AP_OLD` control value
- **Severity**: Without this fix, the system could transmit at Standard
Power levels when it should be using Low Power Indoor levels — this is
a **regulatory violation** that could potentially cause interference
and legal issues
- **Real-world devices**: The commit message explicitly states "existing
APs may still use this control value," confirming real hardware exists
with this behavior
### 6. Stability Indicators
- **Reviewed-by: Johannes Berg** — the wireless maintainer himself
reviewed this
- **Signed-off by multiple Intel WiFi developers** — well-tested within
the Intel WiFi team
- The fix is trivially correct — just moving a case label
### 7. Dependency Check
- No dependencies on other commits
- The `IEEE80211_6GHZ_CTRL_REG_INDOOR_SP_AP_OLD` enum value and the
`cfg80211_6ghz_power_type()` function need to exist in the stable
tree, which they should for any kernel with 6 GHz support
- The change applies cleanly as it's self-contained within a single
switch statement
### 8. Stable Kernel Rules Assessment
1. **Obviously correct and tested**: Yes — trivial case label move,
reviewed by maintainer
2. **Fixes a real bug**: Yes — incorrect power type assignment for
deprecated control value leads to regulatory violations
3. **Important issue**: Yes — regulatory compliance, potential power
limit violations
4. **Small and contained**: Yes — two-line change in one file
5. **No new features**: Correct — no new functionality, just
reclassification of an existing value
6. **Applies cleanly**: Should apply cleanly to any stable tree with 6
GHz support
### Risk vs. Benefit
- **Risk**: Near zero — the change is trivially simple and moves to a
more conservative power setting
- **Benefit**: Prevents regulatory power limit violations for users
connecting to APs with deprecated control values
- **Trade-off**: Strongly favors backporting
The fix is small, surgical, addresses a real-world regulatory compliance
issue with existing hardware, is reviewed by the wireless subsystem
maintainer, and carries virtually no regression risk.
**YES**
include/net/cfg80211.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index 2900202588a54..39a04776705eb 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -10147,9 +10147,9 @@ cfg80211_6ghz_power_type(u8 control, u32 client_flags)
case IEEE80211_6GHZ_CTRL_REG_LPI_AP:
case IEEE80211_6GHZ_CTRL_REG_INDOOR_LPI_AP:
case IEEE80211_6GHZ_CTRL_REG_AP_ROLE_NOT_RELEVANT:
+ case IEEE80211_6GHZ_CTRL_REG_INDOOR_SP_AP_OLD:
return IEEE80211_REG_LPI_AP;
case IEEE80211_6GHZ_CTRL_REG_SP_AP:
- case IEEE80211_6GHZ_CTRL_REG_INDOOR_SP_AP_OLD:
return IEEE80211_REG_SP_AP;
case IEEE80211_6GHZ_CTRL_REG_VLP_AP:
return IEEE80211_REG_VLP_AP;
--
2.51.0
^ permalink raw reply related [flat|nested] 33+ messages in thread
* [PATCH AUTOSEL 6.19-6.12] wifi: rtw88: Use devm_kmemdup() in rtw_set_supported_band()
2026-02-14 21:22 [PATCH AUTOSEL 6.19-6.12] wifi: rtw89: ser: enable error IMR after recovering from L1 Sasha Levin
` (26 preceding siblings ...)
2026-02-14 21:23 ` [PATCH AUTOSEL 6.19] wifi: cfg80211: treat deprecated INDOOR_SP_AP_OLD control value as LPI mode Sasha Levin
@ 2026-02-14 21:23 ` Sasha Levin
2026-02-14 21:23 ` [PATCH AUTOSEL 6.19-5.10] wifi: libertas: fix WARNING in usb_tx_block Sasha Levin
` (3 subsequent siblings)
31 siblings, 0 replies; 33+ messages in thread
From: Sasha Levin @ 2026-02-14 21:23 UTC (permalink / raw)
To: patches, stable
Cc: Bitterblue Smith, Ping-Ke Shih, Sasha Levin, linux-wireless
From: Bitterblue Smith <rtl8821cerfe2@gmail.com>
[ Upstream commit 2ba12401cc1f2d970fa2e7d5b15abde3f5abd40d ]
Simplify the code by using device managed memory allocations.
This also fixes a memory leak in rtw_register_hw(). The supported bands
were not freed in the error path.
Copied from commit 145df52a8671 ("wifi: rtw89: Convert
rtw89_core_set_supported_band to use devm_*").
Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>
Acked-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://patch.msgid.link/1aa7fdef-2d5b-4a31-a4e9-fac8257ed30d@gmail.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
LLM Generated explanations, may be completely bogus:
## Analysis
### Commit Message Analysis
The commit message is explicit about fixing a bug: **"This also fixes a
memory leak in rtw_register_hw(). The supported bands were not freed in
the error path."**
The primary change converts `kmemdup()` to `devm_kmemdup()` (device-
managed memory), which means the memory will be automatically freed when
the device is removed. This simultaneously:
1. Simplifies the code (removes manual `rtw_unset_supported_band()`
function)
2. **Fixes a real memory leak** on the error path of `rtw_register_hw()`
### Code Change Analysis
Let me trace the bug:
1. `rtw_set_supported_band()` allocates memory with `kmemdup()` for 2GHz
and 5GHz band structures
2. `rtw_register_hw()` calls `rtw_set_supported_band()` early in its
flow
3. If `rtw_register_hw()` fails later (e.g., at `rtw_regd_hint()` →
`goto led_deinit`), the error path does NOT call
`rtw_unset_supported_band()` to free those allocations
4. The old `rtw_unset_supported_band()` was only called in
`rtw_unregister_hw()`, which is the normal teardown path — not the
error path
Let me verify this by examining the error path structure in the diff.
The `rtw_register_hw()` function has error paths (`goto led_deinit`)
that return without freeing the band allocations. This is a genuine
memory leak.
### The Fix
The fix converts to `devm_kmemdup()`, which ties the allocation lifetime
to the device. This means:
- On error paths: memory is freed when the device is cleaned up (no
leak)
- On normal unregister: memory is freed automatically (no need for
`rtw_unset_supported_band()`)
The `rtw_unset_supported_band()` function is removed entirely since it's
no longer needed, and the call to it in `rtw_unregister_hw()` is also
removed.
### Stable Criteria Assessment
1. **Fixes a real bug**: Yes — memory leak on error path in
`rtw_register_hw()`. If probe fails repeatedly (e.g., USB WiFi dongle
being plugged/unplugged), this leaks memory each time.
2. **Obviously correct**: Yes — the pattern of converting from `kmemdup`
to `devm_kmemdup` is well-established and was already done in the
sister driver rtw89 (commit 145df52a8671).
3. **Small and contained**: Yes — changes a single file, ~20 lines of
actual logic change, rest is removal of now-unnecessary code.
4. **No new features**: Correct — this is purely a bug fix with code
simplification.
5. **Tested**: Has `Acked-by` from the Realtek maintainer (Ping-Ke
Shih).
### Risk Assessment
**Low risk**:
- `devm_kmemdup()` is a standard, well-tested kernel API
- The same pattern was already applied to rtw89 (the newer sibling
driver)
- The change is straightforward — swap allocation function, remove
manual free function
- The rtw88 driver is widely used (RTL8822BE, RTL8822CE, RTL8821CE are
common WiFi chips)
**One potential concern**: The devm-managed memory will be freed when
the device is destroyed, while the old code freed it in
`rtw_unregister_hw()`. However, since `ieee80211_unregister_hw()` is
called before the device is destroyed, and that function removes the
wiphy, the bands won't be accessed after the devm memory is freed. This
ordering is safe.
### User Impact
The rtw88 driver covers commonly used Realtek WiFi chips found in many
laptops. Memory leaks during driver initialization failures could
accumulate, especially for USB-based variants where plug/unplug cycles
are common. This is a real-world issue.
### Dependency Check
This commit appears self-contained. `devm_kmemdup()` has been available
in the kernel for a long time. The function signature changes are all
internal to `main.c`. No other patches are needed.
### Conclusion
This commit fixes a genuine memory leak in a widely-used WiFi driver.
The fix is small, well-understood, uses standard kernel APIs, and has
been reviewed/acked by the subsystem maintainer. The pattern was already
proven in the rtw89 driver. It meets all stable kernel criteria.
**YES**
drivers/net/wireless/realtek/rtw88/main.c | 19 ++++++-------------
1 file changed, 6 insertions(+), 13 deletions(-)
diff --git a/drivers/net/wireless/realtek/rtw88/main.c b/drivers/net/wireless/realtek/rtw88/main.c
index 361ce0d40956d..2004d714530a3 100644
--- a/drivers/net/wireless/realtek/rtw88/main.c
+++ b/drivers/net/wireless/realtek/rtw88/main.c
@@ -1661,11 +1661,13 @@ static u16 rtw_get_max_scan_ie_len(struct rtw_dev *rtwdev)
static void rtw_set_supported_band(struct ieee80211_hw *hw,
const struct rtw_chip_info *chip)
{
- struct rtw_dev *rtwdev = hw->priv;
struct ieee80211_supported_band *sband;
+ struct rtw_dev *rtwdev = hw->priv;
+ struct device *dev = rtwdev->dev;
if (chip->band & RTW_BAND_2G) {
- sband = kmemdup(&rtw_band_2ghz, sizeof(*sband), GFP_KERNEL);
+ sband = devm_kmemdup(dev, &rtw_band_2ghz, sizeof(*sband),
+ GFP_KERNEL);
if (!sband)
goto err_out;
if (chip->ht_supported)
@@ -1674,7 +1676,8 @@ static void rtw_set_supported_band(struct ieee80211_hw *hw,
}
if (chip->band & RTW_BAND_5G) {
- sband = kmemdup(&rtw_band_5ghz, sizeof(*sband), GFP_KERNEL);
+ sband = devm_kmemdup(dev, &rtw_band_5ghz, sizeof(*sband),
+ GFP_KERNEL);
if (!sband)
goto err_out;
if (chip->ht_supported)
@@ -1690,13 +1693,6 @@ static void rtw_set_supported_band(struct ieee80211_hw *hw,
rtw_err(rtwdev, "failed to set supported band\n");
}
-static void rtw_unset_supported_band(struct ieee80211_hw *hw,
- const struct rtw_chip_info *chip)
-{
- kfree(hw->wiphy->bands[NL80211_BAND_2GHZ]);
- kfree(hw->wiphy->bands[NL80211_BAND_5GHZ]);
-}
-
static void rtw_vif_smps_iter(void *data, u8 *mac,
struct ieee80211_vif *vif)
{
@@ -2320,10 +2316,7 @@ EXPORT_SYMBOL(rtw_register_hw);
void rtw_unregister_hw(struct rtw_dev *rtwdev, struct ieee80211_hw *hw)
{
- const struct rtw_chip_info *chip = rtwdev->chip;
-
ieee80211_unregister_hw(hw);
- rtw_unset_supported_band(hw, chip);
rtw_debugfs_deinit(rtwdev);
rtw_led_deinit(rtwdev);
}
--
2.51.0
^ permalink raw reply related [flat|nested] 33+ messages in thread
* [PATCH AUTOSEL 6.19-5.10] wifi: libertas: fix WARNING in usb_tx_block
2026-02-14 21:22 [PATCH AUTOSEL 6.19-6.12] wifi: rtw89: ser: enable error IMR after recovering from L1 Sasha Levin
` (27 preceding siblings ...)
2026-02-14 21:23 ` [PATCH AUTOSEL 6.19-6.12] wifi: rtw88: Use devm_kmemdup() in rtw_set_supported_band() Sasha Levin
@ 2026-02-14 21:23 ` Sasha Levin
2026-02-14 21:23 ` [PATCH AUTOSEL 6.19-6.18] wifi: rtw89: pci: validate release report content before using for RTL8922DE Sasha Levin
` (2 subsequent siblings)
31 siblings, 0 replies; 33+ messages in thread
From: Sasha Levin @ 2026-02-14 21:23 UTC (permalink / raw)
To: patches, stable
Cc: Szymon Wilczek, syzbot+67969ab6a2551c27f71b, Johannes Berg,
Sasha Levin, neil.armstrong, mingo, tglx, yelangyan,
linux-wireless, libertas-dev
From: Szymon Wilczek <swilczek.lx@gmail.com>
[ Upstream commit d66676e6ca96bf8680f869a9bd6573b26c634622 ]
The function usb_tx_block() submits cardp->tx_urb without ensuring that
any previous transmission on this URB has completed. If a second call
occurs while the URB is still active (e.g. during rapid firmware loading),
usb_submit_urb() detects the active state and triggers a warning:
'URB submitted while active'.
Fix this by enforcing serialization: call usb_kill_urb() before
submitting the new request. This ensures the URB is idle and safe to reuse.
Reported-by: syzbot+67969ab6a2551c27f71b@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=67969ab6a2551c27f71b
Signed-off-by: Szymon Wilczek <swilczek.lx@gmail.com>
Link: https://patch.msgid.link/20251221155806.23925-1-swilczek.lx@gmail.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
LLM Generated explanations, may be completely bogus:
## Analysis of commit: wifi: libertas: fix WARNING in usb_tx_block
### 1. COMMIT MESSAGE ANALYSIS
The commit message is clear and well-structured:
- **Subject**: Explicitly says "fix WARNING" — this is a bug fix
- **Problem**: `usb_tx_block()` submits `cardp->tx_urb` without ensuring
the previous transmission completed. If called rapidly (e.g., during
firmware loading), the URB is still active and `usb_submit_urb()`
triggers a WARNING: "URB submitted while active"
- **Solution**: Add `usb_kill_urb()` before submitting to ensure the URB
is idle
- **Reported-by syzbot**: This is a fuzzer-found, reproducible bug with
a concrete trigger
### 2. CODE CHANGE ANALYSIS
The change is minimal — a single line addition:
```c
+ usb_kill_urb(cardp->tx_urb);
```
Added right before `usb_fill_bulk_urb()` and `usb_submit_urb()`. This
ensures the URB is in an idle state before being reused.
- `usb_kill_urb()` is the standard kernel API for cancelling a pending
URB and waiting for its completion. It is safe to call on an already-
idle URB (it's a no-op in that case).
- The fix is placed after the `surprise_removed` check but before the
URB fill/submit, which is the correct location.
### 3. BUG CLASSIFICATION
This is a **race condition / incorrect URB lifecycle management** bug.
The URB can be submitted while still active from a previous call, which:
- Triggers a kernel WARNING (stack trace in dmesg)
- Could potentially lead to undefined behavior in the USB subsystem if
the URB state is corrupted
- Is a real correctness issue, not just a cosmetic warning
### 4. SYZBOT INDICATOR
The bug was found by syzbot, which means:
- It is **reproducible** with a concrete trigger
- It is **reachable from userspace** (syzbot exercises syscall paths)
- The syzkaller link confirms this is a documented, verified bug
### 5. SCOPE AND RISK ASSESSMENT
- **Lines changed**: 2 (one blank line + one `usb_kill_urb()` call)
- **Files changed**: 1
(`drivers/net/wireless/marvell/libertas/if_usb.c`)
- **Risk**: Very low. `usb_kill_urb()` is a well-understood, safe API.
Calling it on an idle URB is a no-op. The only effect is ensuring
serialization of URB submissions.
- **Regression potential**: Minimal. The worst case is a slight
performance overhead from the synchronous kill call, but this is in a
firmware loading path, not a hot data path.
### 6. STABLE CRITERIA CHECK
| Criterion | Met? |
|-----------|------|
| Obviously correct and tested | Yes — standard pattern, syzbot-verified
|
| Fixes a real bug | Yes — WARNING + potential URB corruption |
| Fixes an important issue | Yes — kernel WARNING, USB subsystem
correctness |
| Small and contained | Yes — 1 line in 1 file |
| No new features | Correct — pure bug fix |
| Applies cleanly | Very likely — minimal context dependencies |
### 7. USER IMPACT
The libertas driver is used with Marvell wireless USB adapters. While
not the most commonly used driver, users with this hardware would
experience:
- Kernel WARNING messages in dmesg during firmware loading
- Potential instability in the USB subsystem
- The bug is triggered during rapid firmware loading, which is a normal
operation
### 8. DEPENDENCY CHECK
This is a standalone fix with no dependencies on other commits. The
`usb_kill_urb()` API has been available for many kernel versions. The
function `usb_tx_block()` and the `if_usb_card` structure with `tx_urb`
have been stable for a long time.
### CONCLUSION
This is a textbook stable backport candidate:
- Syzbot-reported, reproducible bug
- Tiny, surgical fix (1 line)
- Uses well-established kernel API (`usb_kill_urb`)
- Fixes a real correctness issue (URB submitted while active)
- Zero risk of regression
- No dependencies on other commits
**YES**
drivers/net/wireless/marvell/libertas/if_usb.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/net/wireless/marvell/libertas/if_usb.c b/drivers/net/wireless/marvell/libertas/if_usb.c
index b3c4040257a67..924ab93b7b671 100644
--- a/drivers/net/wireless/marvell/libertas/if_usb.c
+++ b/drivers/net/wireless/marvell/libertas/if_usb.c
@@ -426,6 +426,8 @@ static int usb_tx_block(struct if_usb_card *cardp, uint8_t *payload, uint16_t nb
goto tx_ret;
}
+ usb_kill_urb(cardp->tx_urb);
+
usb_fill_bulk_urb(cardp->tx_urb, cardp->udev,
usb_sndbulkpipe(cardp->udev,
cardp->ep_out),
--
2.51.0
^ permalink raw reply related [flat|nested] 33+ messages in thread
* [PATCH AUTOSEL 6.19-6.18] wifi: rtw89: pci: validate release report content before using for RTL8922DE
2026-02-14 21:22 [PATCH AUTOSEL 6.19-6.12] wifi: rtw89: ser: enable error IMR after recovering from L1 Sasha Levin
` (28 preceding siblings ...)
2026-02-14 21:23 ` [PATCH AUTOSEL 6.19-5.10] wifi: libertas: fix WARNING in usb_tx_block Sasha Levin
@ 2026-02-14 21:23 ` Sasha Levin
2026-02-14 21:23 ` [PATCH AUTOSEL 6.19-6.12] wifi: rtw89: 8922a: set random mac if efuse contains zeroes Sasha Levin
2026-02-14 21:23 ` [PATCH AUTOSEL 6.19-6.18] wifi: rtw89: fix potential zero beacon interval in beacon tracking Sasha Levin
31 siblings, 0 replies; 33+ messages in thread
From: Sasha Levin @ 2026-02-14 21:23 UTC (permalink / raw)
To: patches, stable; +Cc: Ping-Ke Shih, Sasha Levin, linux-wireless
From: Ping-Ke Shih <pkshih@realtek.com>
[ Upstream commit 5f93d611b33a05bd03d6843c8efe8cb6a1992620 ]
The commit 957eda596c76
("wifi: rtw89: pci: validate sequence number of TX release report")
does validation on existing chips, which somehow a release report of SKB
becomes malformed. As no clear cause found, add rules ahead for RTL8922DE
to avoid crash if it happens.
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://patch.msgid.link/20260123013957.16418-11-pkshih@realtek.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
LLM Generated explanations, may be completely bogus:
### Detailed Code Change Analysis
The change modifies the `rtw89_pci_release_rpp()` function in two ways:
**OLD code:**
```c
if (unlikely(rpp_info.txch == RTW89_TXCH_CH12)) {
rtw89_warn(rtwdev, "should no fwcmd release report\n");
return;
}
```
**NEW code:**
```c
if (unlikely(rpp_info.txch >= RTW89_TXCH_NUM ||
info->tx_dma_ch_mask & BIT(rpp_info.txch))) {
rtw89_warn(rtwdev, "should no release report on txch %d\n",
rpp_info.txch);
return;
}
```
**What changed and why it matters:**
1. **Bounds check strengthened**: The old check only rejected `txch ==
RTW89_TXCH_CH12` (value 12). The new check rejects `txch >=
RTW89_TXCH_NUM` (value >= 13), which catches **out-of-bounds array
access** when `rpp_info.txch` is used as an index into
`rtwpci->tx.rings[]` (which has `RTW89_TXCH_NUM` = 13 elements).
Without this check, a malformed report with `txch >= 13` would cause
an **out-of-bounds array access**, potentially leading to a crash.
2. **Masked channel check added**: The new code also checks
`info->tx_dma_ch_mask & BIT(rpp_info.txch)`, which rejects release
reports for TX channels that are disabled/masked on the specific
hardware. Accessing a ring for a masked channel could reference
uninitialized data since those rings are not set up during
initialization (as confirmed by the `tx_dma_ch_mask` being used to
skip ring initialization).
3. **The old CH12 check is subsumed**: RTW89_TXCH_CH12 = 12 is the
firmware command channel. For chips like RTL8922DE, `tx_dma_ch_mask`
includes `BIT(RTW89_TXCH_CH12)` (since FW CMD channel is typically
masked), so the old specific check is generalized into the broader
mask-based check.
### 3. CLASSIFICATION
This is a **bug fix** — specifically a crash prevention fix through
input validation. It:
- Prevents out-of-bounds array access (txch >= RTW89_TXCH_NUM)
- Prevents access to uninitialized TX rings (masked channels)
- The commit message explicitly says "to avoid crash if it happens"
- This extends existing validation (from commit 957eda596c76) to cover
additional edge cases for RTL8922DE
### 4. SCOPE AND RISK ASSESSMENT
- **Lines changed**: ~6 lines modified in a single function
- **Files touched**: 1 file (`drivers/net/wireless/realtek/rtw89/pci.c`)
- **Risk**: Very low. The change only adds/strengthens a bounds check
and an already-masked-channel check. It's purely defensive — it only
triggers on malformed data and returns early with a warning.
- **Subsystem**: WiFi driver (rtw89), well-maintained by Realtek
engineers
- **The old behavior (CH12 check) is subsumed**, not removed — it's
generalized
### 5. USER IMPACT
- **Who is affected**: Users with RTL8922DE WiFi adapters (and
potentially other Realtek WiFi chips using the rtw89 driver)
- **Severity if triggered**: Kernel crash (NULL pointer dereference or
out-of-bounds access) — this is HIGH severity
- **Likelihood**: The referenced commit 957eda596c76 was created because
this actually happened with malformed release reports — the cause was
unclear but the crash was real
- **Author**: Ping-Ke Shih from Realtek, the driver maintainer — high
trust
### 6. STABILITY INDICATORS
- The commit comes from the rtw89 maintainer at Realtek
- It follows the pattern of an earlier validated fix (957eda596c76)
- Small, surgical change with clear defensive purpose
### 7. DEPENDENCY CHECK
- This commit depends on `957eda596c76` being present (which added the
initial validation framework including the `rpp_info.seq >=
RTW89_PCI_TXWD_NUM_MAX` check that remains unchanged)
- It also depends on the `tx_dma_ch_mask` field existing in `struct
rtw89_pci_info` and the `parse_rpp` callback mechanism
- The RTL8922DE support needs to exist in the target stable tree
### Summary
This is a small, surgical crash prevention fix that strengthens input
validation for malformed TX release reports in the rtw89 WiFi driver. It
prevents:
1. **Out-of-bounds array access** when `txch >= RTW89_TXCH_NUM` (13)
2. **Access to uninitialized/disabled TX rings** when the channel is
masked
The fix is:
- Obviously correct (bounds check + mask check before array indexing)
- Small and contained (6 lines in one function, one file)
- Fixes a real crash scenario (explicitly stated, and mirrors existing
fix for other chips)
- Written by the driver maintainer at Realtek
- Very low regression risk (only affects error/malformed paths)
The only concern is whether the RTL8922DE support and the prerequisite
commit exist in the target stable tree. If the RTL8922DE driver and the
`tx_dma_ch_mask` infrastructure are present, this is straightforward to
backport.
**YES**
drivers/net/wireless/realtek/rtw89/pci.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/net/wireless/realtek/rtw89/pci.c b/drivers/net/wireless/realtek/rtw89/pci.c
index 093960d7279f8..b8135cf15d13c 100644
--- a/drivers/net/wireless/realtek/rtw89/pci.c
+++ b/drivers/net/wireless/realtek/rtw89/pci.c
@@ -604,8 +604,10 @@ static void rtw89_pci_release_rpp(struct rtw89_dev *rtwdev, void *rpp)
info->parse_rpp(rtwdev, rpp, &rpp_info);
- if (unlikely(rpp_info.txch == RTW89_TXCH_CH12)) {
- rtw89_warn(rtwdev, "should no fwcmd release report\n");
+ if (unlikely(rpp_info.txch >= RTW89_TXCH_NUM ||
+ info->tx_dma_ch_mask & BIT(rpp_info.txch))) {
+ rtw89_warn(rtwdev, "should no release report on txch %d\n",
+ rpp_info.txch);
return;
}
--
2.51.0
^ permalink raw reply related [flat|nested] 33+ messages in thread
* [PATCH AUTOSEL 6.19-6.12] wifi: rtw89: 8922a: set random mac if efuse contains zeroes
2026-02-14 21:22 [PATCH AUTOSEL 6.19-6.12] wifi: rtw89: ser: enable error IMR after recovering from L1 Sasha Levin
` (29 preceding siblings ...)
2026-02-14 21:23 ` [PATCH AUTOSEL 6.19-6.18] wifi: rtw89: pci: validate release report content before using for RTL8922DE Sasha Levin
@ 2026-02-14 21:23 ` Sasha Levin
2026-02-14 21:23 ` [PATCH AUTOSEL 6.19-6.18] wifi: rtw89: fix potential zero beacon interval in beacon tracking Sasha Levin
31 siblings, 0 replies; 33+ messages in thread
From: Sasha Levin @ 2026-02-14 21:23 UTC (permalink / raw)
To: patches, stable
Cc: Jose Ignacio Tornos Martinez, Ping-Ke Shih, Sasha Levin,
linux-wireless
From: Jose Ignacio Tornos Martinez <jtornosm@redhat.com>
[ Upstream commit 41be33d3efc120f6a2c02d12742655f2aa09e1b6 ]
I have some rtl8922ae devices with no permanent mac stored in efuse.
It could be properly saved and/or configured from user tools like
NetworkManager, but it would be desirable to be able to initialize it
somehow to get the device working by default.
So, in the same way as with other devices, if the mac address read from
efuse contains zeros, a random mac address is assigned to at least allow
operation, and the user is warned about this in case any action needs to
be considered.
Signed-off-by: Jose Ignacio Tornos Martinez <jtornosm@redhat.com>
Acked-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://patch.msgid.link/20251126091905.217951-1-jtornosm@redhat.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
LLM Generated explanations, may be completely bogus:
The rtw8922a driver was first included in kernel v6.8. This means it's
available in stable trees 6.8.y and later (and likely in 6.6.y LTS if it
was backported, but probably not).
### 8. OVERALL ASSESSMENT
**Arguments FOR backporting (YES):**
- Fixes a real hardware issue — devices with empty efuse are completely
unusable without this
- Very small, contained change in a single file
- Well-established pattern used in rtw88 driver and other Realtek
wireless drivers
- Low risk — only affects devices with all-zero MAC (no impact on
working devices)
- Acked by subsystem maintainer
- Falls under "hardware quirk/workaround" category which is acceptable
for stable
**Arguments AGAINST backporting (NO):**
- This is technically adding new functionality (random MAC generation)
rather than fixing a bug in existing code
- The driver was working "as designed" — it just didn't handle the case
of unprogrammed efuse
- It's not fixing a crash, corruption, or security issue — it's making
broken hardware work
- The commit message describes this as a "desirable" improvement rather
than a critical fix
- No Fixes: tag or Cc: stable (expected, but also suggests the author
didn't consider it critical)
### DECISION
This is a borderline case. While the change is small and low-risk, it's
fundamentally adding new behavior (random MAC assignment) rather than
fixing a bug in existing code. The device doesn't crash without this —
it simply doesn't have a valid MAC address. This is closer to a
"hardware enablement" change than a bug fix.
However, I lean toward YES because:
1. It's a hardware workaround for broken/unprogrammed devices — this
category is explicitly allowed in stable
2. Without it, the device is completely non-functional (a zero MAC
address is invalid)
3. The risk is essentially zero for existing users
4. The pattern is proven across the Realtek driver family
5. It's a small, self-contained change
**YES**
drivers/net/wireless/realtek/rtw89/rtw8922a.c | 22 +++++++++++++++----
1 file changed, 18 insertions(+), 4 deletions(-)
diff --git a/drivers/net/wireless/realtek/rtw89/rtw8922a.c b/drivers/net/wireless/realtek/rtw89/rtw8922a.c
index 4437279c554b0..4bcf20612a455 100644
--- a/drivers/net/wireless/realtek/rtw89/rtw8922a.c
+++ b/drivers/net/wireless/realtek/rtw89/rtw8922a.c
@@ -636,16 +636,30 @@ static int rtw8922a_read_efuse_rf(struct rtw89_dev *rtwdev, u8 *log_map)
static int rtw8922a_read_efuse(struct rtw89_dev *rtwdev, u8 *log_map,
enum rtw89_efuse_block block)
{
+ struct rtw89_efuse *efuse = &rtwdev->efuse;
+ int ret;
+
switch (block) {
case RTW89_EFUSE_BLOCK_HCI_DIG_PCIE_SDIO:
- return rtw8922a_read_efuse_pci_sdio(rtwdev, log_map);
+ ret = rtw8922a_read_efuse_pci_sdio(rtwdev, log_map);
+ break;
case RTW89_EFUSE_BLOCK_HCI_DIG_USB:
- return rtw8922a_read_efuse_usb(rtwdev, log_map);
+ ret = rtw8922a_read_efuse_usb(rtwdev, log_map);
+ break;
case RTW89_EFUSE_BLOCK_RF:
- return rtw8922a_read_efuse_rf(rtwdev, log_map);
+ ret = rtw8922a_read_efuse_rf(rtwdev, log_map);
+ break;
default:
- return 0;
+ ret = 0;
+ break;
+ }
+
+ if (!ret && is_zero_ether_addr(efuse->addr)) {
+ rtw89_info(rtwdev, "efuse mac address is zero, using random mac\n");
+ eth_random_addr(efuse->addr);
}
+
+ return ret;
}
#define THM_TRIM_POSITIVE_MASK BIT(6)
--
2.51.0
^ permalink raw reply related [flat|nested] 33+ messages in thread
* [PATCH AUTOSEL 6.19-6.18] wifi: rtw89: fix potential zero beacon interval in beacon tracking
2026-02-14 21:22 [PATCH AUTOSEL 6.19-6.12] wifi: rtw89: ser: enable error IMR after recovering from L1 Sasha Levin
` (30 preceding siblings ...)
2026-02-14 21:23 ` [PATCH AUTOSEL 6.19-6.12] wifi: rtw89: 8922a: set random mac if efuse contains zeroes Sasha Levin
@ 2026-02-14 21:23 ` Sasha Levin
31 siblings, 0 replies; 33+ messages in thread
From: Sasha Levin @ 2026-02-14 21:23 UTC (permalink / raw)
To: patches, stable
Cc: Kuan-Chung Chen, Ping-Ke Shih, Sasha Levin, linux-wireless
From: Kuan-Chung Chen <damon.chen@realtek.com>
[ Upstream commit eb57be32f438c57c88d6ce756101c1dfbcc03bba ]
During fuzz testing, it was discovered that bss_conf->beacon_int
might be zero, which could result in a division by zero error in
subsequent calculations. Set a default value of 100 TU if the
interval is zero to ensure stability.
Signed-off-by: Kuan-Chung Chen <damon.chen@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://patch.msgid.link/20251231090647.56407-11-pkshih@realtek.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
LLM Generated explanations, may be completely bogus:
## Analysis of commit: "wifi: rtw89: fix potential zero beacon interval
in beacon tracking"
### 1. COMMIT MESSAGE ANALYSIS
The subject line explicitly says "fix" and describes a concrete bug:
**division by zero** when `beacon_int` is zero. The commit message
mentions this was found during **fuzz testing**, which is analogous to
syzbot/syzkaller findings — these are reproducible, real bugs. The
author is from Realtek (the hardware vendor), and the commit was signed
off by the subsystem maintainer (Ping-Ke Shih).
### 2. CODE CHANGE ANALYSIS
The patch makes two related changes:
**Change 1: `rtw89_core_bcn_track_assoc()`**
```c
- beacon_int = bss_conf->beacon_int;
+ beacon_int = bss_conf->beacon_int ?: 100;
```
This uses the GCC ternary shorthand to default to 100 TU if `beacon_int`
is zero. The value 100 TU is a reasonable default (standard beacon
interval). Without this, `beacon_int = 0` flows into:
- `beacons_in_period = period / beacon_int / dtim;` — **division by
zero**
- `bcn_intvl_us = ieee80211_tu_to_usec(beacon_int);` which becomes 0,
leading to another division by zero later in `rtw89_vif_rx_bcn_stat()`
**Change 2: `rtw89_vif_rx_bcn_stat()` refactored**
- The function signature drops the `bss_conf` parameter and instead
reads `beacon_int` from `bcn_track->beacon_int` (which was already set
with the safe default in the assoc function).
- Adds an explicit guard: `if (!bcn_intvl_us) return;` to handle the
case where association hasn't happened yet.
- This prevents `div_u64_rem(tsf - append, bcn_intvl_us, ...)` from
dividing by zero.
**Change 3: Call site update**
```c
- rtw89_vif_rx_bcn_stat(rtwdev, bss_conf, skb);
+ rtw89_vif_rx_bcn_stat(rtwdev, skb);
```
Simply adapts the caller to the new signature.
### 3. BUG CLASSIFICATION
This is a **division by zero** bug — a crash/panic-class issue. On most
kernel configurations, division by zero causes an **Oops or kernel
panic**. This is clearly a real bug that affects system stability.
The bug was found through fuzz testing, meaning there is a concrete
trigger path. While the exact fuzz scenario may be unusual in normal
operation, the `bss_conf->beacon_int` being zero is a real possibility
(malformed beacon frames, race conditions during association, etc.).
### 4. SCOPE AND RISK ASSESSMENT
- **Lines changed**: ~15 lines of actual logic change — very small and
surgical
- **Files changed**: 1 file
(`drivers/net/wireless/realtek/rtw89/core.c`)
- **Subsystem**: WiFi driver (rtw89) — contained to one driver
- **Risk**: Very low. The changes are:
- A defensive default value (100 TU is standard)
- A guard check for zero before division
- Using already-stored `bcn_track->beacon_int` instead of re-reading
from `bss_conf`
- **Regression potential**: Minimal. The only behavioral change is
preventing a crash and using a sensible default.
### 5. USER IMPACT
The rtw89 driver supports Realtek WiFi chips (RTL8852A, RTL8852B,
RTL8852C, RTL8922A, etc.) which are widely used in modern laptops and
desktops. A kernel crash/panic from a division by zero would be severe
for any user of these chips. Even if the trigger requires unusual beacon
conditions, malicious actors could potentially craft beacon frames to
trigger this remotely.
### 6. STABLE CRITERIA CHECK
- **Obviously correct and tested**: Yes — simple defensive coding, from
the hardware vendor
- **Fixes a real bug**: Yes — division by zero causing kernel crash
- **Important issue**: Yes — kernel crash/panic
- **Small and contained**: Yes — ~15 lines in one file
- **No new features**: Correct — purely a bug fix
- **No new APIs**: Correct
### 7. DEPENDENCY CHECK
The `rtw89_vif_rx_bcn_stat()` function signature change means the patch
needs to apply as a unit, but it's self-contained within this single
commit. The beacon tracking infrastructure (`bcn_track`) must exist in
the stable tree. This was added relatively recently, so it may only
apply to very recent stable branches. However, if the code exists, this
fix applies cleanly.
### 8. CONCLUSION
This is a clear-cut bug fix: it prevents a division-by-zero kernel crash
in a widely-used WiFi driver. The fix is small, surgical, obviously
correct, and comes from the hardware vendor. It meets all stable kernel
criteria.
**YES**
drivers/net/wireless/realtek/rtw89/core.c | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/drivers/net/wireless/realtek/rtw89/core.c b/drivers/net/wireless/realtek/rtw89/core.c
index 0824940c91aee..d5b492ea76ef4 100644
--- a/drivers/net/wireless/realtek/rtw89/core.c
+++ b/drivers/net/wireless/realtek/rtw89/core.c
@@ -2785,7 +2785,7 @@ static void rtw89_core_bcn_track_assoc(struct rtw89_dev *rtwdev,
rcu_read_lock();
bss_conf = rtw89_vif_rcu_dereference_link(rtwvif_link, true);
- beacon_int = bss_conf->beacon_int;
+ beacon_int = bss_conf->beacon_int ?: 100;
dtim = bss_conf->dtim_period;
rcu_read_unlock();
@@ -2815,9 +2815,7 @@ static void rtw89_core_bcn_track_reset(struct rtw89_dev *rtwdev)
memset(&rtwdev->bcn_track, 0, sizeof(rtwdev->bcn_track));
}
-static void rtw89_vif_rx_bcn_stat(struct rtw89_dev *rtwdev,
- struct ieee80211_bss_conf *bss_conf,
- struct sk_buff *skb)
+static void rtw89_vif_rx_bcn_stat(struct rtw89_dev *rtwdev, struct sk_buff *skb)
{
#define RTW89_APPEND_TSF_2GHZ 384
#define RTW89_APPEND_TSF_5GHZ 52
@@ -2826,7 +2824,7 @@ static void rtw89_vif_rx_bcn_stat(struct rtw89_dev *rtwdev,
struct ieee80211_rx_status *rx_status = IEEE80211_SKB_RXCB(skb);
struct rtw89_beacon_stat *bcn_stat = &rtwdev->phystat.bcn_stat;
struct rtw89_beacon_track_info *bcn_track = &rtwdev->bcn_track;
- u32 bcn_intvl_us = ieee80211_tu_to_usec(bss_conf->beacon_int);
+ u32 bcn_intvl_us = ieee80211_tu_to_usec(bcn_track->beacon_int);
u64 tsf = le64_to_cpu(mgmt->u.beacon.timestamp);
u8 wp, num = bcn_stat->num;
u16 append;
@@ -2834,6 +2832,10 @@ static void rtw89_vif_rx_bcn_stat(struct rtw89_dev *rtwdev,
if (!RTW89_CHK_FW_FEATURE(BEACON_TRACKING, &rtwdev->fw))
return;
+ /* Skip if not yet associated */
+ if (!bcn_intvl_us)
+ return;
+
switch (rx_status->band) {
default:
case NL80211_BAND_2GHZ:
@@ -2921,7 +2923,7 @@ static void rtw89_vif_rx_stats_iter(void *data, u8 *mac,
pkt_stat->beacon_rate = desc_info->data_rate;
pkt_stat->beacon_len = skb->len;
- rtw89_vif_rx_bcn_stat(rtwdev, bss_conf, skb);
+ rtw89_vif_rx_bcn_stat(rtwdev, skb);
}
if (!ether_addr_equal(bss_conf->addr, hdr->addr1))
--
2.51.0
^ permalink raw reply related [flat|nested] 33+ messages in thread
end of thread, other threads:[~2026-02-14 21:27 UTC | newest]
Thread overview: 33+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-14 21:22 [PATCH AUTOSEL 6.19-6.12] wifi: rtw89: ser: enable error IMR after recovering from L1 Sasha Levin
2026-02-14 21:22 ` [PATCH AUTOSEL 6.19-6.12] wifi: ath11k: Fix failure to connect to a 6 GHz AP Sasha Levin
2026-02-14 21:22 ` [PATCH AUTOSEL 6.19-6.1] wifi: rtw88: 8822b: Avoid WARNING in rtw8822b_config_trx_mode() Sasha Levin
2026-02-14 21:22 ` [PATCH AUTOSEL 6.19-6.12] wifi: rtw89: 8922a: add digital compensation for 2GHz Sasha Levin
2026-02-14 21:22 ` [PATCH AUTOSEL 6.19-6.18] wifi: rtw89: pci: validate sequence number of TX release report Sasha Levin
2026-02-14 21:22 ` [PATCH AUTOSEL 6.19-5.10] wifi: iwlegacy: add missing mutex protection in il4965_store_tx_power() Sasha Levin
2026-02-14 21:22 ` [PATCH AUTOSEL 6.19-6.6] wifi: rtw88: rtw8821cu: Add ID for Mercusys MU6H Sasha Levin
2026-02-14 21:22 ` [PATCH AUTOSEL 6.19-6.18] wifi: rtw89: Add support for MSI AX1800 Nano (GUAX18N) Sasha Levin
2026-02-14 21:22 ` [PATCH AUTOSEL 6.19-6.18] wifi: rtw89: mcc: reset probe counter when receiving beacon Sasha Levin
2026-02-14 21:22 ` [PATCH AUTOSEL 6.19-6.18] wifi: rtw89: setting TBTT AGG number when mac port initialization Sasha Levin
2026-02-14 21:22 ` [PATCH AUTOSEL 6.19-6.18] wifi: rtw89: disable EHT protocol by chip capabilities Sasha Levin
2026-02-14 21:22 ` [PATCH AUTOSEL 6.19-5.10] wifi: ath10k: fix lock protection in ath10k_wmi_event_peer_sta_ps_state_chg() Sasha Levin
2026-02-14 21:22 ` [PATCH AUTOSEL 6.19-6.12] wifi: cfg80211: allow only one NAN interface, also in multi radio Sasha Levin
2026-02-14 21:22 ` [PATCH AUTOSEL 6.19-6.6] wifi: ath12k: fix preferred hardware mode calculation Sasha Levin
2026-02-14 21:22 ` [PATCH AUTOSEL 6.19-6.1] wifi: rtw88: fix DTIM period handling when conf->dtim_period is zero Sasha Levin
2026-02-14 21:22 ` [PATCH AUTOSEL 6.19-6.12] wifi: rtw89: mac: correct page number for CSI response Sasha Levin
2026-02-14 21:23 ` [PATCH AUTOSEL 6.19-6.12] wifi: rtw88: Fix inadvertent sharing of struct ieee80211_supported_band data Sasha Levin
2026-02-14 21:23 ` [PATCH AUTOSEL 6.19] wifi: rtw89: 8852au: add support for TP TX30U Plus Sasha Levin
2026-02-14 21:23 ` [PATCH AUTOSEL 6.19-6.6] wifi: ath11k: add pm quirk for Thinkpad Z13/Z16 Gen1 Sasha Levin
2026-02-14 21:23 ` [PATCH AUTOSEL 6.19] wifi: rtw89: Add default ID 28de:2432 for RTL8832CU Sasha Levin
2026-02-14 21:23 ` [PATCH AUTOSEL 6.19-6.18] wifi: ath12k: fix mac phy capability parsing Sasha Levin
2026-02-14 21:23 ` [PATCH AUTOSEL 6.19-6.1] wifi: rtw89: pci: restore LDO setting after device resume Sasha Levin
2026-02-14 21:23 ` [PATCH AUTOSEL 6.19-5.10] wifi: iwlegacy: add missing mutex protection in il3945_store_measurement() Sasha Levin
2026-02-14 21:23 ` [PATCH AUTOSEL 6.19] wifi: rtw89: Add support for D-Link VR Air Bridge (DWA-F18) Sasha Levin
2026-02-14 21:23 ` [PATCH AUTOSEL 6.19-6.6] wifi: rtw89: wow: add reason codes for disassociation in WoWLAN mode Sasha Levin
2026-02-14 21:23 ` [PATCH AUTOSEL 6.19-6.12] wifi: rtw89: fix unable to receive probe responses under MLO connection Sasha Levin
2026-02-14 21:23 ` [PATCH AUTOSEL 6.19-6.18] wifi: rtw89: regd: 6 GHz power type marks default when inactive Sasha Levin
2026-02-14 21:23 ` [PATCH AUTOSEL 6.19] wifi: cfg80211: treat deprecated INDOOR_SP_AP_OLD control value as LPI mode Sasha Levin
2026-02-14 21:23 ` [PATCH AUTOSEL 6.19-6.12] wifi: rtw88: Use devm_kmemdup() in rtw_set_supported_band() Sasha Levin
2026-02-14 21:23 ` [PATCH AUTOSEL 6.19-5.10] wifi: libertas: fix WARNING in usb_tx_block Sasha Levin
2026-02-14 21:23 ` [PATCH AUTOSEL 6.19-6.18] wifi: rtw89: pci: validate release report content before using for RTL8922DE Sasha Levin
2026-02-14 21:23 ` [PATCH AUTOSEL 6.19-6.12] wifi: rtw89: 8922a: set random mac if efuse contains zeroes Sasha Levin
2026-02-14 21:23 ` [PATCH AUTOSEL 6.19-6.18] wifi: rtw89: fix potential zero beacon interval in beacon tracking Sasha Levin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox