diff mbox series

[1/1] wifi: rtw88: 8822b: disable call trace when write RF mode table fail

Message ID 20231012140120.891411-1-amadeus@jmu.edu.cn (mailing list archive)
State Changes Requested
Delegated to: Kalle Valo
Headers show
Series [1/1] wifi: rtw88: 8822b: disable call trace when write RF mode table fail | expand

Commit Message

Chukun Pan Oct. 12, 2023, 2:01 p.m. UTC
The rtw88 driver throws a useless Call Trace when the rtl8812bu
or rtl8822be wifi modules fail to write the RF mode table.
Since this does not affect normal use of the wifi modules,
replace WARN() with driver warning to avoid useless panic.

Signed-off-by: Chukun Pan <amadeus@jmu.edu.cn>
---
 drivers/net/wireless/realtek/rtw88/rtw8822b.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Ping-Ke Shih Oct. 13, 2023, 1:11 a.m. UTC | #1
> -----Original Message-----
> From: Chukun Pan <amadeus@jmu.edu.cn>
> Sent: Thursday, October 12, 2023 10:01 PM
> To: Ping-Ke Shih <pkshih@realtek.com>
> Cc: Kalle Valo <kvalo@kernel.org>; linux-wireless@vger.kernel.org; linux-kernel@vger.kernel.org; Chukun
> Pan <amadeus@jmu.edu.cn>
> Subject: [PATCH 1/1] wifi: rtw88: 8822b: disable call trace when write RF mode table fail
> 
> The rtw88 driver throws a useless Call Trace when the rtl8812bu
> or rtl8822be wifi modules fail to write the RF mode table.

Why do you think this trace is useless? As I see, there is more than one callers.
Did you meet a real case it throws this trace? If yes, how about the frequency?

Ping-Ke
Chukun Pan Oct. 13, 2023, 2:38 a.m. UTC | #2
Hi, Ping-Ke

> Why do you think this trace is useless? As I see, there is more than one callers.
> Did you meet a real case it throws this trace? If yes, how about the frequency?

[  217.651858] ------------[ cut here ]------------
[  217.654813] write RF mode table fail
[  217.657434] WARNING: CPU: 2 PID: 3705 at 0xffffffffa03df3cb [rtw88_8822b@00000000bf0fde9e+0x35000]
[  217.662078] Modules linked in: rtw88_8822ce rtw88_8822c rtw88_8822be rtw88_8822b rtw88_8723de ...
[  217.704412] RIP: 0010:0xffffffffa03df3cb [rtw88_8822b@00000000bf0fde9e+0x35000]
...
[  217.737232] Call Trace:
[  217.738683]  0xffffffffa03df943 [rtw88_8822b@00000000bf0fde9e+0x35000]
[  217.740865]  0xffffffffa0385ab9 [rtw88_core@00000000a8d26f0d+0x1a000]
[  217.742993]  0xffffffffa0279111 [mac80211@000000003cb4b3bd+0x7b000]
[  217.745028]  0xffffffffa0239092 [cfg80211@00000000a951c4b5+0x46000]
[  217.751368]  ? 0xffffffffa0238de0 [cfg80211@00000000a951c4b5+0x46000]
[  217.773278] RIP: 0033:0x7ff0cdf8836c
...
[  217.789457] ---[ end trace 177712424e9eab4a ]---

As you can see this trace above, I don't think it's useful. This
trace throws up a lot of register values but doesn't point out why.
As long as I plug in the rtl8812bu or rtl8822be wifi modules, this
trace will be thrown every time when the rtw88 driver is loaded.

Thanks,
Chukun
Kalle Valo Oct. 13, 2023, 4:23 a.m. UTC | #3
Chukun Pan <amadeus@jmu.edu.cn> writes:

> Hi, Ping-Ke
>
>> Why do you think this trace is useless? As I see, there is more than one callers.
>> Did you meet a real case it throws this trace? If yes, how about the frequency?
>
> [  217.651858] ------------[ cut here ]------------
> [  217.654813] write RF mode table fail
> [  217.657434] WARNING: CPU: 2 PID: 3705 at 0xffffffffa03df3cb [rtw88_8822b@00000000bf0fde9e+0x35000]
> [  217.662078] Modules linked in: rtw88_8822ce rtw88_8822c rtw88_8822be rtw88_8822b rtw88_8723de ...
> [  217.704412] RIP: 0010:0xffffffffa03df3cb [rtw88_8822b@00000000bf0fde9e+0x35000]
> ...
> [  217.737232] Call Trace:
> [  217.738683]  0xffffffffa03df943 [rtw88_8822b@00000000bf0fde9e+0x35000]
> [  217.740865]  0xffffffffa0385ab9 [rtw88_core@00000000a8d26f0d+0x1a000]
> [  217.742993]  0xffffffffa0279111 [mac80211@000000003cb4b3bd+0x7b000]
> [  217.745028]  0xffffffffa0239092 [cfg80211@00000000a951c4b5+0x46000]
> [  217.751368]  ? 0xffffffffa0238de0 [cfg80211@00000000a951c4b5+0x46000]
> [  217.773278] RIP: 0033:0x7ff0cdf8836c
> ...
> [  217.789457] ---[ end trace 177712424e9eab4a ]---
>
> As you can see this trace above, I don't think it's useful. This
> trace throws up a lot of register values but doesn't point out why.
> As long as I plug in the rtl8812bu or rtl8822be wifi modules, this
> trace will be thrown every time when the rtw88 driver is loaded.

_Why_ is that warning printed? Are your devices uncalibrated or are they
somehow else special?
Chukun Pan Oct. 22, 2023, 9:09 a.m. UTC | #4
> _Why_ is that warning printed? Are your devices uncalibrated or are they
> somehow else special?

I don't know, but not only my rtl8822be wifi module will have this call trace
every time when the driver probes. This can be considered a common problem.
So I prefer to disable this call trace and use the driver warning instead.

Thanks,
Chukun
Ping-Ke Shih Oct. 23, 2023, 2:22 a.m. UTC | #5
> -----Original Message-----
> From: Chukun Pan <amadeus@jmu.edu.cn>
> Sent: Sunday, October 22, 2023 5:09 PM
> To: kvalo@kernel.org
> Cc: Ping-Ke Shih <pkshih@realtek.com>; linux-kernel@vger.kernel.org; linux-wireless@vger.kernel.org;
> Chukun Pan <amadeus@jmu.edu.cn>
> Subject: RE: [PATCH 1/1] wifi: rtw88: 8822b: disable call trace when write RF mode table fail
> 
> > _Why_ is that warning printed? Are your devices uncalibrated or are they
> > somehow else special?
> 
> I don't know, but not only my rtl8822be wifi module will have this call trace
> every time when the driver probes. This can be considered a common problem.
> So I prefer to disable this call trace and use the driver warning instead.
> 

Except to call trace, rtl8822be works well in your side? If so, you just
worry the verbose trace, right?  

By the way, I tested two hardware version of rtl8822be, and they both are fine.

Ping-Ke
Kalle Valo Oct. 23, 2023, 8:21 a.m. UTC | #6
Chukun Pan <amadeus@jmu.edu.cn> writes:

>> _Why_ is that warning printed? Are your devices uncalibrated or are they
>> somehow else special?
>
> I don't know, but not only my rtl8822be wifi module will have this call trace
> every time when the driver probes. This can be considered a common problem.
> So I prefer to disable this call trace and use the driver warning instead.

Why do you say this is a common problem? AFAIK you are the only one
reporting this issue, right? It would help to understand _why_ you are
seeing this, ie. what's the root cause? Just randomly removing warnings
without understanding the root cause is frowned upon.
Chukun Pan Oct. 25, 2023, 4:01 a.m. UTC | #7
> Except to call trace, rtl8822be works well in your side? If so, you just
> worry the verbose trace, right?  

Yes, it's a bit noisy.

> By the way, I tested two hardware version of rtl8822be, and they both are fine.

Sorry wasted your time, but can you test the rtl8812bu wifi module?
Based on the issues search, I'm not the only one who has this problem.
https://github.com/lwfinger/rtw88/issues/111#issuecomment-1385923235
https://github.com/lwfinger/rtw88/issues/151#issuecomment-1753011363

Thanks,
Chukun
diff mbox series

Patch

diff --git a/drivers/net/wireless/realtek/rtw88/rtw8822b.c b/drivers/net/wireless/realtek/rtw88/rtw8822b.c
index 3017a9760da8..06b6efcd16d2 100644
--- a/drivers/net/wireless/realtek/rtw88/rtw8822b.c
+++ b/drivers/net/wireless/realtek/rtw88/rtw8822b.c
@@ -820,8 +820,10 @@  static void rtw8822b_config_trx_mode(struct rtw_dev *rtwdev, u8 tx_path,
 			break;
 	}
 
-	if (WARN(counter <= 0, "write RF mode table fail\n"))
+	if (counter <= 0) {
+		rtw_warn(rtwdev, "write RF mode table fail\n");
 		return;
+	}
 
 	rtw_write_rf(rtwdev, RF_PATH_A, RF_LUTWE, RFREG_MASK, 0x80000);
 	rtw_write_rf(rtwdev, RF_PATH_A, RF_LUTWA, RFREG_MASK, 0x00001);