RE: xhci data toggle out of sync

From: Mahesh Vardhamanaiah <maheshmv_at_juniper.net>
Date: Tue, 19 Apr 2022 06:09:52 UTC
Hi Hans Petter Selasky,

Thanks for the patch. In our testing I still see the same issue as before

root@:RE:0%
 (da0:umass-sim0:0:0:0): READ(10). CDB: 28 00 00 b1 4b 68 00 00 40 00
(da0:umass-sim0:0:0:0): CAM status: CCB request completed with an error
(da0:umass-sim0:0:0:0): Retrying command, 3 more tries remain

(da0:umass-sim0:0:0:0): READ(10). CDB: 28 00 00 b1 4b 68 00 00 40 00 root@:RE:0% (da0:umass-sim0:0:0:0): READ(10). CDB: 28 00 00 b1 4b 68 00 00 40 00
(da0:umass-sim0:0:0:0): CAM status: CCB request completed with an error
(da0:umass-sim0:0:0:0): Retrying command, 2 more tries remain


Thanks,
Mahesh


Juniper Business Use Only

-----Original Message-----
From: Hans Petter Selasky <hps@selasky.org>
Sent: Tuesday, April 19, 2022 1:17 AM
To: Mahesh Vardhamanaiah <maheshmv@juniper.net>; freebsd-usb@freebsd.org
Cc: Steve Kiernan <stevek@juniper.net>; Justin Hibbits <jhibbits@juniper.net>; Kumara N Babu <bkumara@juniper.net>; Kamal Prasad <krprasad@juniper.net>; Kristof Provost <kp@FreeBSD.org>; Bjoern A. Zeeb <bz@FreeBSD.org>
Subject: Re: xhci data toggle out of sync

[External Email. Be cautious of content]


Hi,

I think I see what is going on there. I believe this commit is a regression after r365239, that the XHCI driver only resets the data toggle when a STALL PID or USB error is received! But that is not the case for the BULK OUT endpoint, in your traces, because USB mass storage has two endpoints.

https://urldefense.com/v3/__https://svnweb.freebsd.org/changeset/base/365239__;!!NEt6yMaO-gk!W7yG-1hqxnmc-s0tNKmmTLW5ZVHepPndOWXd73w6qz4KDTS-bXaiy-HAKW9HvgZx$

Can you try the attached patch instead of reverting that commit and see if the XHCI now sends a DATA0, as expected?

Bjoern and Kristof, can you also test this patch?

--HPS