mbox series

[v2,0/3] wifi: rtw88: USB fixes

Message ID 20230210111632.1985205-1-s.hauer@pengutronix.de (mailing list archive)
Headers show
Series wifi: rtw88: USB fixes | expand

Message

Sascha Hauer Feb. 10, 2023, 11:16 a.m. UTC
This series addresses issues for the recently added RTW88 USB support
reported by Andreas Henriksson and also our customer.

The hardware can't handle urbs that have a size of multiple of the
bulkout_size (usually 512 bytes). The symptom is that the hardware
stalls completely. The issue can be reproduced by sending a suitably
sized ping packet from the device:

ping -s 394 <somehost>

(It's 394 bytes here on a RTL8822CU and RTL8821CU, the actual size may
differ on other chips, it was 402 bytes on a RTL8723DU)

Other than that qsel was not set correctly. The sympton here is that
only one of multiple bulk endpoints was used to send data.

Changes since v1:
- Use URB_ZERO_PACKET to let the USB host controller handle it automatically
  rather than working around the issue.

Sascha Hauer (3):
  wifi: rtw88: usb: Set qsel correctly
  wifi: rtw88: usb: send Zero length packets if necessary
  wifi: rtw88: usb: drop now unnecessary URB size check

 drivers/net/wireless/realtek/rtw88/usb.c | 18 +++---------------
 1 file changed, 3 insertions(+), 15 deletions(-)

Comments

Andreas Henriksson Feb. 10, 2023, 6:19 p.m. UTC | #1
Hello Sacha Hauer,

Thanks alot for fixing this!

On Fri, Feb 10, 2023 at 12:16:29PM +0100, Sascha Hauer wrote:
> This series addresses issues for the recently added RTW88 USB support
> reported by Andreas Henriksson and also our customer.
> 
> The hardware can't handle urbs that have a size of multiple of the
> bulkout_size (usually 512 bytes). The symptom is that the hardware
> stalls completely. The issue can be reproduced by sending a suitably
> sized ping packet from the device:
> 
> ping -s 394 <somehost>
> 
> (It's 394 bytes here on a RTL8822CU and RTL8821CU, the actual size may
> differ on other chips, it was 402 bytes on a RTL8723DU)

I can confirm that with these patches applied that my LM842 dongle
now works reliably on my imx6sx board. On the same board the traffic
would previously usually stall after 80-130MB when downloading.

With patches applied I succesfully completed:
wget -O /dev/null http://speedtest.tele2.net/10GB.zip

Uploading did not seem to trigger the problem before but I still
tested and uploading a gigabyte was no problem using:
curl -T /dev/urandom http://speedtest.tele2.net/upload.php  -O /dev/null

Did not attempt the suggested ping method of reproducing on the old
system, but on the new kernel I could do
$ for a in $(seq 128 512); do ping -n -c 3 -s $a ping.sunet.se ; done
without any stalls.


Feel free to add either or both of:

Reported-by: Andreas Henriksson <andreas@fatal.se>
Tested-by: Andreas Henriksson <andreas@fatal.se>

> 
> Other than that qsel was not set correctly. The sympton here is that
> only one of multiple bulk endpoints was used to send data.
> 
> Changes since v1:
> - Use URB_ZERO_PACKET to let the USB host controller handle it automatically
>   rather than working around the issue.
> 
> Sascha Hauer (3):
>   wifi: rtw88: usb: Set qsel correctly
>   wifi: rtw88: usb: send Zero length packets if necessary
>   wifi: rtw88: usb: drop now unnecessary URB size check
> 
>  drivers/net/wireless/realtek/rtw88/usb.c | 18 +++---------------
>  1 file changed, 3 insertions(+), 15 deletions(-)
> 
> -- 
> 2.30.2
> 

Regards,
Andreas Henriksson
Sascha Hauer March 1, 2023, 7:11 a.m. UTC | #2
On Fri, Feb 10, 2023 at 12:16:29PM +0100, Sascha Hauer wrote:
> This series addresses issues for the recently added RTW88 USB support
> reported by Andreas Henriksson and also our customer.
> 
> The hardware can't handle urbs that have a size of multiple of the
> bulkout_size (usually 512 bytes). The symptom is that the hardware
> stalls completely. The issue can be reproduced by sending a suitably
> sized ping packet from the device:
> 
> ping -s 394 <somehost>
> 
> (It's 394 bytes here on a RTL8822CU and RTL8821CU, the actual size may
> differ on other chips, it was 402 bytes on a RTL8723DU)
> 
> Other than that qsel was not set correctly. The sympton here is that
> only one of multiple bulk endpoints was used to send data.
> 
> Changes since v1:
> - Use URB_ZERO_PACKET to let the USB host controller handle it automatically
>   rather than working around the issue.
> 
> Sascha Hauer (3):
>   wifi: rtw88: usb: Set qsel correctly
>   wifi: rtw88: usb: send Zero length packets if necessary
>   wifi: rtw88: usb: drop now unnecessary URB size check

These patches went in upstream as:

7869b834fb07c wifi: rtw88: usb: Set qsel correctly
07ce9fa6ab0e5 wifi: rtw88: usb: send Zero length packets if necessary
462c8db6a0116 wifi: rtw88: usb: drop now unnecessary URB size check

These patches make the RTW88 USB support much more reliable. Can they be
picked for the current 6.2 stable series please?

Sascha
Greg KH March 1, 2023, 3:22 p.m. UTC | #3
On Wed, Mar 01, 2023 at 08:11:41AM +0100, Sascha Hauer wrote:
> On Fri, Feb 10, 2023 at 12:16:29PM +0100, Sascha Hauer wrote:
> > This series addresses issues for the recently added RTW88 USB support
> > reported by Andreas Henriksson and also our customer.
> > 
> > The hardware can't handle urbs that have a size of multiple of the
> > bulkout_size (usually 512 bytes). The symptom is that the hardware
> > stalls completely. The issue can be reproduced by sending a suitably
> > sized ping packet from the device:
> > 
> > ping -s 394 <somehost>
> > 
> > (It's 394 bytes here on a RTL8822CU and RTL8821CU, the actual size may
> > differ on other chips, it was 402 bytes on a RTL8723DU)
> > 
> > Other than that qsel was not set correctly. The sympton here is that
> > only one of multiple bulk endpoints was used to send data.
> > 
> > Changes since v1:
> > - Use URB_ZERO_PACKET to let the USB host controller handle it automatically
> >   rather than working around the issue.
> > 
> > Sascha Hauer (3):
> >   wifi: rtw88: usb: Set qsel correctly
> >   wifi: rtw88: usb: send Zero length packets if necessary
> >   wifi: rtw88: usb: drop now unnecessary URB size check
> 
> These patches went in upstream as:
> 
> 7869b834fb07c wifi: rtw88: usb: Set qsel correctly
> 07ce9fa6ab0e5 wifi: rtw88: usb: send Zero length packets if necessary
> 462c8db6a0116 wifi: rtw88: usb: drop now unnecessary URB size check
> 
> These patches make the RTW88 USB support much more reliable. Can they be
> picked for the current 6.2 stable series please?

All now queued up, thanks.

greg k-h