Hi On 13.5.2024 16.40, app l wrote:
Hi, Host mode,bulk in, dwc3,version; 0x110 A TD is comprised of two normal trbs. The TD length is 0x1000.
Is the bulk TD split into two trbs due to scatter gather data buffer, or by xhci driver due to buffer alignment requirements? Otherwise one TRB should be enough to point to 4k data
There is a link trb between the two normal trbs. If the chain bit (bit4) in the link trb is 0, there are two interrupts and the data will be lost(scene 1). If the chain bit (bit4) in the link trb is 1, there is one interrupts and then the data is normal(scene 2). A TD is comprised of two normal trbs. There is one interrupts and then the data is normal(scene 3). So I think hci_version == 0x110,it should also be configured xhci->quirks |= XHCI_LINK_TRB_QUIRK in xhci_init;
The chain bit for the link trb should always be set by driver if the link is in the middle of a TD. This is done in inc_enq() by checking if trb before Link trb has chain bit set. The XHCI_LINK_TRB_QUIRK is for controllers that always need Link trb chain bit set even if no TD is spanning the segment. i.e. link trb chain bit is never cleared. There might be some other issue here. Any chance you could try to get a snapshot of the endpoint ring, and event ring when this is seen. debugfs example snippet of device 1, endpoint 2 transfer ring # mount -t debugfs none /sys/kernel/debug/ # cat /sys/kernel/debug/usb/xhci/0000:00:14.0/devices/01/ep02/trbs ... 0 0x00000001041e0fc0: Buffer 00000001041e5000 length 13 TD size 0 intr 0 type 'Normal' flags b:i:I:c:s:I:e:c 0 0x00000001041e0fd0: Buffer 00000001041e5000 length 13 TD size 0 intr 0 type 'Normal' flags b:i:I:c:s:I:e:c 0 0x00000001041e0fe0: Buffer 00000001041e5000 length 13 TD size 0 intr 0 type 'Normal' flags b:i:I:c:s:I:e:c 0 0x00000001041e0ff0: LINK 00000001041e1000 intr 0 type 'Link' flags i:c:t:c 1 0x00000001041e1000: Buffer 00000001041e5000 length 13 TD size 0 intr 0 type 'Normal' flags b:i:I:c:s:I:e:c 1 0x00000001041e1010: Buffer 00000001041e5000 length 13 TD size 0 intr 0 type 'Normal' flags b:i:I:c:s:I:e:c 1 0x00000001041e1020: Buffer 00000001041e5000 length 13 TD size 0 intr 0 type 'Normal' flags b:i:I:c:s:I:e:c ... Thanks Mathias