From: Kuan-Chung Chen damon.chen@realtek.com
[ Upstream commit 38846585f9df9af1f7261d85134a5510fc079458 ]
In WoWLAN net-detect mode, the firmware periodically performs scans and sends scan reports via C2H, which driver does not need. These unnecessary C2H events cause firmware watchdog timeout, leading to unexpected wakeups and SER 0x2599 on 8922AE.
Signed-off-by: Kuan-Chung Chen damon.chen@realtek.com Signed-off-by: Ping-Ke Shih pkshih@realtek.com Link: https://patch.msgid.link/20250811123744.15361-4-pkshih@realtek.com Signed-off-by: Sasha Levin sashal@kernel.org ---
LLM Generated explanations, may be completely bogus:
YES
- What it fixes - In WoWLAN net-detect (PNO) mode, the driver currently enables all per-channel scan-offload notifications by setting `notify_action` to the debug mask. This causes the firmware to emit frequent C2H scan notifications that the driver doesn’t use while the host sleeps, leading to firmware watchdog timeouts, unexpected wakeups, and SER 0x2599 on 8922AE. The change removes those notifications only for the PNO (net‑detect) path.
- Specific code changes - Removes `ch_info->notify_action = RTW89_SCANOFLD_DEBUG_MASK;` in the PNO channel setup paths: - AX path: `drivers/net/wireless/realtek/rtw89/fw.c:7126` - BE path: `drivers/net/wireless/realtek/rtw89/fw.c:7267` - Leaves hardware/normal scan paths intact (these still set `notify_action` for runtime scanning, e.g. `drivers/net/wireless/realtek/rtw89/fw.c:7183`, `drivers/net/wireless/realtek/rtw89/fw.c:7309`), so normal scan behavior is unaffected.
- Why removing these lines is correct and low risk - `notify_action` is a 5‑bit field controlling per-channel scan- offload notifications (`drivers/net/wireless/realtek/rtw89/fw.h:354`, `drivers/net/wireless/realtek/rtw89/fw.h:384`), and `RTW89_SCANOFLD_DEBUG_MASK` is `0x1F` (enables all notification types) (`drivers/net/wireless/realtek/rtw89/fw.h:336`). - These fields are consumed by the H2C channel-info encoders: - AX: `le32_encode_bits(ch_info->notify_action, RTW89_H2C_CHINFO_W1_ACTION)` (`drivers/net/wireless/realtek/rtw89/fw.c:5495`) - BE: `le32_encode_bits(ch_info->notify_action, RTW89_H2C_CHINFO_BE_W1_NOTIFY)` (`drivers/net/wireless/realtek/rtw89/fw.c:5586`) - In the PNO path, `ch_info` is allocated with `kzalloc`, so with the assignment removed, `notify_action` defaults to 0 (no per-channel notifications). See `kzalloc` and subsequent call into the PNO helpers: - AX: allocation and call: `drivers/net/wireless/realtek/rtw89/fw.c:7398` - BE: allocation and call: `drivers/net/wireless/realtek/rtw89/fw.c:7609` - Net-detect scans are initiated from the WoWLAN path (e.g. `rtw89_wow_init_pno` and `rtw89_pno_scan_offload`), not from active host scanning: - Net-detect enabled log: `drivers/net/wireless/realtek/rtw89/wow.c:1071` - PNO scan offload start/stop from WoW: `drivers/net/wireless/realtek/rtw89/wow.c:1510`, `drivers/net/wireless/realtek/rtw89/wow.c:1516` - The “end of scan cycle” H2C notify bit (distinct from per-channel notify_action) remains enabled via `RTW89_H2C_SCANOFLD_W1_NOTIFY_END` for scan offload coordination (`drivers/net/wireless/realtek/rtw89/fw.c:5683`), so control flow isn’t broken. - Normal/hardware scan behavior remains unchanged since those paths still set `notify_action`, so no regression for active scans.
- Scope and stability criteria - Small and contained: Two assignments removed in a single file specifically for WoWLAN PNO paths. - No feature additions or architectural changes; limited to `rtw89` Wi‑Fi driver. - Directly addresses a user-visible bug (unexpected wakeups and firmware SER/reset on 8922AE) in a low-power feature where spurious notifications are harmful. - Aligns with stable backport rules: important bugfix, minimal risk, confined to a subsystem.
- Conclusion - This is a clear bugfix that reduces unnecessary C2H traffic during WoWLAN net-detect and prevents firmware watchdog/SER events on affected hardware. It is safe and appropriate to backport to stable kernels.
drivers/net/wireless/realtek/rtw89/fw.c | 2 -- 1 file changed, 2 deletions(-)
diff --git a/drivers/net/wireless/realtek/rtw89/fw.c b/drivers/net/wireless/realtek/rtw89/fw.c index 16e59a4a486e6..e6f8fab799fc1 100644 --- a/drivers/net/wireless/realtek/rtw89/fw.c +++ b/drivers/net/wireless/realtek/rtw89/fw.c @@ -7123,7 +7123,6 @@ static void rtw89_pno_scan_add_chan_ax(struct rtw89_dev *rtwdev, struct rtw89_pktofld_info *info; u8 probe_count = 0;
- ch_info->notify_action = RTW89_SCANOFLD_DEBUG_MASK; ch_info->dfs_ch = chan_type == RTW89_CHAN_DFS; ch_info->bw = RTW89_SCAN_WIDTH; ch_info->tx_pkt = true; @@ -7264,7 +7263,6 @@ static void rtw89_pno_scan_add_chan_be(struct rtw89_dev *rtwdev, int chan_type, struct rtw89_pktofld_info *info; u8 probe_count = 0, i;
- ch_info->notify_action = RTW89_SCANOFLD_DEBUG_MASK; ch_info->dfs_ch = chan_type == RTW89_CHAN_DFS; ch_info->bw = RTW89_SCAN_WIDTH; ch_info->tx_null = false;