public inbox for linux-wireless@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH rtw-next] wifi: rtw88: WARN only once in rtw_phy_get_tx_power_limit()
@ 2026-02-06 18:00 Bitterblue Smith
  2026-02-09  8:01 ` Ping-Ke Shih
  0 siblings, 1 reply; 4+ messages in thread
From: Bitterblue Smith @ 2026-02-06 18:00 UTC (permalink / raw)
  To: linux-wireless@vger.kernel.org; +Cc: Ping-Ke Shih

This function WARNs when the wifi band, channel number, channel width,
rate, or RF path are invalid. Two or three people have reported that it
floods the kernel log with warnings because they try to switch to
invalid channel numbers, like 130.

One warning is probably enough, so turn WARN into WARN_ONCE.

Closes: https://github.com/lwfinger/rtw88/issues/428
Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>
---
 drivers/net/wireless/realtek/rtw88/phy.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/realtek/rtw88/phy.c b/drivers/net/wireless/realtek/rtw88/phy.c
index e2ac5c6fd500..2a3929561664 100644
--- a/drivers/net/wireless/realtek/rtw88/phy.c
+++ b/drivers/net/wireless/realtek/rtw88/phy.c
@@ -2210,8 +2210,8 @@ static s8 rtw_phy_get_tx_power_limit(struct rtw_dev *rtwdev, u8 band,
 	return power_limit;
 
 err:
-	WARN(1, "invalid arguments, band=%d, bw=%d, path=%d, rate=%d, ch=%d\n",
-	     band, bw, rf_path, rate, channel);
+	WARN_ONCE(1, "invalid arguments, band=%d, bw=%d, path=%d, rate=%d, ch=%d\n",
+		  band, bw, rf_path, rate, channel);
 	return (s8)rtwdev->chip->max_power_index;
 }
 
-- 
2.52.0


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

* RE: [PATCH rtw-next] wifi: rtw88: WARN only once in rtw_phy_get_tx_power_limit()
  2026-02-06 18:00 [PATCH rtw-next] wifi: rtw88: WARN only once in rtw_phy_get_tx_power_limit() Bitterblue Smith
@ 2026-02-09  8:01 ` Ping-Ke Shih
  2026-03-25 23:03   ` Bitterblue Smith
  0 siblings, 1 reply; 4+ messages in thread
From: Ping-Ke Shih @ 2026-02-09  8:01 UTC (permalink / raw)
  To: Bitterblue Smith, linux-wireless@vger.kernel.org

Bitterblue Smith <rtl8821cerfe2@gmail.com> wrote:
> This function WARNs when the wifi band, channel number, channel width,
> rate, or RF path are invalid. Two or three people have reported that it
> floods the kernel log with warnings because they try to switch to
> invalid channel numbers, like 130.
> 
> One warning is probably enough, so turn WARN into WARN_ONCE.
> 
> Closes: https://github.com/lwfinger/rtw88/issues/428

As the issue says "invalid arguments, band=1, bw=2, path=1, rate=83, ch=130",
I think it operates on bandwidth 80MHz and primary channel 130. 
But I don't see 20MHz primary channel, for example [1]. 

Can we stop using this channel at set_channel() ahead to avoid this error?

[1] https://en.wikipedia.org/wiki/List_of_WLAN_channels


> Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>
> ---
>  drivers/net/wireless/realtek/rtw88/phy.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/wireless/realtek/rtw88/phy.c b/drivers/net/wireless/realtek/rtw88/phy.c
> index e2ac5c6fd500..2a3929561664 100644
> --- a/drivers/net/wireless/realtek/rtw88/phy.c
> +++ b/drivers/net/wireless/realtek/rtw88/phy.c
> @@ -2210,8 +2210,8 @@ static s8 rtw_phy_get_tx_power_limit(struct rtw_dev *rtwdev, u8 band,
>         return power_limit;
> 
>  err:
> -       WARN(1, "invalid arguments, band=%d, bw=%d, path=%d, rate=%d, ch=%d\n",
> -            band, bw, rf_path, rate, channel);
> +       WARN_ONCE(1, "invalid arguments, band=%d, bw=%d, path=%d, rate=%d, ch=%d\n",
> +                 band, bw, rf_path, rate, channel);
>         return (s8)rtwdev->chip->max_power_index;

I feel this will be a problem if max_power_index is adopted.
The power is too high. 

>  }
> 
> --
> 2.52.0


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

* Re: [PATCH rtw-next] wifi: rtw88: WARN only once in rtw_phy_get_tx_power_limit()
  2026-02-09  8:01 ` Ping-Ke Shih
@ 2026-03-25 23:03   ` Bitterblue Smith
  2026-03-26  1:58     ` Ping-Ke Shih
  0 siblings, 1 reply; 4+ messages in thread
From: Bitterblue Smith @ 2026-03-25 23:03 UTC (permalink / raw)
  To: Ping-Ke Shih, linux-wireless@vger.kernel.org

On 09/02/2026 10:01, Ping-Ke Shih wrote:
> Bitterblue Smith <rtl8821cerfe2@gmail.com> wrote:
>> This function WARNs when the wifi band, channel number, channel width,
>> rate, or RF path are invalid. Two or three people have reported that it
>> floods the kernel log with warnings because they try to switch to
>> invalid channel numbers, like 130.
>>
>> One warning is probably enough, so turn WARN into WARN_ONCE.
>>
>> Closes: https://github.com/lwfinger/rtw88/issues/428
> 
> As the issue says "invalid arguments, band=1, bw=2, path=1, rate=83, ch=130",
> I think it operates on bandwidth 80MHz and primary channel 130. 
> But I don't see 20MHz primary channel, for example [1]. 
> 
> Can we stop using this channel at set_channel() ahead to avoid this error?
> 
> [1] https://en.wikipedia.org/wiki/List_of_WLAN_channels
> 

Is there a standard which says what channels are allowed?

Six weeks ago I asked people to test another patch which adds a check
in rtw_set_channel() like you said, but no one replied. I guess I will
send it as v2.

By the way, there is another patch related to this problem:

https://lore.kernel.org/linux-wireless/20260306-rtw88_channel130-v1-1-ff25a5bc930a@igalia.com/

> 
>> Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>
>> ---
>>  drivers/net/wireless/realtek/rtw88/phy.c | 4 ++--
>>  1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/net/wireless/realtek/rtw88/phy.c b/drivers/net/wireless/realtek/rtw88/phy.c
>> index e2ac5c6fd500..2a3929561664 100644
>> --- a/drivers/net/wireless/realtek/rtw88/phy.c
>> +++ b/drivers/net/wireless/realtek/rtw88/phy.c
>> @@ -2210,8 +2210,8 @@ static s8 rtw_phy_get_tx_power_limit(struct rtw_dev *rtwdev, u8 band,
>>         return power_limit;
>>
>>  err:
>> -       WARN(1, "invalid arguments, band=%d, bw=%d, path=%d, rate=%d, ch=%d\n",
>> -            band, bw, rf_path, rate, channel);
>> +       WARN_ONCE(1, "invalid arguments, band=%d, bw=%d, path=%d, rate=%d, ch=%d\n",
>> +                 band, bw, rf_path, rate, channel);
>>         return (s8)rtwdev->chip->max_power_index;
> 
> I feel this will be a problem if max_power_index is adopted.
> The power is too high. 
> 

I agree, it's a strange default. But I didn't touch that. :)

>>  }
>>
>> --
>> 2.52.0
> 


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

* RE: [PATCH rtw-next] wifi: rtw88: WARN only once in rtw_phy_get_tx_power_limit()
  2026-03-25 23:03   ` Bitterblue Smith
@ 2026-03-26  1:58     ` Ping-Ke Shih
  0 siblings, 0 replies; 4+ messages in thread
From: Ping-Ke Shih @ 2026-03-26  1:58 UTC (permalink / raw)
  To: Bitterblue Smith, linux-wireless@vger.kernel.org

Bitterblue Smith <rtl8821cerfe2@gmail.com> wrote:
> 
> On 09/02/2026 10:01, Ping-Ke Shih wrote:
> > Bitterblue Smith <rtl8821cerfe2@gmail.com> wrote:
> >> This function WARNs when the wifi band, channel number, channel width,
> >> rate, or RF path are invalid. Two or three people have reported that it
> >> floods the kernel log with warnings because they try to switch to
> >> invalid channel numbers, like 130.
> >>
> >> One warning is probably enough, so turn WARN into WARN_ONCE.
> >>
> >> Closes: https://github.com/lwfinger/rtw88/issues/428
> >
> > As the issue says "invalid arguments, band=1, bw=2, path=1, rate=83, ch=130",
> > I think it operates on bandwidth 80MHz and primary channel 130.
> > But I don't see 20MHz primary channel, for example [1].
> >
> > Can we stop using this channel at set_channel() ahead to avoid this error?
> >
> > [1] https://en.wikipedia.org/wiki/List_of_WLAN_channels
> >
> 
> Is there a standard which says what channels are allowed?
> 
> Six weeks ago I asked people to test another patch which adds a check
> in rtw_set_channel() like you said, but no one replied. I guess I will
> send it as v2.

We are working on a patch to stop this kind of channels. I'd send a RFC
in coming week. 

> 
> By the way, there is another patch related to this problem:
> 
> https://lore.kernel.org/linux-wireless/20260306-rtw88_channel130-v1-1-ff25a5
> bc930a@igalia.com/
> 

I see.

Ping-Ke


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

end of thread, other threads:[~2026-03-26  1:58 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-06 18:00 [PATCH rtw-next] wifi: rtw88: WARN only once in rtw_phy_get_tx_power_limit() Bitterblue Smith
2026-02-09  8:01 ` Ping-Ke Shih
2026-03-25 23:03   ` Bitterblue Smith
2026-03-26  1:58     ` 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