]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
wifi: rtw89: refine C2H reg event polling timeout for LPS
authorChih-Kang Chang <gary.chang@realtek.com>
Tue, 23 Dec 2025 03:06:48 +0000 (11:06 +0800)
committerPing-Ke Shih <pkshih@realtek.com>
Fri, 26 Dec 2025 03:01:34 +0000 (11:01 +0800)
The each of C2H reg event have different polling timeout. Refine the
LPS C2H reg event polling timeout. Otherwise, during SER, the FW has
already crashed, the leave LPS check will wait until timeout expires,
causing the SER recovery to take too long.

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-10-pkshih@realtek.com
drivers/net/wireless/realtek/rtw89/fw.c
drivers/net/wireless/realtek/rtw89/fw.h
drivers/net/wireless/realtek/rtw89/ps.c

index 4e51ffb5be21d16252605979a6d97639d800ce4c..fd49e651aeed5e2e186f096cca0fc80a30294451 100644 (file)
@@ -7053,6 +7053,9 @@ static int rtw89_fw_read_c2h_reg(struct rtw89_dev *rtwdev,
        else
                timeout = RTW89_C2H_TIMEOUT;
 
+       if (info->timeout)
+               timeout = info->timeout;
+
        ret = read_poll_timeout_atomic(rtw89_read8, val, val, 1,
                                       timeout, false, rtwdev,
                                       chip->c2h_ctrl_reg);
index cedb4a47a769cf76efa8b3e907f7d57eec36f6b3..dfae652686cddb12a57a155b3fae83b599783aed 100644 (file)
@@ -120,6 +120,7 @@ struct rtw89_h2creg_sch_tx_en {
 struct rtw89_mac_c2h_info {
        u8 id;
        u8 content_len;
+       u32 timeout;
        union {
                u32 c2hreg[RTW89_C2HREG_MAX];
                struct rtw89_c2hreg_hdr hdr;
index 3f69dd4361c36c5272d2d102fa8367e2e3b63a82..abd8aee02b4705d81681690a2f633618e9ef6cdb 100644 (file)
@@ -16,7 +16,7 @@
 
 static int rtw89_fw_receive_lps_h2c_check(struct rtw89_dev *rtwdev, u8 macid)
 {
-       struct rtw89_mac_c2h_info c2h_info = {};
+       struct rtw89_mac_c2h_info c2h_info = {.timeout = 5000};
        u16 c2hreg_macid;
        u32 c2hreg_ret;
        int ret;