Linux USB
 help / color / mirror / Atom feed
* USB2 / USB3 compatibility problems: xhci_hcd 0000:00:06.0: WARN Wrong bounce buffer write length: 0 != 512
@ 2021-01-22  8:06 Andreas Hartmann
  2021-01-22  8:09 ` Andreas Hartmann
  0 siblings, 1 reply; 17+ messages in thread
From: Andreas Hartmann @ 2021-01-22  8:06 UTC (permalink / raw)
  To: linux-usb


Hello!

Since a new Notebook, which sadly only provides USB 3 interfaces, I have a more or 
less big problem with an old driver (rt5572sta), which not just sometimes produces 
those warn messages, but even stalls sometimes after those warn messages (e,g, 
Kernel 5.3.x or 5.10.x or 5.8.x) - see attached log file.

The driver uses the bulk method to communicate with the USB bus. By reducing the 
max. bulk size from 24 kByte to 12 kByte, I was able to massively reduce those 
warning messages and now, the USB bus even seldom stalls any more.

I achieved this by changing the building of the bulk package from

if (((ThisBulkSize&0xffff8000) != 0) || ((ThisBulkSize&0x6000) == 0x6000))

to

if (((ThisBulkSize&0xffff8000) != 0) || ((ThisBulkSize&0x3000) == 0x3000))


I can see this problem on two different AMD USB 3 controller, e.g. X370 Series 
Chipset USB 3.1 xHCI Controller [1022:43b9] (rev 02).

I'm wondering how to solve this problem? But mostly I'm wondering, why a USB 2 
device is handled by USB 3 code, expecting to follow USB 3 rules at all? Is it 
possible to bind the driver to the USB 2 code path?

At the moment I think, that the attempt to "transfer" a valid USB 2 package to a 
valid USB 3 package by xhci_hcd seems not always to be transparent to the driver 
producing and controlling its send packets. Could it be possible, that there are 
some situations, where the driver can't check the package after manipulation 
through xhci_hcd any more? Please see the attached log file.

Or how should I fix the driver to be USB 3 ready? Please take into account, that 
I'm not an USB protocol specialist and I don't know, at which level or how to 
build a valid bulk packet which confirms to USB3 rules.

At the time being, I'm debugging on base of the pretty loud debug messages of the 
rt5572sta driver and the xhci_hcd debug messages (echo "module xhci_hcd =pf" > 
/sys/kernel/debug/dynamic_debug/control)


Thanks for any idea how to proceed!
Andreas Hartmann

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

end of thread, other threads:[~2021-01-28 18:30 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-01-22  8:06 USB2 / USB3 compatibility problems: xhci_hcd 0000:00:06.0: WARN Wrong bounce buffer write length: 0 != 512 Andreas Hartmann
2021-01-22  8:09 ` Andreas Hartmann
2021-01-24 17:28   ` Andreas Hartmann
2021-01-25 10:18     ` Andreas Hartmann
2021-01-25 18:28       ` Mathias Nyman
2021-01-25 18:48         ` Andreas Hartmann
2021-01-25 20:06         ` Andreas Hartmann
2021-01-26  7:26           ` Andreas Hartmann
2021-01-26 14:11             ` Mathias Nyman
2021-01-26 17:29               ` Mathias Nyman
2021-01-26 17:48                 ` Andreas Hartmann
2021-01-26 21:16                 ` Andreas Hartmann
2021-01-27  6:43                   ` Andreas Hartmann
2021-01-28 14:14                     ` Mathias Nyman
2021-01-28 17:01                       ` Andreas Hartmann
2021-01-28 17:36                       ` Andreas Hartmann
2021-01-28 18:27                       ` Andreas Hartmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox