Search Linux Wireless

Re: [PATCH rtw-next v1 08/13] wifi: rtw89: Hide some errors when the device is unplugged

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 13/05/2025 06:43, Ping-Ke Shih wrote:
> Bitterblue Smith <rtl8821cerfe2@xxxxxxxxx> wrote:
>> A few unnecessary error messages are printed when the device is
>> unplugged. "read swsi busy" in particular can appear ~1000 times when
>> RTL8851BU is unplugged.
>>
>> Add a new flag RTW89_FLAG_UNPLUGGED and print some error messages only
>> when this flag is not set. The new USB driver will set the flag when
>> the device is unplugged.
>>
>> Signed-off-by: Bitterblue Smith <rtl8821cerfe2@xxxxxxxxx>
> 
> Acked-by: Ping-Ke Shih <pkshih@xxxxxxxxxxx>
> 
> [...]
> 
>> diff --git a/drivers/net/wireless/realtek/rtw89/mac.c b/drivers/net/wireless/realtek/rtw89/mac.c
>> index 1a03355b340f..99f01fff90fe 100644
>> --- a/drivers/net/wireless/realtek/rtw89/mac.c
>> +++ b/drivers/net/wireless/realtek/rtw89/mac.c
>> @@ -88,7 +88,7 @@ int rtw89_mac_write_lte(struct rtw89_dev *rtwdev, const u32 offset, u32 val)
>>
>>         ret = read_poll_timeout(rtw89_read8, lte_ctrl, (lte_ctrl & BIT(5)) != 0,
>>                                 50, 50000, false, rtwdev, R_AX_LTE_CTRL + 3);
> 
> For this case, timeout time is large enough for USB. But I'm surprising that
> you don't need to adjust timeout time of read_poll_timeout() for USB devices, 
> since USB is much slower than PCIE.
> 

I don't know, it seems fine.

> If sometime you need, I suggest this pattern (number is artificial): 
> 
> u64 rtw89_hci_timeout(rtwdev, to)
> {
>     if (USB 2)
>         return max(to, 200); // I assume USB 2 is slower and 200 is enough for two times IO.
>     else if (USB 3)
>         return max(to, 100); // I assume USB 3 is faster than USB 2
> 
>     return to;
> }
> 
> u64 to;
> 
> to = rtw89_hci_timeout(rtwdev, 30);
> 
> - read_poll_timeout(..., 1, 30, ...);
> + read_poll_timeout(..., 1, to, ...);
> 
> 





[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Wireless Regulations]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux