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
2021-01-19T14:01:47.492316+01:00 localhost kernel: [26509.686972] xhci_hcd 0000:00:06.0: WARN Wrong bounce buffer write length: 0 != 512
2021-01-19T14:01:48.947710+01:00 localhost kernel: [26511.142333] BulkOutDataPacket failed: ReasonCode=-2!
2021-01-19T14:01:48.947737+01:00 localhost kernel: [26511.142356] >>BulkOut Req=0xc7f93, Complete=0xc7f92, Other=0x2
2021-01-19T14:01:48.947739+01:00 localhost kernel: [26511.142361] >>BulkOut Header:10 6 0 44 d0 0 8f 80
2021-01-19T14:01:54.303312+01:00 localhost kernel: [26516.498060] BulkOutDataPacket failed: ReasonCode=-2!
2021-01-19T14:01:54.303333+01:00 localhost kernel: [26516.498078] >>BulkOut Req=0xc7f93, Complete=0xc7f92, Other=0x3
2021-01-19T14:01:54.303335+01:00 localhost kernel: [26516.498083] >>BulkOut Header:10 6 0 44 d0 0 8f 80
2021-01-19T14:01:59.676016+01:00 localhost kernel: [26521.870773] BulkOutDataPacket failed: ReasonCode=-2!
2021-01-19T14:01:59.676044+01:00 localhost kernel: [26521.870800] >>BulkOut Req=0xc7f93, Complete=0xc7f92, Other=0x4
2021-01-19T14:01:59.676046+01:00 localhost kernel: [26521.870815] >>BulkOut Header:10 6 0 44 d0 0 8f 80
2021-01-19T14:02:04.999737+01:00 localhost kernel: [26527.194549] BulkOutDataPacket failed: ReasonCode=-2!
2021-01-19T14:02:04.999762+01:00 localhost kernel: [26527.194573] >>BulkOut Req=0xc7f93, Complete=0xc7f92, Other=0x5
2021-01-19T14:02:04.999764+01:00 localhost kernel: [26527.194577] >>BulkOut Header:10 6 0 44 d0 0 8f 80
2021-01-19T14:02:10.439333+01:00 localhost kernel: [26532.634186] BulkOutDataPacket failed: ReasonCode=-2!
2021-01-19T14:02:10.439355+01:00 localhost kernel: [26532.634202] >>BulkOut Req=0xc7f93, Complete=0xc7f92, Other=0x6
2021-01-19T14:02:10.439357+01:00 localhost kernel: [26532.634207] >>BulkOut Header:10 6 0 44 d0 0 8f 80
2021-01-19T14:02:15.788389+01:00 localhost kernel: [26537.983270] BulkOutDataPacket failed: ReasonCode=-2!
2021-01-19T14:02:15.788413+01:00 localhost kernel: [26537.983292] >>BulkOut Req=0xc7f93, Complete=0xc7f92, Other=0x7
2021-01-19T14:02:15.788414+01:00 localhost kernel: [26537.983297] >>BulkOut Header:10 6 0 44 d0 0 8f 80
2021-01-19T14:02:21.231765+01:00 localhost kernel: [26543.426680] BulkOutDataPacket failed: ReasonCode=-2!
2021-01-19T14:02:21.231788+01:00 localhost kernel: [26543.426701] >>BulkOut Req=0xc7f93, Complete=0xc7f92, Other=0x8
2021-01-19T14:02:21.231790+01:00 localhost kernel: [26543.426706] >>BulkOut Header:10 6 0 44 d0 0 8f 80
2021-01-19T14:02:26.527355+01:00 localhost kernel: [26548.722310] BulkOutDataPacket failed: ReasonCode=-2!
2021-01-19T14:02:26.527377+01:00 localhost kernel: [26548.722327] >>BulkOut Req=0xc7f93, Complete=0xc7f92, Other=0x9
2021-01-19T14:02:26.527379+01:00 localhost kernel: [26548.722331] >>BulkOut Header:10 6 0 44 d0 0 8f 80
2021-01-19T14:02:31.999097+01:00 localhost kernel: [26554.194080] BulkOutDataPacket failed: ReasonCode=-2!
2021-01-19T14:02:31.999121+01:00 localhost kernel: [26554.194101] >>BulkOut Req=0xc7f93, Complete=0xc7f92, Other=0xa
2021-01-19T14:02:31.999122+01:00 localhost kernel: [26554.194106] >>BulkOut Header:10 6 0 44 d0 0 8f 80