wifi: rtw89: 8852c: enlarge polling timeout of RX DCK
authorPing-Ke Shih <pkshih@realtek.com>
Thu, 8 Sep 2022 05:12:51 +0000 (13:12 +0800)
committerKalle Valo <kvalo@kernel.org>
Mon, 12 Sep 2022 11:52:32 +0000 (14:52 +0300)
The range of calibration time of RX DCK is quite wide from ~40us to
~1300us by experiments, and probability is about 0.1% for the cases larger
than 1000us. Though it can retry calibration and get positive result, it
will spend more time. Therefore, enlarge it to avoid warning and duplicate
calibration.

Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20220908051257.25353-4-pkshih@realtek.com
drivers/net/wireless/realtek/rtw89/reg.h
drivers/net/wireless/realtek/rtw89/rtw8852c_rfk.c

index 54cf725..893c172 100644 (file)
 #define RR_DCK_FINE BIT(1)
 #define RR_DCK_LV BIT(0)
 #define RR_DCK1 0x93
+#define RR_DCK1_DONE BIT(5)
 #define RR_DCK1_CLR GENMASK(3, 0)
 #define RR_DCK1_SEL BIT(3)
 #define RR_DCK2 0x94
index 478a36d..006c2cf 100644 (file)
@@ -1546,7 +1546,8 @@ static void _rx_dck_toggle(struct rtw89_dev *rtwdev, u8 path)
        rtw89_write_rf(rtwdev, path, RR_DCK, RR_DCK_LV, 0x1);
 
        ret = read_poll_timeout_atomic(rtw89_read_rf, val, val,
-                                      2, 1000, false, rtwdev, path, 0x93, BIT(5));
+                                      2, 2000, false, rtwdev, path,
+                                      RR_DCK1, RR_DCK1_DONE);
        if (ret)
                rtw89_warn(rtwdev, "[RX_DCK] S%d RXDCK timeout\n", path);
        else