Linux-Wireless Archive mirror
 help / color / mirror / Atom feed
* [PATCH 2/4] wifi: rtw88: 8821cu: Fix connection failure
       [not found] <909d9f75-44cd-4710-9d3f-56691fd58090@gmail.com>
@ 2024-02-27 12:19 ` Bitterblue Smith
  2024-02-29  3:42   ` Ping-Ke Shih
  2024-02-27 12:20 ` [PATCH 3/4] wifi: rtw88: 8821c: Fix beacon loss and disconnect Bitterblue Smith
  2024-02-27 12:20 ` [PATCH 4/4] wifi: rtw88: 8821c: Fix false alarm count Bitterblue Smith
  2 siblings, 1 reply; 10+ messages in thread
From: Bitterblue Smith @ 2024-02-27 12:19 UTC (permalink / raw
  To: linux-wireless@vger.kernel.org; +Cc: Ping-Ke Shih, Sascha Hauer

Clear bit 8 of REG_SYS_STATUS1 after MAC power on.

Without this, some RTL8821CU and RTL8811CU cannot connect to any
network:

Feb 19 13:33:11 ideapad2 kernel: wlp3s0f3u2: send auth to
	90:55:de:__:__:__ (try 1/3)
Feb 19 13:33:13 ideapad2 kernel: wlp3s0f3u2: send auth to
	90:55:de:__:__:__ (try 2/3)
Feb 19 13:33:14 ideapad2 kernel: wlp3s0f3u2: send auth to
	90:55:de:__:__:__ (try 3/3)
Feb 19 13:33:15 ideapad2 kernel: wlp3s0f3u2: authentication with
	90:55:de:__:__:__ timed out

The RTL8822CU and RTL8822BU out-of-tree drivers do this as well, so do
it for all three types of chips.

Tested with RTL8811CU (Tenda U9 V2.0).

Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>
---
 drivers/net/wireless/realtek/rtw88/mac.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/net/wireless/realtek/rtw88/mac.c b/drivers/net/wireless/realtek/rtw88/mac.c
index 298663b03580..a3b2c57c5503 100644
--- a/drivers/net/wireless/realtek/rtw88/mac.c
+++ b/drivers/net/wireless/realtek/rtw88/mac.c
@@ -309,6 +309,14 @@ static int rtw_mac_power_switch(struct rtw_dev *rtwdev, bool pwr_on)
 	pwr_seq = pwr_on ? chip->pwr_on_seq : chip->pwr_off_seq;
 	ret = rtw_pwr_seq_parser(rtwdev, pwr_seq);
 
+	if (pwr_seq == chip->pwr_on_seq &&
+	    rtw_hci_type(rtwdev) == RTW_HCI_TYPE_USB) {
+		if (chip->id == RTW_CHIP_TYPE_8822C ||
+		    chip->id == RTW_CHIP_TYPE_8822B ||
+		    chip->id == RTW_CHIP_TYPE_8821C)
+			rtw_write8_clr(rtwdev, REG_SYS_STATUS1 + 1, BIT(0));
+	}
+
 	if (rtw_hci_type(rtwdev) == RTW_HCI_TYPE_SDIO)
 		rtw_write32(rtwdev, REG_SDIO_HIMR, imr);
 
-- 
2.43.2

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 3/4] wifi: rtw88: 8821c: Fix beacon loss and disconnect
       [not found] <909d9f75-44cd-4710-9d3f-56691fd58090@gmail.com>
  2024-02-27 12:19 ` [PATCH 2/4] wifi: rtw88: 8821cu: Fix connection failure Bitterblue Smith
@ 2024-02-27 12:20 ` Bitterblue Smith
  2024-02-29  3:49   ` Ping-Ke Shih
  2024-02-27 12:20 ` [PATCH 4/4] wifi: rtw88: 8821c: Fix false alarm count Bitterblue Smith
  2 siblings, 1 reply; 10+ messages in thread
From: Bitterblue Smith @ 2024-02-27 12:20 UTC (permalink / raw
  To: linux-wireless@vger.kernel.org; +Cc: Ping-Ke Shih

Tenda U9 V2.0, which contains RTL8811CU, is practically unusable because
of frequent disconnections:

Feb 23 14:46:45 ideapad2 wpa_supplicant[427]: wlp3s0f3u2: CTRL-EVENT-BEACON-LOSS
Feb 23 14:46:46 ideapad2 wpa_supplicant[427]: wlp3s0f3u2: CTRL-EVENT-DISCONNECTED
	bssid=90:55:de:__:__:__ reason=4 locally_generated=1

Feb 23 14:46:52 ideapad2 wpa_supplicant[427]: wlp3s0f3u2: CTRL-EVENT-CONNECTED
	- Connection to 90:55:de:__:__:__ completed [id=0 id_str=]
Feb 23 14:46:54 ideapad2 wpa_supplicant[427]: wlp3s0f3u2: CTRL-EVENT-BEACON-LOSS
Feb 23 14:46:55 ideapad2 wpa_supplicant[427]: wlp3s0f3u2: CTRL-EVENT-DISCONNECTED
	bssid=90:55:de:__:__:__ reason=4 locally_generated=1

Feb 23 14:47:01 ideapad2 wpa_supplicant[427]: wlp3s0f3u2: CTRL-EVENT-CONNECTED
	- Connection to 90:55:de:__:__:__ completed [id=0 id_str=]
Feb 23 14:47:04 ideapad2 wpa_supplicant[427]: wlp3s0f3u2: CTRL-EVENT-BEACON-LOSS
Feb 23 14:47:05 ideapad2 wpa_supplicant[427]: wlp3s0f3u2: CTRL-EVENT-DISCONNECTED
	bssid=90:55:de:__:__:__ reason=4 locally_generated=1

This is caused by a mistake in the chip initialisation. This version of
the chip requires loading an extra AGC table right after the main one,
but the extra table is being loaded at the wrong time.

Move the extra AGC table loading to the right place.

Fixes: 5d6651fe8583 ("rtw88: 8821c: support RFE type2 wifi NIC")
Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>
---
 drivers/net/wireless/realtek/rtw88/main.c | 2 --
 drivers/net/wireless/realtek/rtw88/phy.c  | 3 +++
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/realtek/rtw88/main.c b/drivers/net/wireless/realtek/rtw88/main.c
index 6d22628129d0..ffba6b88f392 100644
--- a/drivers/net/wireless/realtek/rtw88/main.c
+++ b/drivers/net/wireless/realtek/rtw88/main.c
@@ -2032,8 +2032,6 @@ static int rtw_chip_board_info_setup(struct rtw_dev *rtwdev)
 	rtw_phy_setup_phy_cond(rtwdev, hal->pkg_type);
 
 	rtw_phy_init_tx_power(rtwdev);
-	if (rfe_def->agc_btg_tbl)
-		rtw_load_table(rtwdev, rfe_def->agc_btg_tbl);
 	rtw_load_table(rtwdev, rfe_def->phy_pg_tbl);
 	rtw_load_table(rtwdev, rfe_def->txpwr_lmt_tbl);
 	rtw_phy_tx_power_by_rate_config(hal);
diff --git a/drivers/net/wireless/realtek/rtw88/phy.c b/drivers/net/wireless/realtek/rtw88/phy.c
index 128e75a81bf3..37ef80c9091d 100644
--- a/drivers/net/wireless/realtek/rtw88/phy.c
+++ b/drivers/net/wireless/realtek/rtw88/phy.c
@@ -1761,12 +1761,15 @@ static void rtw_load_rfk_table(struct rtw_dev *rtwdev)
 
 void rtw_phy_load_tables(struct rtw_dev *rtwdev)
 {
+	const struct rtw_rfe_def *rfe_def = rtw_get_rfe_def(rtwdev);
 	const struct rtw_chip_info *chip = rtwdev->chip;
 	u8 rf_path;
 
 	rtw_load_table(rtwdev, chip->mac_tbl);
 	rtw_load_table(rtwdev, chip->bb_tbl);
 	rtw_load_table(rtwdev, chip->agc_tbl);
+	if (rfe_def->agc_btg_tbl)
+		rtw_load_table(rtwdev, rfe_def->agc_btg_tbl);
 	rtw_load_rfk_table(rtwdev);
 
 	for (rf_path = 0; rf_path < rtwdev->hal.rf_path_num; rf_path++) {
-- 
2.43.2

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 4/4] wifi: rtw88: 8821c: Fix false alarm count
       [not found] <909d9f75-44cd-4710-9d3f-56691fd58090@gmail.com>
  2024-02-27 12:19 ` [PATCH 2/4] wifi: rtw88: 8821cu: Fix connection failure Bitterblue Smith
  2024-02-27 12:20 ` [PATCH 3/4] wifi: rtw88: 8821c: Fix beacon loss and disconnect Bitterblue Smith
@ 2024-02-27 12:20 ` Bitterblue Smith
  2024-02-27 22:46   ` Larry Finger
  2024-02-29  3:53   ` Ping-Ke Shih
  2 siblings, 2 replies; 10+ messages in thread
From: Bitterblue Smith @ 2024-02-27 12:20 UTC (permalink / raw
  To: linux-wireless@vger.kernel.org; +Cc: Ping-Ke Shih

Make dm_info->total_fa_cnt the sum of cck_fa_cnt and ofdm_fa_cnt,
not just ofdm_fa_cnt.

Fixes: 960361238b86 ("rtw88: 8821c: add false alarm statistics")
Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>
---
 drivers/net/wireless/realtek/rtw88/rtw8821c.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/realtek/rtw88/rtw8821c.c b/drivers/net/wireless/realtek/rtw88/rtw8821c.c
index 429bb420b056..fe5d8e188350 100644
--- a/drivers/net/wireless/realtek/rtw88/rtw8821c.c
+++ b/drivers/net/wireless/realtek/rtw88/rtw8821c.c
@@ -773,9 +773,9 @@ static void rtw8821c_false_alarm_statistics(struct rtw_dev *rtwdev)
 
 	dm_info->cck_fa_cnt = cck_fa_cnt;
 	dm_info->ofdm_fa_cnt = ofdm_fa_cnt;
+	dm_info->total_fa_cnt = ofdm_fa_cnt;
 	if (cck_enable)
 		dm_info->total_fa_cnt += cck_fa_cnt;
-	dm_info->total_fa_cnt = ofdm_fa_cnt;
 
 	crc32_cnt = rtw_read32(rtwdev, REG_CRC_CCK);
 	dm_info->cck_ok_cnt = FIELD_GET(GENMASK(15, 0), crc32_cnt);
-- 
2.43.2

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH 4/4] wifi: rtw88: 8821c: Fix false alarm count
  2024-02-27 12:20 ` [PATCH 4/4] wifi: rtw88: 8821c: Fix false alarm count Bitterblue Smith
@ 2024-02-27 22:46   ` Larry Finger
  2024-02-28  9:57     ` Bitterblue Smith
  2024-02-29  3:53   ` Ping-Ke Shih
  1 sibling, 1 reply; 10+ messages in thread
From: Larry Finger @ 2024-02-27 22:46 UTC (permalink / raw
  To: Bitterblue Smith, linux-wireless@vger.kernel.org; +Cc: Ping-Ke Shih

On 2/27/24 06:20, Bitterblue Smith wrote:
> Make dm_info->total_fa_cnt the sum of cck_fa_cnt and ofdm_fa_cnt,
> not just ofdm_fa_cnt.
> 
> Fixes: 960361238b86 ("rtw88: 8821c: add false alarm statistics")
> Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>
> ---
>   drivers/net/wireless/realtek/rtw88/rtw8821c.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/wireless/realtek/rtw88/rtw8821c.c b/drivers/net/wireless/realtek/rtw88/rtw8821c.c
> index 429bb420b056..fe5d8e188350 100644
> --- a/drivers/net/wireless/realtek/rtw88/rtw8821c.c
> +++ b/drivers/net/wireless/realtek/rtw88/rtw8821c.c
> @@ -773,9 +773,9 @@ static void rtw8821c_false_alarm_statistics(struct rtw_dev *rtwdev)
>   
>   	dm_info->cck_fa_cnt = cck_fa_cnt;
>   	dm_info->ofdm_fa_cnt = ofdm_fa_cnt;
> +	dm_info->total_fa_cnt = ofdm_fa_cnt;
>   	if (cck_enable)
>   		dm_info->total_fa_cnt += cck_fa_cnt;
> -	dm_info->total_fa_cnt = ofdm_fa_cnt;
>   
>   	crc32_cnt = rtw_read32(rtwdev, REG_CRC_CCK);
>   	dm_info->cck_ok_cnt = FIELD_GET(GENMASK(15, 0), crc32_cnt);

I applied these 4 patches to my rtw88 GitHub repo, and loaded rtw_core with the 
disable_lps_deep=y option. The option reduced the number of "firmware failed to 
leave lps state" messages, but did not eliminate all of them. The messages I 
received are as follows:

[ 2063.847153] rtw_8821cu 3-6:1.0: firmware failed to leave lps state
[ 2450.120216] rtw_8821cu 3-6:1.0: timed out to flush queue 2
[ 2450.260201] rtw_8821cu 3-6:1.0: timed out to flush queue 2
[ 2450.732302] rtw_8821cu 3-6:1.0: timed out to flush queue 1
[ 2450.876190] rtw_8821cu 3-6:1.0: timed out to flush queue 2
[ 2451.032184] rtw_8821cu 3-6:1.0: timed out to flush queue 1
[ 2451.172250] rtw_8821cu 3-6:1.0: timed out to flush queue 2
[ 2761.250269] rtw_8821cu 3-6:1.0: firmware failed to leave lps state
[ 2761.394131] rtw_8821cu 3-6:1.0: timed out to flush queue 2
[ 2761.746045] rtw_8821cu 3-6:1.0: timed out to flush queue 1
[ 2761.886039] rtw_8821cu 3-6:1.0: timed out to flush queue 2
[ 2762.026075] rtw_8821cu 3-6:1.0: timed out to flush queue 1
[ 2762.166072] rtw_8821cu 3-6:1.0: timed out to flush queue 2
[ 2762.638067] rtw_8821cu 3-6:1.0: timed out to flush queue 1
[ 2762.782031] rtw_8821cu 3-6:1.0: timed out to flush queue 2
[ 2762.922058] rtw_8821cu 3-6:1.0: timed out to flush queue 1
[ 2763.062037] rtw_8821cu 3-6:1.0: timed out to flush queue 2
[ 2763.546006] rtw_8821cu 3-6:1.0: timed out to flush queue 1
[ 2763.690060] rtw_8821cu 3-6:1.0: timed out to flush queue 2
[ 2763.830114] rtw_8821cu 3-6:1.0: timed out to flush queue 1
[ 2763.970031] rtw_8821cu 3-6:1.0: timed out to flush queue 2
[ 2764.462012] rtw_8821cu 3-6:1.0: timed out to flush queue 1
[ 2764.606051] rtw_8821cu 3-6:1.0: timed out to flush queue 2
[ 2764.750051] rtw_8821cu 3-6:1.0: timed out to flush queue 1
[ 2764.898056] rtw_8821cu 3-6:1.0: timed out to flush queue 2
[ 2765.374015] rtw_8821cu 3-6:1.0: timed out to flush queue 1
[ 2765.518056] rtw_8821cu 3-6:1.0: timed out to flush queue 2
[ 2765.658013] rtw_8821cu 3-6:1.0: timed out to flush queue 1
[ 2765.798044] rtw_8821cu 3-6:1.0: timed out to flush queue 2
[ 2766.278031] rtw_8821cu 3-6:1.0: timed out to flush queue 1
[ 2766.425991] rtw_8821cu 3-6:1.0: timed out to flush queue 2
[ 2766.569983] rtw_8821cu 3-6:1.0: timed out to flush queue 1
[ 2766.710038] rtw_8821cu 3-6:1.0: timed out to flush queue 2
[ 2767.118036] rtw_8821cu 3-6:1.0: timed out to flush queue 1
[ 2767.258004] rtw_8821cu 3-6:1.0: timed out to flush queue 2
[ 2767.398031] rtw_8821cu 3-6:1.0: timed out to flush queue 1
[ 2767.538005] rtw_8821cu 3-6:1.0: timed out to flush queue 2
[ 2767.990000] rtw_8821cu 3-6:1.0: timed out to flush queue 1
[ 2768.137991] rtw_8821cu 3-6:1.0: timed out to flush queue 2
[ 2768.277993] rtw_8821cu 3-6:1.0: timed out to flush queue 1
[ 2768.417978] rtw_8821cu 3-6:1.0: timed out to flush queue 2
[ 2768.881990] rtw_8821cu 3-6:1.0: timed out to flush queue 1
[ 2769.021983] rtw_8821cu 3-6:1.0: timed out to flush queue 2
[ 2769.170022] rtw_8821cu 3-6:1.0: timed out to flush queue 1
[ 2769.314019] rtw_8821cu 3-6:1.0: timed out to flush queue 2
[ 2769.770019] rtw_8821cu 3-6:1.0: timed out to flush queue 1
[ 2769.910022] rtw_8821cu 3-6:1.0: timed out to flush queue 2
[ 2770.050068] rtw_8821cu 3-6:1.0: timed out to flush queue 1
[ 2770.190023] rtw_8821cu 3-6:1.0: timed out to flush queue 2
[ 2770.677981] rtw_8821cu 3-6:1.0: timed out to flush queue 1
[ 2770.818013] rtw_8821cu 3-6:1.0: timed out to flush queue 2
[ 2770.961981] rtw_8821cu 3-6:1.0: timed out to flush queue 1
[ 2771.102006] rtw_8821cu 3-6:1.0: timed out to flush queue 2
[ 2771.585977] rtw_8821cu 3-6:1.0: timed out to flush queue 1
[ 2771.733996] rtw_8821cu 3-6:1.0: timed out to flush queue 2
[ 2771.885961] rtw_8821cu 3-6:1.0: timed out to flush queue 1
[ 2772.025998] rtw_8821cu 3-6:1.0: timed out to flush queue 2
[ 2772.493946] rtw_8821cu 3-6:1.0: timed out to flush queue 1
[ 2772.634003] rtw_8821cu 3-6:1.0: timed out to flush queue 2
[ 2772.773946] rtw_8821cu 3-6:1.0: timed out to flush queue 1
[ 2772.913996] rtw_8821cu 3-6:1.0: timed out to flush queue 2
[ 2773.373987] rtw_8821cu 3-6:1.0: timed out to flush queue 1
[ 2773.521989] rtw_8821cu 3-6:1.0: timed out to flush queue 2
[ 2773.661930] rtw_8821cu 3-6:1.0: timed out to flush queue 1
[ 2773.801954] rtw_8821cu 3-6:1.0: timed out to flush queue 2
[ 2774.261921] rtw_8821cu 3-6:1.0: timed out to flush queue 1
[ 2774.401913] rtw_8821cu 3-6:1.0: timed out to flush queue 2
[ 2774.541917] rtw_8821cu 3-6:1.0: timed out to flush queue 1
[ 2774.681913] rtw_8821cu 3-6:1.0: timed out to flush queue 2
[ 2775.141945] rtw_8821cu 3-6:1.0: timed out to flush queue 1
[ 2775.281929] rtw_8821cu 3-6:1.0: timed out to flush queue 2
[ 2775.421948] rtw_8821cu 3-6:1.0: timed out to flush queue 1
[ 2775.573943] rtw_8821cu 3-6:1.0: timed out to flush queue 2
[ 2776.049903] rtw_8821cu 3-6:1.0: timed out to flush queue 1
[ 2776.189937] rtw_8821cu 3-6:1.0: timed out to flush queue 2
[ 2776.333937] rtw_8821cu 3-6:1.0: timed out to flush queue 1
[ 2776.473910] rtw_8821cu 3-6:1.0: timed out to flush queue 2
[ 2776.957931] rtw_8821cu 3-6:1.0: timed out to flush queue 1
[ 2777.101908] rtw_8821cu 3-6:1.0: failed to get tx report from firmware
[ 2777.105937] rtw_8821cu 3-6:1.0: timed out to flush queue 2
[ 2777.253930] rtw_8821cu 3-6:1.0: timed out to flush queue 1
[ 2777.401931] rtw_8821cu 3-6:1.0: timed out to flush queue 2
[ 2777.869887] rtw_8821cu 3-6:1.0: timed out to flush queue 1
[ 2778.021909] rtw_8821cu 3-6:1.0: timed out to flush queue 2
[ 2778.173921] rtw_8821cu 3-6:1.0: timed out to flush queue 1
[ 2778.313893] rtw_8821cu 3-6:1.0: timed out to flush queue 2
[ 2778.769918] rtw_8821cu 3-6:1.0: timed out to flush queue 1
[ 2778.917883] rtw_8821cu 3-6:1.0: timed out to flush queue 2
[ 2779.069880] rtw_8821cu 3-6:1.0: timed out to flush queue 1
[ 2779.209898] rtw_8821cu 3-6:1.0: timed out to flush queue 2
[ 2779.673918] rtw_8821cu 3-6:1.0: timed out to flush queue 1
[ 2779.830113] rtw_8821cu 3-6:1.0: timed out to flush queue 2
[ 2779.969878] rtw_8821cu 3-6:1.0: timed out to flush queue 1
[ 2780.117875] rtw_8821cu 3-6:1.0: timed out to flush queue 2
[ 2780.581879] rtw_8821cu 3-6:1.0: timed out to flush queue 1
[ 2780.729880] rtw_8821cu 3-6:1.0: timed out to flush queue 2
[ 2780.881890] rtw_8821cu 3-6:1.0: timed out to flush queue 1
[ 2781.033915] rtw_8821cu 3-6:1.0: timed out to flush queue 2
[ 2781.509871] rtw_8821cu 3-6:1.0: timed out to flush queue 1
[ 2781.653894] rtw_8821cu 3-6:1.0: timed out to flush queue 2
[ 2781.793903] rtw_8821cu 3-6:1.0: timed out to flush queue 1
[ 2781.933866] rtw_8821cu 3-6:1.0: timed out to flush queue 2
[ 2782.397885] rtw_8821cu 3-6:1.0: timed out to flush queue 1
[ 2782.549862] rtw_8821cu 3-6:1.0: timed out to flush queue 2
[ 2782.697871] rtw_8821cu 3-6:1.0: timed out to flush queue 1
[ 2782.845881] rtw_8821cu 3-6:1.0: timed out to flush queue 2
[ 2783.301880] rtw_8821cu 3-6:1.0: timed out to flush queue 1
[ 2783.453859] rtw_8821cu 3-6:1.0: timed out to flush queue 2
[ 2783.601855] rtw_8821cu 3-6:1.0: timed out to flush queue 1
[ 2783.741888] rtw_8821cu 3-6:1.0: timed out to flush queue 2
[ 2784.205873] rtw_8821cu 3-6:1.0: timed out to flush queue 1
[ 2784.349847] rtw_8821cu 3-6:1.0: timed out to flush queue 2
[ 2784.489850] rtw_8821cu 3-6:1.0: timed out to flush queue 1
[ 2784.633852] rtw_8821cu 3-6:1.0: timed out to flush queue 2
[ 2785.093862] rtw_8821cu 3-6:1.0: timed out to flush queue 1
[ 2785.249887] rtw_8821cu 3-6:1.0: timed out to flush queue 2
[ 2785.393874] rtw_8821cu 3-6:1.0: timed out to flush queue 1
[ 2785.541861] rtw_8821cu 3-6:1.0: timed out to flush queue 2
[ 2786.009875] rtw_8821cu 3-6:1.0: timed out to flush queue 1
[ 2786.153841] rtw_8821cu 3-6:1.0: timed out to flush queue 2
[ 2786.293867] rtw_8821cu 3-6:1.0: timed out to flush queue 1
[ 2786.433865] rtw_8821cu 3-6:1.0: timed out to flush queue 2
[ 2786.893824] rtw_8821cu 3-6:1.0: timed out to flush queue 1
[ 2787.037830] rtw_8821cu 3-6:1.0: timed out to flush queue 2
[ 2787.177862] rtw_8821cu 3-6:1.0: timed out to flush queue 1
[ 2787.329859] rtw_8821cu 3-6:1.0: timed out to flush queue 2
[ 2787.813856] rtw_8821cu 3-6:1.0: timed out to flush queue 1
[ 2787.957844] rtw_8821cu 3-6:1.0: timed out to flush queue 2
[ 2788.097854] rtw_8821cu 3-6:1.0: timed out to flush queue 1
[ 2788.237835] rtw_8821cu 3-6:1.0: timed out to flush queue 2
[ 2788.653823] rtw_8821cu 3-6:1.0: timed out to flush queue 1
[ 2788.797856] rtw_8821cu 3-6:1.0: timed out to flush queue 2
[ 2788.941835] rtw_8821cu 3-6:1.0: timed out to flush queue 1
[ 2789.085831] rtw_8821cu 3-6:1.0: timed out to flush queue 2
[ 2789.741804] rtw_8821cu 3-6:1.0: failed to get tx report from firmware
[ 3090.791769] rtw_8821cu 3-6:1.0: timed out to flush queue 1
[ 3090.935840] rtw_8821cu 3-6:1.0: timed out to flush queue 2
[ 3091.075815] rtw_8821cu 3-6:1.0: timed out to flush queue 1
[ 3091.215833] rtw_8821cu 3-6:1.0: timed out to flush queue 2
[ 3235.830985] rtw_8821cu 3-6:1.0: firmware failed to leave lps state
[ 3491.833226] rtw_8821cu 3-6:1.0: firmware failed to leave lps state
[ 3785.811436] rtw_8821cu 3-6:1.0: firmware failed to leave lps state
[ 4022.341835] rtw_8821cu 3-6:1.0: firmware failed to leave lps state
[ 4022.481494] rtw_8821cu 3-6:1.0: timed out to flush queue 2
[ 4022.833492] rtw_8821cu 3-6:1.0: timed out to flush queue 2
[ 4022.973563] rtw_8821cu 3-6:1.0: timed out to flush queue 2
[ 4023.453532] rtw_8821cu 3-6:1.0: timed out to flush queue 2
[ 4023.597554] rtw_8821cu 3-6:1.0: timed out to flush queue 2
[ 4024.069501] rtw_8821cu 3-6:1.0: timed out to flush queue 2
[ 4024.213553] rtw_8821cu 3-6:1.0: timed out to flush queue 2
[ 4024.689549] rtw_8821cu 3-6:1.0: timed out to flush queue 1
[ 4024.829513] rtw_8821cu 3-6:1.0: timed out to flush queue 2
[ 4024.973477] rtw_8821cu 3-6:1.0: timed out to flush queue 1
[ 4025.121509] rtw_8821cu 3-6:1.0: timed out to flush queue 2
[ 4025.597496] rtw_8821cu 3-6:1.0: timed out to flush queue 1
[ 4025.737488] rtw_8821cu 3-6:1.0: timed out to flush queue 2
[ 4025.881539] rtw_8821cu 3-6:1.0: timed out to flush queue 1
[ 4026.025538] rtw_8821cu 3-6:1.0: timed out to flush queue 2
[ 4026.505547] rtw_8821cu 3-6:1.0: timed out to flush queue 1
[ 4026.649535] rtw_8821cu 3-6:1.0: timed out to flush queue 2
[ 4026.789538] rtw_8821cu 3-6:1.0: timed out to flush queue 1
[ 4026.929580] rtw_8821cu 3-6:1.0: timed out to flush queue 2
[ 4027.349506] rtw_8821cu 3-6:1.0: timed out to flush queue 1
[ 4027.489530] rtw_8821cu 3-6:1.0: timed out to flush queue 2
[ 4027.634007] rtw_8821cu 3-6:1.0: timed out to flush queue 1
[ 4027.773527] rtw_8821cu 3-6:1.0: timed out to flush queue 2
[ 4028.217496] rtw_8821cu 3-6:1.0: timed out to flush queue 1
[ 4028.361486] rtw_8821cu 3-6:1.0: timed out to flush queue 2
[ 4028.509490] rtw_8821cu 3-6:1.0: timed out to flush queue 1
[ 4028.649459] rtw_8821cu 3-6:1.0: timed out to flush queue 2
[ 4029.109520] rtw_8821cu 3-6:1.0: timed out to flush queue 1
[ 4029.249517] rtw_8821cu 3-6:1.0: timed out to flush queue 2
[ 4029.389451] rtw_8821cu 3-6:1.0: timed out to flush queue 1
[ 4029.529484] rtw_8821cu 3-6:1.0: timed out to flush queue 2
[ 4029.989474] rtw_8821cu 3-6:1.0: timed out to flush queue 1
[ 4030.133512] rtw_8821cu 3-6:1.0: timed out to flush queue 2
[ 4030.273510] rtw_8821cu 3-6:1.0: timed out to flush queue 1
[ 4030.425480] rtw_8821cu 3-6:1.0: timed out to flush queue 2
[ 4030.913485] rtw_8821cu 3-6:1.0: timed out to flush queue 1
[ 4031.053503] rtw_8821cu 3-6:1.0: timed out to flush queue 2
[ 4031.205437] rtw_8821cu 3-6:1.0: timed out to flush queue 1
[ 4031.349448] rtw_8821cu 3-6:1.0: timed out to flush queue 2
[ 4031.833471] rtw_8821cu 3-6:1.0: timed out to flush queue 1
[ 4031.981473] rtw_8821cu 3-6:1.0: timed out to flush queue 2
[ 4032.121453] rtw_8821cu 3-6:1.0: timed out to flush queue 1
[ 4032.265451] rtw_8821cu 3-6:1.0: timed out to flush queue 2
[ 4032.729499] rtw_8821cu 3-6:1.0: timed out to flush queue 1
[ 4032.873429] rtw_8821cu 3-6:1.0: timed out to flush queue 2
[ 4033.021489] rtw_8821cu 3-6:1.0: timed out to flush queue 1
[ 4033.173421] rtw_8821cu 3-6:1.0: timed out to flush queue 2
[ 4033.645425] rtw_8821cu 3-6:1.0: timed out to flush queue 1
[ 4033.793453] rtw_8821cu 3-6:1.0: timed out to flush queue 2
[ 4033.941448] rtw_8821cu 3-6:1.0: timed out to flush queue 1
[ 4034.081432] rtw_8821cu 3-6:1.0: timed out to flush queue 2
[ 4034.545482] rtw_8821cu 3-6:1.0: timed out to flush queue 1
[ 4034.689413] rtw_8821cu 3-6:1.0: timed out to flush queue 2
[ 4034.829413] rtw_8821cu 3-6:1.0: timed out to flush queue 1
[ 4034.969446] rtw_8821cu 3-6:1.0: timed out to flush queue 2
[ 4035.425414] rtw_8821cu 3-6:1.0: timed out to flush queue 1
[ 4035.569441] rtw_8821cu 3-6:1.0: timed out to flush queue 2
[ 4035.713473] rtw_8821cu 3-6:1.0: timed out to flush queue 1
[ 4035.853475] rtw_8821cu 3-6:1.0: timed out to flush queue 2
[ 4036.313473] rtw_8821cu 3-6:1.0: timed out to flush queue 1
[ 4036.453403] rtw_8821cu 3-6:1.0: timed out to flush queue 2
[ 4036.597469] rtw_8821cu 3-6:1.0: timed out to flush queue 1
[ 4036.745429] rtw_8821cu 3-6:1.0: timed out to flush queue 2
[ 4037.205441] rtw_8821cu 3-6:1.0: timed out to flush queue 1
[ 4037.345435] rtw_8821cu 3-6:1.0: timed out to flush queue 2
[ 4037.489409] rtw_8821cu 3-6:1.0: timed out to flush queue 1
[ 4037.629435] rtw_8821cu 3-6:1.0: timed out to flush queue 2
[ 4038.089418] rtw_8821cu 3-6:1.0: timed out to flush queue 1
[ 4038.229394] rtw_8821cu 3-6:1.0: timed out to flush queue 2
[ 4038.373412] rtw_8821cu 3-6:1.0: timed out to flush queue 1
[ 4038.517390] rtw_8821cu 3-6:1.0: timed out to flush queue 2
[ 4038.973419] rtw_8821cu 3-6:1.0: timed out to flush queue 1
[ 4039.117402] rtw_8821cu 3-6:1.0: timed out to flush queue 2
[ 4039.257423] rtw_8821cu 3-6:1.0: timed out to flush queue 1
[ 4039.409405] rtw_8821cu 3-6:1.0: timed out to flush queue 2
[ 4039.869419] rtw_8821cu 3-6:1.0: timed out to flush queue 1
[ 4040.009412] rtw_8821cu 3-6:1.0: timed out to flush queue 2
[ 4040.157397] rtw_8821cu 3-6:1.0: timed out to flush queue 1
[ 4040.313374] rtw_8821cu 3-6:1.0: timed out to flush queue 2
[ 4040.781399] rtw_8821cu 3-6:1.0: timed out to flush queue 1
[ 4040.921408] rtw_8821cu 3-6:1.0: timed out to flush queue 2
[ 4041.069405] rtw_8821cu 3-6:1.0: timed out to flush queue 1
[ 4041.217409] rtw_8821cu 3-6:1.0: timed out to flush queue 2
[ 4041.677402] rtw_8821cu 3-6:1.0: timed out to flush queue 1
[ 4041.817376] rtw_8821cu 3-6:1.0: timed out to flush queue 2
[ 4041.861392] rtw_8821cu 3-6:1.0: failed to get tx report from firmware
[ 4041.961431] rtw_8821cu 3-6:1.0: timed out to flush queue 1
[ 4042.101398] rtw_8821cu 3-6:1.0: timed out to flush queue 2
[ 4042.561368] rtw_8821cu 3-6:1.0: timed out to flush queue 1
[ 4042.717368] rtw_8821cu 3-6:1.0: timed out to flush queue 2
[ 4042.869377] rtw_8821cu 3-6:1.0: timed out to flush queue 1
[ 4043.009397] rtw_8821cu 3-6:1.0: timed out to flush queue 2
[ 4043.481354] rtw_8821cu 3-6:1.0: timed out to flush queue 1
[ 4043.637348] rtw_8821cu 3-6:1.0: timed out to flush queue 2
[ 4043.785386] rtw_8821cu 3-6:1.0: timed out to flush queue 1
[ 4043.941374] rtw_8821cu 3-6:1.0: timed out to flush queue 2
[ 4044.413371] rtw_8821cu 3-6:1.0: timed out to flush queue 1
[ 4044.557372] rtw_8821cu 3-6:1.0: timed out to flush queue 2
[ 4044.701351] rtw_8821cu 3-6:1.0: timed out to flush queue 1
[ 4044.845343] rtw_8821cu 3-6:1.0: timed out to flush queue 2
[ 4045.305389] rtw_8821cu 3-6:1.0: timed out to flush queue 1
[ 4045.457341] rtw_8821cu 3-6:1.0: timed out to flush queue 2
[ 4045.597377] rtw_8821cu 3-6:1.0: timed out to flush queue 1
[ 4045.741373] rtw_8821cu 3-6:1.0: timed out to flush queue 2
[ 4046.213370] rtw_8821cu 3-6:1.0: timed out to flush queue 1
[ 4046.357360] rtw_8821cu 3-6:1.0: timed out to flush queue 2
[ 4046.513373] rtw_8821cu 3-6:1.0: timed out to flush queue 1
[ 4046.657352] rtw_8821cu 3-6:1.0: timed out to flush queue 2
[ 4047.117350] rtw_8821cu 3-6:1.0: timed out to flush queue 1
[ 4047.261340] rtw_8821cu 3-6:1.0: timed out to flush queue 2
[ 4047.409353] rtw_8821cu 3-6:1.0: timed out to flush queue 1
[ 4047.557370] rtw_8821cu 3-6:1.0: timed out to flush queue 2
[ 4048.033365] rtw_8821cu 3-6:1.0: timed out to flush queue 1
[ 4048.177358] rtw_8821cu 3-6:1.0: timed out to flush queue 2
[ 4048.329341] rtw_8821cu 3-6:1.0: timed out to flush queue 1
[ 4048.477320] rtw_8821cu 3-6:1.0: timed out to flush queue 2
[ 4048.885326] rtw_8821cu 3-6:1.0: timed out to flush queue 1
[ 4049.033351] rtw_8821cu 3-6:1.0: timed out to flush queue 2
[ 4049.177351] rtw_8821cu 3-6:1.0: timed out to flush queue 1
[ 4049.321329] rtw_8821cu 3-6:1.0: timed out to flush queue 2
[ 4148.849033] rtw_8821cu 3-6:1.0: firmware failed to leave lps state
[ 4166.832775] rtw_8821cu 3-6:1.0: firmware failed to leave lps state
[ 4323.823755] rtw_8821cu 3-6:1.0: firmware failed to leave lps state
[ 4453.846759] rtw_8821cu 3-6:1.0: firmware failed to leave lps state
[ 4455.822861] rtw_8821cu 3-6:1.0: firmware failed to leave lps state

My system has now been up for about 4470 sec. Obviously these messages come in a 
burst.

Larry



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 4/4] wifi: rtw88: 8821c: Fix false alarm count
  2024-02-27 22:46   ` Larry Finger
@ 2024-02-28  9:57     ` Bitterblue Smith
  2024-02-28 19:02       ` Larry Finger
  0 siblings, 1 reply; 10+ messages in thread
From: Bitterblue Smith @ 2024-02-28  9:57 UTC (permalink / raw
  To: Larry Finger, linux-wireless@vger.kernel.org; +Cc: Ping-Ke Shih

On 28/02/2024 00:46, Larry Finger wrote:
> On 2/27/24 06:20, Bitterblue Smith wrote:
>> Make dm_info->total_fa_cnt the sum of cck_fa_cnt and ofdm_fa_cnt,
>> not just ofdm_fa_cnt.
>>
>> Fixes: 960361238b86 ("rtw88: 8821c: add false alarm statistics")
>> Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>
>> ---
>>   drivers/net/wireless/realtek/rtw88/rtw8821c.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/net/wireless/realtek/rtw88/rtw8821c.c b/drivers/net/wireless/realtek/rtw88/rtw8821c.c
>> index 429bb420b056..fe5d8e188350 100644
>> --- a/drivers/net/wireless/realtek/rtw88/rtw8821c.c
>> +++ b/drivers/net/wireless/realtek/rtw88/rtw8821c.c
>> @@ -773,9 +773,9 @@ static void rtw8821c_false_alarm_statistics(struct rtw_dev *rtwdev)
>>         dm_info->cck_fa_cnt = cck_fa_cnt;
>>       dm_info->ofdm_fa_cnt = ofdm_fa_cnt;
>> +    dm_info->total_fa_cnt = ofdm_fa_cnt;
>>       if (cck_enable)
>>           dm_info->total_fa_cnt += cck_fa_cnt;
>> -    dm_info->total_fa_cnt = ofdm_fa_cnt;
>>         crc32_cnt = rtw_read32(rtwdev, REG_CRC_CCK);
>>       dm_info->cck_ok_cnt = FIELD_GET(GENMASK(15, 0), crc32_cnt);
> 
> I applied these 4 patches to my rtw88 GitHub repo, and loaded rtw_core with the disable_lps_deep=y option. The option reduced the number of "firmware failed to leave lps state" messages, but did not eliminate all of them. The messages I received are as follows:
> 
> [ 2063.847153] rtw_8821cu 3-6:1.0: firmware failed to leave lps state
> [ 2450.120216] rtw_8821cu 3-6:1.0: timed out to flush queue 2

[...]

> [ 4323.823755] rtw_8821cu 3-6:1.0: firmware failed to leave lps state
> [ 4453.846759] rtw_8821cu 3-6:1.0: firmware failed to leave lps state
> [ 4455.822861] rtw_8821cu 3-6:1.0: firmware failed to leave lps state
> 
> My system has now been up for about 4470 sec. Obviously these messages come in a burst.
> 
> Larry
> 

I have never seen these. I guess you don't get these messages
without the patches? Can you see which patch causes this, please?

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 4/4] wifi: rtw88: 8821c: Fix false alarm count
  2024-02-28  9:57     ` Bitterblue Smith
@ 2024-02-28 19:02       ` Larry Finger
  2024-02-28 21:54         ` Bitterblue Smith
  0 siblings, 1 reply; 10+ messages in thread
From: Larry Finger @ 2024-02-28 19:02 UTC (permalink / raw
  To: Bitterblue Smith, linux-wireless@vger.kernel.org; +Cc: Ping-Ke Shih

On 2/28/24 03:57, Bitterblue Smith wrote:
> On 28/02/2024 00:46, Larry Finger wrote:
>> On 2/27/24 06:20, Bitterblue Smith wrote:
>>> Make dm_info->total_fa_cnt the sum of cck_fa_cnt and ofdm_fa_cnt,
>>> not just ofdm_fa_cnt.
>>>
>>> Fixes: 960361238b86 ("rtw88: 8821c: add false alarm statistics")
>>> Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>
>>> ---
>>>    drivers/net/wireless/realtek/rtw88/rtw8821c.c | 2 +-
>>>    1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/drivers/net/wireless/realtek/rtw88/rtw8821c.c b/drivers/net/wireless/realtek/rtw88/rtw8821c.c
>>> index 429bb420b056..fe5d8e188350 100644
>>> --- a/drivers/net/wireless/realtek/rtw88/rtw8821c.c
>>> +++ b/drivers/net/wireless/realtek/rtw88/rtw8821c.c
>>> @@ -773,9 +773,9 @@ static void rtw8821c_false_alarm_statistics(struct rtw_dev *rtwdev)
>>>          dm_info->cck_fa_cnt = cck_fa_cnt;
>>>        dm_info->ofdm_fa_cnt = ofdm_fa_cnt;
>>> +    dm_info->total_fa_cnt = ofdm_fa_cnt;
>>>        if (cck_enable)
>>>            dm_info->total_fa_cnt += cck_fa_cnt;
>>> -    dm_info->total_fa_cnt = ofdm_fa_cnt;
>>>          crc32_cnt = rtw_read32(rtwdev, REG_CRC_CCK);
>>>        dm_info->cck_ok_cnt = FIELD_GET(GENMASK(15, 0), crc32_cnt);
>>
>> I applied these 4 patches to my rtw88 GitHub repo, and loaded rtw_core with the disable_lps_deep=y option. The option reduced the number of "firmware failed to leave lps state" messages, but did not eliminate all of them. The messages I received are as follows:
>>
>> [ 2063.847153] rtw_8821cu 3-6:1.0: firmware failed to leave lps state
>> [ 2450.120216] rtw_8821cu 3-6:1.0: timed out to flush queue 2
> 
> [...]
> 
>> [ 4323.823755] rtw_8821cu 3-6:1.0: firmware failed to leave lps state
>> [ 4453.846759] rtw_8821cu 3-6:1.0: firmware failed to leave lps state
>> [ 4455.822861] rtw_8821cu 3-6:1.0: firmware failed to leave lps state
>>
>> My system has now been up for about 4470 sec. Obviously these messages come in a burst.
>>
>> Larry
>>
> 
> I have never seen these. I guess you don't get these messages
> without the patches? Can you see which patch causes this, please?

Bitterblue,

These warnings are not new, but probably only happen for some models of 8821CU.

When I get time, I will try to see if I can quiet them,

Larry



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 4/4] wifi: rtw88: 8821c: Fix false alarm count
  2024-02-28 19:02       ` Larry Finger
@ 2024-02-28 21:54         ` Bitterblue Smith
  0 siblings, 0 replies; 10+ messages in thread
From: Bitterblue Smith @ 2024-02-28 21:54 UTC (permalink / raw
  To: Larry Finger, linux-wireless@vger.kernel.org; +Cc: Ping-Ke Shih

On 28/02/2024 21:02, Larry Finger wrote:
> On 2/28/24 03:57, Bitterblue Smith wrote:
>> On 28/02/2024 00:46, Larry Finger wrote:
>>> On 2/27/24 06:20, Bitterblue Smith wrote:
>>>> Make dm_info->total_fa_cnt the sum of cck_fa_cnt and ofdm_fa_cnt,
>>>> not just ofdm_fa_cnt.
>>>>
>>>> Fixes: 960361238b86 ("rtw88: 8821c: add false alarm statistics")
>>>> Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>
>>>> ---
>>>>    drivers/net/wireless/realtek/rtw88/rtw8821c.c | 2 +-
>>>>    1 file changed, 1 insertion(+), 1 deletion(-)
>>>>
>>>> diff --git a/drivers/net/wireless/realtek/rtw88/rtw8821c.c b/drivers/net/wireless/realtek/rtw88/rtw8821c.c
>>>> index 429bb420b056..fe5d8e188350 100644
>>>> --- a/drivers/net/wireless/realtek/rtw88/rtw8821c.c
>>>> +++ b/drivers/net/wireless/realtek/rtw88/rtw8821c.c
>>>> @@ -773,9 +773,9 @@ static void rtw8821c_false_alarm_statistics(struct rtw_dev *rtwdev)
>>>>          dm_info->cck_fa_cnt = cck_fa_cnt;
>>>>        dm_info->ofdm_fa_cnt = ofdm_fa_cnt;
>>>> +    dm_info->total_fa_cnt = ofdm_fa_cnt;
>>>>        if (cck_enable)
>>>>            dm_info->total_fa_cnt += cck_fa_cnt;
>>>> -    dm_info->total_fa_cnt = ofdm_fa_cnt;
>>>>          crc32_cnt = rtw_read32(rtwdev, REG_CRC_CCK);
>>>>        dm_info->cck_ok_cnt = FIELD_GET(GENMASK(15, 0), crc32_cnt);
>>>
>>> I applied these 4 patches to my rtw88 GitHub repo, and loaded rtw_core with the disable_lps_deep=y option. The option reduced the number of "firmware failed to leave lps state" messages, but did not eliminate all of them. The messages I received are as follows:
>>>
>>> [ 2063.847153] rtw_8821cu 3-6:1.0: firmware failed to leave lps state
>>> [ 2450.120216] rtw_8821cu 3-6:1.0: timed out to flush queue 2
>>
>> [...]
>>
>>> [ 4323.823755] rtw_8821cu 3-6:1.0: firmware failed to leave lps state
>>> [ 4453.846759] rtw_8821cu 3-6:1.0: firmware failed to leave lps state
>>> [ 4455.822861] rtw_8821cu 3-6:1.0: firmware failed to leave lps state
>>>
>>> My system has now been up for about 4470 sec. Obviously these messages come in a burst.
>>>
>>> Larry
>>>
>>
>> I have never seen these. I guess you don't get these messages
>> without the patches? Can you see which patch causes this, please?
> 
> Bitterblue,
> 
> These warnings are not new, but probably only happen for some models of 8821CU.
> 
> When I get time, I will try to see if I can quiet them,
> 
> Larry
> 
 
Oh, so they are not caused by my patches. That's a relief.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* RE: [PATCH 2/4] wifi: rtw88: 8821cu: Fix connection failure
  2024-02-27 12:19 ` [PATCH 2/4] wifi: rtw88: 8821cu: Fix connection failure Bitterblue Smith
@ 2024-02-29  3:42   ` Ping-Ke Shih
  0 siblings, 0 replies; 10+ messages in thread
From: Ping-Ke Shih @ 2024-02-29  3:42 UTC (permalink / raw
  To: Bitterblue Smith, linux-wireless@vger.kernel.org; +Cc: Sascha Hauer



> -----Original Message-----
> From: Bitterblue Smith <rtl8821cerfe2@gmail.com>
> Sent: Tuesday, February 27, 2024 8:19 PM
> To: linux-wireless@vger.kernel.org
> Cc: Ping-Ke Shih <pkshih@realtek.com>; Sascha Hauer <sha@pengutronix.de>
> Subject: [PATCH 2/4] wifi: rtw88: 8821cu: Fix connection failure
> 
> Clear bit 8 of REG_SYS_STATUS1 after MAC power on.
> 
> Without this, some RTL8821CU and RTL8811CU cannot connect to any
> network:
> 
> Feb 19 13:33:11 ideapad2 kernel: wlp3s0f3u2: send auth to
>         90:55:de:__:__:__ (try 1/3)
> Feb 19 13:33:13 ideapad2 kernel: wlp3s0f3u2: send auth to
>         90:55:de:__:__:__ (try 2/3)
> Feb 19 13:33:14 ideapad2 kernel: wlp3s0f3u2: send auth to
>         90:55:de:__:__:__ (try 3/3)
> Feb 19 13:33:15 ideapad2 kernel: wlp3s0f3u2: authentication with
>         90:55:de:__:__:__ timed out
> 
> The RTL8822CU and RTL8822BU out-of-tree drivers do this as well, so do
> it for all three types of chips.
> 
> Tested with RTL8811CU (Tenda U9 V2.0).
> 
> Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>
> ---
>  drivers/net/wireless/realtek/rtw88/mac.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/drivers/net/wireless/realtek/rtw88/mac.c b/drivers/net/wireless/realtek/rtw88/mac.c
> index 298663b03580..a3b2c57c5503 100644
> --- a/drivers/net/wireless/realtek/rtw88/mac.c
> +++ b/drivers/net/wireless/realtek/rtw88/mac.c
> @@ -309,6 +309,14 @@ static int rtw_mac_power_switch(struct rtw_dev *rtwdev, bool pwr_on)
>         pwr_seq = pwr_on ? chip->pwr_on_seq : chip->pwr_off_seq;
>         ret = rtw_pwr_seq_parser(rtwdev, pwr_seq);
> 
> +       if (pwr_seq == chip->pwr_on_seq &&

we can just check this by 'pwr_on'.

> +           rtw_hci_type(rtwdev) == RTW_HCI_TYPE_USB) {
> +               if (chip->id == RTW_CHIP_TYPE_8822C ||
> +                   chip->id == RTW_CHIP_TYPE_8822B ||
> +                   chip->id == RTW_CHIP_TYPE_8821C)
> +                       rtw_write8_clr(rtwdev, REG_SYS_STATUS1 + 1, BIT(0));
> +       }
> +
>         if (rtw_hci_type(rtwdev) == RTW_HCI_TYPE_SDIO)
>                 rtw_write32(rtwdev, REG_SDIO_HIMR, imr);
> 
> --
> 2.43.2

^ permalink raw reply	[flat|nested] 10+ messages in thread

* RE: [PATCH 3/4] wifi: rtw88: 8821c: Fix beacon loss and disconnect
  2024-02-27 12:20 ` [PATCH 3/4] wifi: rtw88: 8821c: Fix beacon loss and disconnect Bitterblue Smith
@ 2024-02-29  3:49   ` Ping-Ke Shih
  0 siblings, 0 replies; 10+ messages in thread
From: Ping-Ke Shih @ 2024-02-29  3:49 UTC (permalink / raw
  To: Bitterblue Smith, linux-wireless@vger.kernel.org



> -----Original Message-----
> From: Bitterblue Smith <rtl8821cerfe2@gmail.com>
> Sent: Tuesday, February 27, 2024 8:20 PM
> To: linux-wireless@vger.kernel.org
> Cc: Ping-Ke Shih <pkshih@realtek.com>
> Subject: [PATCH 3/4] wifi: rtw88: 8821c: Fix beacon loss and disconnect
> 
> Tenda U9 V2.0, which contains RTL8811CU, is practically unusable because
> of frequent disconnections:
> 
> Feb 23 14:46:45 ideapad2 wpa_supplicant[427]: wlp3s0f3u2: CTRL-EVENT-BEACON-LOSS
> Feb 23 14:46:46 ideapad2 wpa_supplicant[427]: wlp3s0f3u2: CTRL-EVENT-DISCONNECTED
>         bssid=90:55:de:__:__:__ reason=4 locally_generated=1
> 
> Feb 23 14:46:52 ideapad2 wpa_supplicant[427]: wlp3s0f3u2: CTRL-EVENT-CONNECTED
>         - Connection to 90:55:de:__:__:__ completed [id=0 id_str=]
> Feb 23 14:46:54 ideapad2 wpa_supplicant[427]: wlp3s0f3u2: CTRL-EVENT-BEACON-LOSS
> Feb 23 14:46:55 ideapad2 wpa_supplicant[427]: wlp3s0f3u2: CTRL-EVENT-DISCONNECTED
>         bssid=90:55:de:__:__:__ reason=4 locally_generated=1
> 
> Feb 23 14:47:01 ideapad2 wpa_supplicant[427]: wlp3s0f3u2: CTRL-EVENT-CONNECTED
>         - Connection to 90:55:de:__:__:__ completed [id=0 id_str=]
> Feb 23 14:47:04 ideapad2 wpa_supplicant[427]: wlp3s0f3u2: CTRL-EVENT-BEACON-LOSS
> Feb 23 14:47:05 ideapad2 wpa_supplicant[427]: wlp3s0f3u2: CTRL-EVENT-DISCONNECTED
>         bssid=90:55:de:__:__:__ reason=4 locally_generated=1
> 
> This is caused by a mistake in the chip initialisation. This version of
> the chip requires loading an extra AGC table right after the main one,
> but the extra table is being loaded at the wrong time.

Thanks for the finding. The rtw_chip_board_info_setup() can only do "software"
things, and rtw_phy_load_tables() can really do IO. Add this to commit message
if you think this can be clear. 

> 
> Move the extra AGC table loading to the right place.
> 
> Fixes: 5d6651fe8583 ("rtw88: 8821c: support RFE type2 wifi NIC")
> Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>

Acked-by: Ping-Ke Shih <pkshih@realtek.com>



^ permalink raw reply	[flat|nested] 10+ messages in thread

* RE: [PATCH 4/4] wifi: rtw88: 8821c: Fix false alarm count
  2024-02-27 12:20 ` [PATCH 4/4] wifi: rtw88: 8821c: Fix false alarm count Bitterblue Smith
  2024-02-27 22:46   ` Larry Finger
@ 2024-02-29  3:53   ` Ping-Ke Shih
  1 sibling, 0 replies; 10+ messages in thread
From: Ping-Ke Shih @ 2024-02-29  3:53 UTC (permalink / raw
  To: Bitterblue Smith, linux-wireless@vger.kernel.org



> -----Original Message-----
> From: Bitterblue Smith <rtl8821cerfe2@gmail.com>
> Sent: Tuesday, February 27, 2024 8:21 PM
> To: linux-wireless@vger.kernel.org
> Cc: Ping-Ke Shih <pkshih@realtek.com>
> Subject: [PATCH 4/4] wifi: rtw88: 8821c: Fix false alarm count
> 
> Make dm_info->total_fa_cnt the sum of cck_fa_cnt and ofdm_fa_cnt,
> not just ofdm_fa_cnt.
> 
> Fixes: 960361238b86 ("rtw88: 8821c: add false alarm statistics")
> Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>

Acked-by: Ping-Ke Shih <pkshih@realtek.com>



^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2024-02-29  3:53 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <909d9f75-44cd-4710-9d3f-56691fd58090@gmail.com>
2024-02-27 12:19 ` [PATCH 2/4] wifi: rtw88: 8821cu: Fix connection failure Bitterblue Smith
2024-02-29  3:42   ` Ping-Ke Shih
2024-02-27 12:20 ` [PATCH 3/4] wifi: rtw88: 8821c: Fix beacon loss and disconnect Bitterblue Smith
2024-02-29  3:49   ` Ping-Ke Shih
2024-02-27 12:20 ` [PATCH 4/4] wifi: rtw88: 8821c: Fix false alarm count Bitterblue Smith
2024-02-27 22:46   ` Larry Finger
2024-02-28  9:57     ` Bitterblue Smith
2024-02-28 19:02       ` Larry Finger
2024-02-28 21:54         ` Bitterblue Smith
2024-02-29  3:53   ` Ping-Ke Shih

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).