Linux USB
 help / color / mirror / Atom feed
From: Andreas Hartmann <andihartmann@01019freenet.de>
To: linux-usb@vger.kernel.org
Subject: USB2 / USB3 compatibility problems: xhci_hcd 0000:00:06.0: WARN Wrong bounce buffer write length: 0 != 512
Date: Fri, 22 Jan 2021 09:06:24 +0100	[thread overview]
Message-ID: <3b4e35d2-9508-e0aa-eaf8-32e524ad81c4@01019freenet.de> (raw)


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

             reply	other threads:[~2021-01-22  8:13 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-22  8:06 Andreas Hartmann [this message]
2021-01-22  8:09 ` USB2 / USB3 compatibility problems: xhci_hcd 0000:00:06.0: WARN Wrong bounce buffer write length: 0 != 512 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3b4e35d2-9508-e0aa-eaf8-32e524ad81c4@01019freenet.de \
    --to=andihartmann@01019freenet.de \
    --cc=linux-usb@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox