diff mbox series

[4/4] wifi: rtw88: 8821c: Fix false alarm count

Message ID 38e3d94e-0cab-4a43-be10-c15ff5387919@gmail.com
State Superseded
Headers show
Series [1/4] wifi: rtw88: 8821cu: Fix firmware upload fail | expand

Commit Message

Bitterblue Smith Feb. 27, 2024, 12:20 p.m. UTC
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(-)

Comments

Bitterblue Smith Feb. 28, 2024, 9:57 a.m. UTC | #1
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 Smith Feb. 28, 2024, 9:54 p.m. UTC | #2
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.
Ping-Ke Shih Feb. 29, 2024, 3:53 a.m. UTC | #3
> -----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>
diff mbox series

Patch

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);