On 26.11.2019 11.44, Kai-Heng Feng wrote:
The log is quite large so I pasted it here:
https://pastebin.ubuntu.com/p/wWpS8ctNrb/
Kai-Heng
Thanks, ring dumps shows xHC hardware never wrote an event to the event ring for the TRB at 0x487a0fe0.
Event ring:
[ 61.114263] xhci_hcd 0000:3f:00.0: 0x000000049803a5d0: TRB 0000000487a08fd0 status 'Short Packet' len 20416 slot 4 ep 3 type 'Transfer Event' flags e:c
we got a short packet event for TRB at 0x487a08fd0, which is one TRB before
[ 61.114269] xhci_hcd 0000:3f:00.0: 0x000000049803a5e0: TRB 0000000487a07a30 status 'Success' len 0 slot 4 ep 4 type 'Transfer Event' flags e:c
[ 61.114275] xhci_hcd 0000:3f:00.0: 0x000000049803a5f0: TRB 0000000487a07a40 status 'Success' len 0 slot 4 ep 4 type 'Transfer Event' flags e:c
[ 61.114281] xhci_hcd 0000:3f:00.0: 0x000000049803a600: TRB 0000000487a09000 status 'Short Packet' len 20416 slot 4 ep 3 type 'Transfer Event' flags e:c
we got a short packet event for TRB at 487a09000, which is one TRB after,
but no event for 0x487a0fe0
The TRB at 0x487a0fe0 in the endpoint ring looks fine:
[ 61.118683] xhci_hcd 0000:3f:00.0: 0x0000000487a08fc0: Buffer 000000046eef0000 length 32768 TD size 0 intr 0 type 'Normal' flags b:i:I:c:s:I:e:C
[ 61.118689] xhci_hcd 0000:3f:00.0: 0x0000000487a08fd0: Buffer 000000048e740000 length 32768 TD size 0 intr 0 type 'Normal' flags b:i:I:c:s:I:e:C
[ 61.118696] xhci_hcd 0000:3f:00.0: 0x0000000487a08fe0: Buffer 000000046ebe8000 length 32768 TD size 0 intr 0 type 'Normal' flags b:i:I:c:s:I:e:C
[ 61.118702] xhci_hcd 0000:3f:00.0: 0x0000000487a08ff0: LINK 0000000487a09000 intr 0 type 'Link' flags i:c:T:C
The TRB with missing event is similar to all the other Normal TRBs in the ring.
It has both interrupt on completion, and interrupt on short packet bits set.
Can't see any reason why an event wasn't generated.
Thanks for you analysis.
The driver for xHCI is a little bit overwhelming, so I didn't read the code through.
It seems it's always the TRB just before the LINK TRB that is missing an event.
(address ends with 0xfe0).
Best guess is that this particular xHC (ASmedia) can't correctly generate events
for the TRB right before Link TRB
Is it possible to still use the TRB with missing event, based on this behavior?
Kai-Heng
For OUT transfers we don't know if the data the trb dma pointer points to is sent or not.
For IN transfers you could in theory check if anything was written to the buffer provided,
but doing something like this would be very hackish.
-Mathias