Linux USB
 help / color / mirror / Atom feed
* [Bug 222328] New: Hardware - Host controller: ASMedia ASM2142/ASM3142 USB 3.1 Host Controller [1b21:2142] on a PCIe add-in card   (GLOTRENDS U3142X1), link 8 GT/s x1, Kernel driver: xhci_hcd   xhci quirks reported at probe: 0x0000000000800010 (SPURIOUS_SUCCESS | NO_64BIT_
@ 2026-11-25 16:29 bugzilla-daemon
  2026-11-25 21:16 ` [Bug 222328] xhci: ASMedia ASM2142/ASM3142 [1b21:2142] skips transfer event for bulk TRB before link TRB -> UVC stream (Elgato 4K X, 10 Gbps) stalls with "not part of TD" bugzilla-daemon
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: bugzilla-daemon @ 2026-11-25 16:29 UTC (permalink / raw)
  To: linux-usb

https://bugzilla.kernel.org/show_bug.cgi?id=222328

            Bug ID: 222328
           Summary: Hardware - Host controller: ASMedia ASM2142/ASM3142
                    USB 3.1 Host Controller [1b21:2142] on a PCIe add-in
                    card   (GLOTRENDS U3142X1), link 8 GT/s x1, Kernel
                    driver: xhci_hcd   xhci quirks reported at probe:
                    0x0000000000800010 (SPURIOUS_SUCCESS | NO_64BIT_
           Product: Drivers
           Version: 2.5
    Kernel Version: 7.3.4
          Hardware: All
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P3
         Component: USB
          Assignee: drivers_usb@kernel-bugs.kernel.org
          Reporter: drastic-vivid-7557@shy.email
        Regression: No

Created attachment 311583
  --> https://bugzilla.kernel.org/attachment.cgi?id=311583&action=edit
dmesg, lspci, lsusb, v4l2 formats and xhci tracepoints

Hardware
- Host controller: ASMedia ASM2142/ASM3142 USB 3.1 Host Controller [1b21:2142]
on a PCIe add-in card
  (GLOTRENDS U3142X1), link 8 GT/s x1, Kernel driver: xhci_hcd
  xhci quirks reported at probe: 0x0000000000800010 (SPURIOUS_SUCCESS |
NO_64BIT_SUPPORT)
- Device: Elgato 4K X capture card [0fd9:009b] (SuperSpeed Plus PID;
USB_QUIRK_NO_BOS applies),
  UVC 1.00, video on a bulk endpoint (EP 2 IN, wMaxPacketSize 1024, bMaxBurst
7)
- Board: Gigabyte A520M S2H, Ryzen 5 5600X
- Kernel: 7.3.4-ogc10.1.fc45.x86_64 (Bazzite / Fedora 45)
  Reproduced with and without iommu=pt.

Symptom
- The device enumerates at SuperSpeed Plus and every UVC mode is offered (e.g.
NV12 3840x2160@60).
- Capture of any mode, including NV12 1920x1080@60 and MJPEG 3840x2160@60,
delivers about 1 frame
  every few seconds. ffmpeg shows "frame= 1 ... elapsed=0:00:06".
- dmesg repeatedly shows:
    xhci_hcd 0000:04:00.0: Event dma 0x000000000b036000 for ep 4 status 1 not
part of TD at 000000000b02cfe0 - 000000000b02cfe0
    xhci_hcd 0000:04:00.0: Event dma 0x000000000b036010 for ep 4 status 1 not
part of TD at 000000000b02cfe0 - 000000000b02cfe0
    xhci_hcd 0000:04:00.0: Event dma 0x000000000b036020 for ep 4 status 1 not
part of TD at 000000000b02cfe0 - 000000000b02cfe0
    xhci_hcd 0000:04:00.0: Event dma 0x000000000b036030 for ep 4 status 1 not
part of TD at 000000000b02cfe0 - 000000000b02cfe0
- Same device, same card, same cable on Windows 11: full 10 Gbps capture works.
- The same device on the board's AMD xHCI ports (other controllers) captures
normally.

Analysis (xhci-hcd tracepoints, uvcvideo bulk URBs of 16384 bytes, 1 TRB per
TD)
The stream runs at full speed until the endpoint ring's enqueue reaches the
last TRB slot before the
Link TRB. The controller completes the TRBs before it, posts NO transfer event
for the TRB at
segment offset 0xfe0, and then posts events for the TRBs on the next segment.
The driver's current TD
stays at ...fe0, so every later event is "not part of TD" and the stream
stalls.

  xhci_queue_trb:     BULK: @0x...b02cfc0 ... length 16384 ... flags
b:i:I:c:s:I:e:c
  xhci_queue_trb:     BULK: @0x...b02cfd0 ... length 16384
  xhci_queue_trb:     BULK: @0x...b02cfe0 ... length 16384          <-- last
TRB before link TRB at ...ff0
  xhci_queue_trb:     BULK: @0x...b036000 ... length 16384          <-- next
segment
  xhci_queue_trb:     BULK: @0x...b036010 ... length 16384
  xhci_handle_event:  TRB 000000000b02cfc0 status 'Success' ... ep 5 'Transfer
Event'
  xhci_handle_event:  TRB 000000000b02cfd0 status 'Success' ...
                      (no event for 000000000b02cfe0)
  xhci_handle_event:  TRB 000000000b036000 status 'Success' ...   -> "not part
of TD"
  xhci_handle_event:  TRB 000000000b036010 status 'Success' ...   -> "not part
of TD"
  xhci_handle_event:  TRB 000000000b036020 status 'Success' ...
  xhci_handle_event:  TRB 000000000b036030 status 'Success' ...

It looks as if the ASM2142/3142 does not post a completion event for a TD that
ends on the TRB
directly before an unchained Link TRB, at least at SuperSpeed Plus with this
bulk device. Windows'
xHCI driver is not affected, possibly because of different ring and link TRB
chaining behaviour.

Attachments
- xhci-trace-all.txt.gz: xhci-hcd tracepoints during a 4 s capture attempt
- dmesg.txt, lspci-asm3142.txt (lspci -vvv), lspci-tree.txt, lsusb-tree.txt,
v4l2-formats.txt,
  ffmpeg-1080p60.txt, uname.txt

Steps to reproduce
  ffmpeg -f v4l2 -input_format nv12 -video_size 1920x1080 -framerate 60 \
         -i /dev/v4l/by-id/usb-Elgato_Elgato_4K_X_*-video-index0 -t 4 -f null -

Workarounds tried, none helped:
- iommu=pt: no change.
- xhci_hcd.quirks=0x1 (XHCI_LINK_TRB_QUIRK, probe quirks 0x0000000000800011):
no change. The event for the
  TRB right before the link TRB is still missing:
    Event dma 0x00000000fec67000 for ep 4 status 1 not part of TD at
00000000fec66fe0 - 00000000fec66fe0

Happy to test patches. I can build and boot a test kernel if needed.

-- 
You are receiving this mail because:
You are watching the assignee of the bug.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug 222328] xhci: ASMedia ASM2142/ASM3142 [1b21:2142] skips transfer event for bulk TRB before link TRB -> UVC stream (Elgato 4K X, 10 Gbps) stalls with "not part of TD"
  2026-11-25 16:29 [Bug 222328] New: Hardware - Host controller: ASMedia ASM2142/ASM3142 USB 3.1 Host Controller [1b21:2142] on a PCIe add-in card (GLOTRENDS U3142X1), link 8 GT/s x1, Kernel driver: xhci_hcd xhci quirks reported at probe: 0x0000000000800010 (SPURIOUS_SUCCESS | NO_64BIT_ bugzilla-daemon
@ 2026-11-25 21:16 ` bugzilla-daemon
  2026-11-25 22:18 ` bugzilla-daemon
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: bugzilla-daemon @ 2026-11-25 21:16 UTC (permalink / raw)
  To: linux-usb

https://bugzilla.kernel.org/show_bug.cgi?id=222328

Michał Pecio (michal.pecio@gmail.com) changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |michal.pecio@gmail.com

--- Comment #1 from Michał Pecio (michal.pecio@gmail.com) ---
Fascinating, the same happens on my ASM3142 with a 5gbps UVC capture device,
but I haven't seen it with other USB3 bulk IN devices. Typically for ASMedia,
the bug is random (several TDs at 0x...fe0 succeed before the first missing
event is logged). Or maybe it happens if the unreported transfer was short?

Patching uvcvideo to only submit one URB at a time (#define UVC_URBS 1) seems
to fix it, but 2 URBs trigger it about as quickly as 5. Seems to happen faster
if the device is behind a hub.

Windows works differently, it uses Event Data TRBs so if the transfers do
actually occur but IOC/ISP handling is broken, Windows won't notice. And there
is never such a thing as a transfer TRB immediately before an unchained link.

But implementing EDs properly seems like a bit of work; I think I will try some
hacks like padding the ring with NOPs before the link...

I haven't seen this on ASM1142 and Promontory yet.

-- 
You are receiving this mail because:
You are watching the assignee of the bug.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug 222328] xhci: ASMedia ASM2142/ASM3142 [1b21:2142] skips transfer event for bulk TRB before link TRB -> UVC stream (Elgato 4K X, 10 Gbps) stalls with "not part of TD"
  2026-11-25 16:29 [Bug 222328] New: Hardware - Host controller: ASMedia ASM2142/ASM3142 USB 3.1 Host Controller [1b21:2142] on a PCIe add-in card (GLOTRENDS U3142X1), link 8 GT/s x1, Kernel driver: xhci_hcd xhci quirks reported at probe: 0x0000000000800010 (SPURIOUS_SUCCESS | NO_64BIT_ bugzilla-daemon
  2026-11-25 21:16 ` [Bug 222328] xhci: ASMedia ASM2142/ASM3142 [1b21:2142] skips transfer event for bulk TRB before link TRB -> UVC stream (Elgato 4K X, 10 Gbps) stalls with "not part of TD" bugzilla-daemon
@ 2026-11-25 22:18 ` bugzilla-daemon
  2026-11-26 12:29 ` bugzilla-daemon
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: bugzilla-daemon @ 2026-11-25 22:18 UTC (permalink / raw)
  To: linux-usb

https://bugzilla.kernel.org/show_bug.cgi?id=222328

--- Comment #2 from drastic-vivid-7557@shy.email ---
(In reply to Michał Pecio from comment #1)
> Fascinating, the same happens on my ASM3142 with a 5gbps UVC capture device,
> but I haven't seen it with other USB3 bulk IN devices. Typically for
> ASMedia, the bug is random (several TDs at 0x...fe0 succeed before the first
> missing event is logged). Or maybe it happens if the unreported transfer was
> short?
> 
> Patching uvcvideo to only submit one URB at a time (#define UVC_URBS 1)
> seems to fix it, but 2 URBs trigger it about as quickly as 5. Seems to
> happen faster if the device is behind a hub.
> 
> Windows works differently, it uses Event Data TRBs so if the transfers do
> actually occur but IOC/ISP handling is broken, Windows won't notice. And
> there is never such a thing as a transfer TRB immediately before an
> unchained link.
> 
> But implementing EDs properly seems like a bit of work; I think I will try
> some hacks like padding the ring with NOPs before the link...
> 
> I haven't seen this on ASM1142 and Promontory yet.

Thanks for looking into this.

A few details from my side, in case they help:
- The Elgato is plugged directly into the ASM3142 card's port, not behind a
hub.
- It also stalls when it enumerates at 5 Gbps (0fd9:009c), not just at 10 Gbps.
- In my trace, all completed bulk TDs were full length (16384/16384, apart from
one 16104), so I can't tell
  whether the unreported one was short.
- The same Elgato works normally on the board's AMD (Promontory/Matisse) ports.

I'm on Bazzite (immutable Fedora), so testing a custom kernel is harder for me,
but I'm happy to test a patch if there's a practical way.

-- 
You are receiving this mail because:
You are watching the assignee of the bug.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug 222328] xhci: ASMedia ASM2142/ASM3142 [1b21:2142] skips transfer event for bulk TRB before link TRB -> UVC stream (Elgato 4K X, 10 Gbps) stalls with "not part of TD"
  2026-11-25 16:29 [Bug 222328] New: Hardware - Host controller: ASMedia ASM2142/ASM3142 USB 3.1 Host Controller [1b21:2142] on a PCIe add-in card (GLOTRENDS U3142X1), link 8 GT/s x1, Kernel driver: xhci_hcd xhci quirks reported at probe: 0x0000000000800010 (SPURIOUS_SUCCESS | NO_64BIT_ bugzilla-daemon
  2026-11-25 21:16 ` [Bug 222328] xhci: ASMedia ASM2142/ASM3142 [1b21:2142] skips transfer event for bulk TRB before link TRB -> UVC stream (Elgato 4K X, 10 Gbps) stalls with "not part of TD" bugzilla-daemon
  2026-11-25 22:18 ` bugzilla-daemon
@ 2026-11-26 12:29 ` bugzilla-daemon
  2026-11-26 12:31 ` bugzilla-daemon
  2026-11-26 17:59 ` bugzilla-daemon
  4 siblings, 0 replies; 6+ messages in thread
From: bugzilla-daemon @ 2026-11-26 12:29 UTC (permalink / raw)
  To: linux-usb

https://bugzilla.kernel.org/show_bug.cgi?id=222328

--- Comment #3 from Michał Pecio (michal.pecio@gmail.com) ---
Doesn't seem to affect high-speed.

And it gets worse: if the Link TRB toggles cycle, then it doesn't toggle cycle.
With uvcvideo URB count reduced to 2, sometimes the HC apparently still sees
stale TRB in the first segment while in wrong cycle state, so it executes the
whole ring again, executes the missed last TD and works normally until another
occurrence of the bug. After a non-toggling link, it executes any pending TDs
and waits.

Inserting one No-Op before the Link TRB seems to break this pattern, though I
would prefer to understand what idiotic assumption the chip makes (or could it
be a kernel bug?) that causes this behavior, before declaring that the problem
is solved for sure.

-- 
You are receiving this mail because:
You are watching the assignee of the bug.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug 222328] xhci: ASMedia ASM2142/ASM3142 [1b21:2142] skips transfer event for bulk TRB before link TRB -> UVC stream (Elgato 4K X, 10 Gbps) stalls with "not part of TD"
  2026-11-25 16:29 [Bug 222328] New: Hardware - Host controller: ASMedia ASM2142/ASM3142 USB 3.1 Host Controller [1b21:2142] on a PCIe add-in card (GLOTRENDS U3142X1), link 8 GT/s x1, Kernel driver: xhci_hcd xhci quirks reported at probe: 0x0000000000800010 (SPURIOUS_SUCCESS | NO_64BIT_ bugzilla-daemon
                   ` (2 preceding siblings ...)
  2026-11-26 12:29 ` bugzilla-daemon
@ 2026-11-26 12:31 ` bugzilla-daemon
  2026-11-26 17:59 ` bugzilla-daemon
  4 siblings, 0 replies; 6+ messages in thread
From: bugzilla-daemon @ 2026-11-26 12:31 UTC (permalink / raw)
  To: linux-usb

https://bugzilla.kernel.org/show_bug.cgi?id=222328

--- Comment #4 from Michał Pecio (michal.pecio@gmail.com) ---
Created attachment 311585
  --> https://bugzilla.kernel.org/attachment.cgi?id=311585&action=edit
Try to fix the ASM3142 bulk UVC bug

This seems to work for me. It ensures that no single-TRB TD can be enqueued
immediately before a link. It's not a complete solution, multi-TRB TDs are
affected too if they end right before the link. But it works for uvcvideo.

-- 
You are receiving this mail because:
You are watching the assignee of the bug.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug 222328] xhci: ASMedia ASM2142/ASM3142 [1b21:2142] skips transfer event for bulk TRB before link TRB -> UVC stream (Elgato 4K X, 10 Gbps) stalls with "not part of TD"
  2026-11-25 16:29 [Bug 222328] New: Hardware - Host controller: ASMedia ASM2142/ASM3142 USB 3.1 Host Controller [1b21:2142] on a PCIe add-in card (GLOTRENDS U3142X1), link 8 GT/s x1, Kernel driver: xhci_hcd xhci quirks reported at probe: 0x0000000000800010 (SPURIOUS_SUCCESS | NO_64BIT_ bugzilla-daemon
                   ` (3 preceding siblings ...)
  2026-11-26 12:31 ` bugzilla-daemon
@ 2026-11-26 17:59 ` bugzilla-daemon
  4 siblings, 0 replies; 6+ messages in thread
From: bugzilla-daemon @ 2026-11-26 17:59 UTC (permalink / raw)
  To: linux-usb

https://bugzilla.kernel.org/show_bug.cgi?id=222328

--- Comment #5 from drastic-vivid-7557@shy.email ---
Tested attachment 311585, and it fixes it for me.

Setup: 7.3.4-ogc10.1.fc45 (Bazzite / OGC kernel) rebuilt from the same tree and
config, with only this patch added.
Hardware: ASM3142 [1b21:2142] on a PCIe x1 card (8 GT/s x1), Elgato 4K X
plugged directly into the card (no hub).

ffmpeg v4l2 capture, 10 s per mode, frames received:

Elgato at 5 Gbps (0fd9:009c):
  NV12  1920x1080@60  : 595 frames (59.5 fps)
  MJPEG 3840x2160@60  : 555 frames in 9.3 s (~60 fps)
  NV12  3840x2160@30  : 277 frames in 9.4 s (~30 fps)

Elgato at 10 Gbps (0fd9:009b), after replugging:
  NV12  1920x1080@60  : 595 frames (59.5 fps)
  NV12  3840x2160@60  : 554 frames (55 fps)
  MJPEG 3840x2160@60  : 558 frames in 9.4 s (~60 fps)

"not part of TD" messages: 0 for the whole boot, across both speeds and a
replug.
Without the patch, the same hardware gets 1-2 frames in 5-10 s in every mode.

For comparison, Windows 11 on the same card gets 35 fps for NV12 4K60, so this
is even better.

Thanks a lot! Happy to test a final version too.

-- 
You are receiving this mail because:
You are watching the assignee of the bug.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2026-11-26 17:59 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-25 16:29 [Bug 222328] New: Hardware - Host controller: ASMedia ASM2142/ASM3142 USB 3.1 Host Controller [1b21:2142] on a PCIe add-in card (GLOTRENDS U3142X1), link 8 GT/s x1, Kernel driver: xhci_hcd xhci quirks reported at probe: 0x0000000000800010 (SPURIOUS_SUCCESS | NO_64BIT_ bugzilla-daemon
2026-11-25 21:16 ` [Bug 222328] xhci: ASMedia ASM2142/ASM3142 [1b21:2142] skips transfer event for bulk TRB before link TRB -> UVC stream (Elgato 4K X, 10 Gbps) stalls with "not part of TD" bugzilla-daemon
2026-11-25 22:18 ` bugzilla-daemon
2026-11-26 12:29 ` bugzilla-daemon
2026-11-26 12:31 ` bugzilla-daemon
2026-11-26 17:59 ` bugzilla-daemon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox