]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
wifi: rtw88: coex: Solve LE-HID lag & update coex version to 26020420
authorChing-Te Ku <ku920601@realtek.com>
Fri, 13 Feb 2026 05:34:45 +0000 (13:34 +0800)
committerPing-Ke Shih <pkshih@realtek.com>
Tue, 3 Mar 2026 02:21:01 +0000 (10:21 +0800)
When Wi-Fi enters power save, the register value can not be read
correctly. If mechanism take the wrong information to make decision,
it will run with wrong parameters. It leads Bluetooth low-energy
HID lag. Add logic to isolate the wrong register state.

BTCOEX Version: 26020420-2020
Desired_BT_Coex_Ver: 0x20
Desired_WL_FW_Ver: 9.9.X

Signed-off-by: Ching-Te Ku <ku920601@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://patch.msgid.link/20260213053445.19384-1-pkshih@realtek.com
drivers/net/wireless/realtek/rtw88/coex.c
drivers/net/wireless/realtek/rtw88/main.h
drivers/net/wireless/realtek/rtw88/rtw8703b.c
drivers/net/wireless/realtek/rtw88/rtw8723d.c
drivers/net/wireless/realtek/rtw88/rtw8821a.c
drivers/net/wireless/realtek/rtw88/rtw8821c.c
drivers/net/wireless/realtek/rtw88/rtw8822b.c
drivers/net/wireless/realtek/rtw88/rtw8822c.c

index b4dc6ff2c175095384bc1219cb27c863ff0ece6b..ee4007fe6c189867d4791360f9684d988a5ccb6d 100644 (file)
@@ -485,6 +485,13 @@ static void rtw_coex_monitor_bt_ctr(struct rtw_dev *rtwdev)
                "[BTCoex], Hi-Pri Rx/Tx: %d/%d, Lo-Pri Rx/Tx: %d/%d\n",
                coex_stat->hi_pri_rx, coex_stat->hi_pri_tx,
                coex_stat->lo_pri_rx, coex_stat->lo_pri_tx);
+
+       if (coex_stat->wl_under_lps || coex_stat->wl_under_ips ||
+           (coex_stat->hi_pri_rx > 60000 && coex_stat->hi_pri_tx == 60000 &&
+            coex_stat->lo_pri_rx > 60000 && coex_stat->lo_pri_tx == 60000))
+               coex_stat->bt_ctr_ok = false;
+       else
+               coex_stat->bt_ctr_ok = true;
 }
 
 static void rtw_coex_monitor_bt_enable(struct rtw_dev *rtwdev)
@@ -1959,14 +1966,18 @@ static void rtw_coex_action_bt_hid(struct rtw_dev *rtwdev)
        struct rtw_coex *coex = &rtwdev->coex;
        struct rtw_coex_stat *coex_stat = &coex->stat;
        struct rtw_efuse *efuse = &rtwdev->efuse;
+       bool is_bt_ctr_hi = false, is_toggle_table = false;
        u8 table_case, tdma_case;
        u32 slot_type = 0;
-       bool bt_multi_link_remain = false, is_toggle_table = false;
 
        rtw_dbg(rtwdev, RTW_DBG_COEX, "[BTCoex], %s()\n", __func__);
        rtw_coex_set_ant_path(rtwdev, false, COEX_SET_ANT_2G);
        rtw_coex_set_rf_para(rtwdev, chip->wl_rf_para_rx[0]);
 
+       if (coex_stat->bt_ctr_ok &&
+           coex_stat->lo_pri_rx + coex_stat->lo_pri_tx > 360)
+               is_bt_ctr_hi = true;
+
        if (efuse->share_ant) {
                /* Shared-Ant */
                if (coex_stat->bt_ble_exist) {
@@ -1980,28 +1991,31 @@ static void rtw_coex_action_bt_hid(struct rtw_dev *rtwdev)
                        }
                } else {
                        /* Legacy HID  */
-                       if (coex_stat->bt_profile_num == 1 &&
-                           (coex_stat->bt_multi_link ||
-                           (coex_stat->lo_pri_rx +
-                            coex_stat->lo_pri_tx > 360) ||
-                            coex_stat->bt_slave ||
-                            bt_multi_link_remain)) {
-                               slot_type = TDMA_4SLOT;
-                               table_case = 12;
-                               tdma_case = 20;
-                       } else if (coex_stat->bt_a2dp_active) {
+                       if (coex_stat->bt_a2dp_active) {
                                table_case = 9;
                                tdma_case = 18;
+                       } else if (coex_stat->bt_profile_num == 1 &&
+                                  (coex_stat->bt_multi_link &&
+                                   (is_bt_ctr_hi || coex_stat->bt_slave ||
+                                    coex_stat->bt_multi_link_remain))) {
+                               if (coex_stat->wl_gl_busy &&
+                                   (coex_stat->wl_rx_rate <= 3 ||
+                                    coex_stat->wl_rts_rx_rate <= 3))
+                                       table_case = 13;
+                               else
+                                       table_case = 12;
+
+                               tdma_case = 26;
                        } else if (coex_stat->bt_418_hid_exist &&
                                   coex_stat->wl_gl_busy) {
                                is_toggle_table = true;
                                slot_type = TDMA_4SLOT;
-                               table_case = 9;
-                               tdma_case = 24;
+                               table_case = 32;
+                               tdma_case = 27;
                        } else if (coex_stat->bt_ble_hid_exist &&
                                   coex_stat->wl_gl_busy) {
-                               table_case = 32;
-                               tdma_case = 9;
+                               table_case = 36;
+                               tdma_case = 0;
                        } else {
                                table_case = 9;
                                tdma_case = 9;
index 1ab70214ce36eb1785a6f642b83cc30748d9ec18..1179231a672dc5b0934a99f7191ec43300f94cea 100644 (file)
@@ -1475,6 +1475,7 @@ struct rtw_coex_stat {
        bool bt_game_hid_exist;
        bool bt_hid_handle_cnt;
        bool bt_mailbox_reply;
+       bool bt_ctr_ok;
 
        bool wl_under_lps;
        bool wl_under_ips;
index 821c28d9cb5d4ffa8f445bcf61ec636742ef8b62..b5e7ae7ebd95a5f664e451772b3ec9c1f2226d37 100644 (file)
@@ -1794,6 +1794,11 @@ static const struct coex_table_para table_sant_8703b[] = {
        {0x66556aaa, 0x6a5a6aaa}, /* case-30 */
        {0xffffffff, 0x5aaa5aaa},
        {0x56555555, 0x5a5a5aaa},
+       {0xdaffdaff, 0xdaffdaff},
+       {0xddffddff, 0xddffddff},
+       {0xe5555555, 0xe5555555}, /* case-35 */
+       {0xea5a5a5a, 0xea5a5a5a},
+       {0xea6a6a6a, 0xea6a6a6a},
 };
 
 /* Shared-Antenna TDMA */
index 8715e0435f173a149874b426e500e105760bb2f9..a2b3e7a2ad99d0143cadf2e19f389c44cd23f6d1 100644 (file)
@@ -1459,6 +1459,11 @@ static const struct coex_table_para table_sant_8723d[] = {
        {0x66556aaa, 0x6a5a6aaa}, /* case-30 */
        {0xffffffff, 0x5aaa5aaa},
        {0x56555555, 0x5a5a5aaa},
+       {0xdaffdaff, 0xdaffdaff},
+       {0xddffddff, 0xddffddff},
+       {0xe5555555, 0xe5555555}, /* case-35 */
+       {0xea5a5a5a, 0xea5a5a5a},
+       {0xea6a6a6a, 0xea6a6a6a},
 };
 
 /* Non-Shared-Antenna Coex Table */
index 414b77eef07c6cd8b2d9876ac61f7a77fd95b1b7..cab85203b82884625550f5414e1a163ed92efa7d 100644 (file)
@@ -998,7 +998,12 @@ static const struct coex_table_para table_sant_8821a[] = {
        {0x66556655, 0x66556655},
        {0x66556aaa, 0x6a5a6aaa}, /* case-30 */
        {0xffffffff, 0x5aaa5aaa},
-       {0x56555555, 0x5a5a5aaa}
+       {0x56555555, 0x5a5a5aaa},
+       {0xdaffdaff, 0xdaffdaff},
+       {0xddffddff, 0xddffddff},
+       {0xe5555555, 0xe5555555}, /* case-35 */
+       {0xea5a5a5a, 0xea5a5a5a},
+       {0xea6a6a6a, 0xea6a6a6a},
 };
 
 /* Non-Shared-Antenna Coex Table */
index 2078b067562e73e8554b937f8a05ebd173afd4b3..246046da4f13c5d69149237924ce923c71175d6f 100644 (file)
@@ -1727,7 +1727,12 @@ static const struct coex_table_para table_sant_8821c[] = {
        {0x66556655, 0x66556655},
        {0x66556aaa, 0x6a5a6aaa}, /* case-30 */
        {0xffffffff, 0x5aaa5aaa},
-       {0x56555555, 0x5a5a5aaa}
+       {0x56555555, 0x5a5a5aaa},
+       {0xdaffdaff, 0xdaffdaff},
+       {0xddffddff, 0xddffddff},
+       {0xe5555555, 0xe5555555}, /* case-35 */
+       {0xea5a5a5a, 0xea5a5a5a},
+       {0xea6a6a6a, 0xea6a6a6a},
 };
 
 /* Non-Shared-Antenna Coex Table */
index 4d88cc2f4148517724d791681838be397c6a952c..e9e8a7f3f3822a1d3e0730a457120d4ae618839d 100644 (file)
@@ -2217,6 +2217,11 @@ static const struct coex_table_para table_sant_8822b[] = {
        {0x66556aaa, 0x6a5a6aaa}, /* case-30 */
        {0xffffffff, 0x5aaa5aaa},
        {0x56555555, 0x5a5a5aaa},
+       {0xdaffdaff, 0xdaffdaff},
+       {0xddffddff, 0xddffddff},
+       {0xe5555555, 0xe5555555}, /* case-35 */
+       {0xea5a5a5a, 0xea5a5a5a},
+       {0xea6a6a6a, 0xea6a6a6a},
 };
 
 /* Non-Shared-Antenna Coex Table */
index 28c121cf1e683885007563348bf83bcd84bf5d48..244c8026479c22ce734894c6fc453c81e9bc5e27 100644 (file)
@@ -5035,6 +5035,9 @@ static const struct coex_table_para table_sant_8822c[] = {
        {0x56555555, 0x5a5a5aaa},
        {0xdaffdaff, 0xdaffdaff},
        {0xddffddff, 0xddffddff},
+       {0xe5555555, 0xe5555555}, /* case-35 */
+       {0xea5a5a5a, 0xea5a5a5a},
+       {0xea6a6a6a, 0xea6a6a6a},
 };
 
 /* Non-Shared-Antenna Coex Table */
@@ -5401,7 +5404,7 @@ const struct rtw_chip_info rtw8822c_hw_spec = {
        .max_sched_scan_ssids = 4,
 #endif
        .max_scan_ie_len = (RTW_PROBE_PG_CNT - 1) * TX_PAGE_SIZE,
-       .coex_para_ver = 0x22020720,
+       .coex_para_ver = 0x26020420,
        .bt_desired_ver = 0x20,
        .scbd_support = true,
        .new_scbd10_def = true,