Skip to content

xhci: drop the VL805 XHCI_EP_CTX_BROKEN_DCS cycle-state quirk - #7754

Merged
pelwell merged 1 commit into
raspberrypi:rpi-6.18.yfrom
popcornmix:issue7737
Nov 17, 2026
Merged

pelwell merged 1 commit into
raspberrypi:rpi-6.18.yfrom
popcornmix:issue7737

Conversation

@popcornmix

Copy link
Copy Markdown
Collaborator

Fixes #7737.

Upstream 6328bdc ("usb: xhci: Don't trust the EP Context cycle bit when moving HW dequeue") already handles the VL805 not updating the endpoint DCS. The older downstream quirk still seeds the cycle state from the TRB at the hardware dequeue pointer. When a cancelled TD spans the cycle-toggling link TRB, that toggle is never counted. Set TR Dequeue then gets the wrong cycle bit and the endpoint stalls until a USB reset.

This removes the quirk, which matches rpi-7.3.y: that branch no longer sets XHCI_EP_CTX_BROKEN_DCS for the VL805.

Tested on a Pi 4 with a USB SD card reader, using the reproducer script from #7737:

  • rpi-6.18.y (6.18.62): stuck at cycle 31
  • with this change: 1000 cycles clean, and normal reads from the card still work (500 MB at 30 MB/s)

Upstream commit 6328bdc ("usb: xhci: Don't trust the EP Context
cycle bit when moving HW dequeue") fixed the VL805 DCS write-back problem
by seeding new_cycle from td->end_trb and counting link TRB toggles only
after end_trb.

The downstream quirk still seeds new_cycle from the TRB at the hardware
dequeue pointer, which can be before a cycle-toggling link TRB inside the
cancelled TD. That toggle is then never counted, Set TR Dequeue is given
the previous lap's cycle bit, and the endpoint stalls until a USB reset.

Remove the quirk; upstream's handling covers the VL805.

Link: raspberrypi#7737
Signed-off-by: Dom Cobley <dom@raspberrypi.com>
@popcornmix

Copy link
Copy Markdown
Collaborator Author

@P33M can you check

@P33M

P33M commented Nov 12, 2026

Copy link
Copy Markdown
Contributor

I think the change is correct. Upstream fixed it a different way, now the downstream patch is unneccessary.

@popcornmix
popcornmix marked this pull request as ready for review November 14, 2026 17:25
@reloxx13

Copy link
Copy Markdown

@P33M Confirmed with a local A/B test on the same Raspberry Pi 4 / VL805 and USB device, using the original reproducer from #7737:

  • Previous kernel 6.18.62+rpt-rpi-v8 (Debian package 1:6.18.62-1+rpt1~beta1): STUCK at cycle 0, endpoint 0x82, dequeue 0x40e820000, DCS 1 while the TRB cycle bit was 0. Reproducer exited with status 1.
  • PR xhci: drop the VL805 XHCI_EP_CTX_BROKEN_DCS cycle-state quirk #7754 kernel 6.18.62-v8+, commit 361f8a17bf58615ade0409fe3c97b474f81dcd75: all 1,000 cycles passed, with matching DCS/TRB cycle bits throughout and exit status 0.

Both runs used the same Lexar 05dc:a83a at 480 Mbit/s, the unchanged issue reproducer, and 16 bulk-IN transfers of 65,536 bytes. The storage was cleanly unmounted and its swapfile deactivated for both tests. Kernel logs and the failing endpoint context/TRB ring were preserved.

The PR kernel is now restored and running. This reproduces the specific endpoint stall and confirms the PR passes its regression test on this setup; it does not establish whether this bug caused our earlier whole-host hang.

@popcornmix

Copy link
Copy Markdown
Collaborator Author

Original reported also reported success. @pelwell ?

@pelwell
pelwell merged commit bbafd75 into raspberrypi:rpi-6.18.y Nov 17, 2026
11 of 12 checks passed
popcornmix added a commit to raspberrypi/firmware that referenced this pull request Nov 17, 2026
kernel: spi: rp2040-gpio-bridge: Fix fast_xfer with strict RP1 pinmux
See: raspberrypi/linux#7728

kernel: drm/vc4: hdmi: Reset the MAI FIFO when preparing audio
See: raspberrypi/linux#7751

kernel: configs: Enable NET_SWITCHDEV and ADIN1110 support
See: raspberrypi/linux#7687

kernel: drm/vc4: Use the HVS field bit for interlaced scanout position
See: raspberrypi/linux#7763

kernel: xhci: drop the VL805 XHCI_EP_CTX_BROKEN_DCS cycle-state quirk
See: raspberrypi/linux#7754
popcornmix added a commit to raspberrypi/rpi-firmware that referenced this pull request Nov 17, 2026
kernel: spi: rp2040-gpio-bridge: Fix fast_xfer with strict RP1 pinmux
See: raspberrypi/linux#7728

kernel: drm/vc4: hdmi: Reset the MAI FIFO when preparing audio
See: raspberrypi/linux#7751

kernel: configs: Enable NET_SWITCHDEV and ADIN1110 support
See: raspberrypi/linux#7687

kernel: drm/vc4: Use the HVS field bit for interlaced scanout position
See: raspberrypi/linux#7763

kernel: xhci: drop the VL805 XHCI_EP_CTX_BROKEN_DCS cycle-state quirk
See: raspberrypi/linux#7754
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Pi 4: VL805 bulk IN endpoint stuck forever after URB cancel on rpi-6.18.y

4 participants