Thread (17 messages) 17 messages, 2 authors, 2021-01-28

Re: USB2 / USB3 compatibility problems: xhci_hcd 0000:00:06.0: WARN Wrong bounce buffer write length: 0 != 512

From: Andreas Hartmann <hidden>
Date: 2021-01-22 08:11:01

Sorry, forgot to attach the log file ... .

Now, it's there.


Thanks
Andreas Hartmann



On 22.01.21 at 09:06 Andreas Hartmann wrote:
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
  

Attachments

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help