Repository navigation
usb: typec: tipd: keep a dock's USB when the display pipeline is taken - #163
invaliddayta wants to merge 1 commit into
Conversation
On a MacBook Air M2 (J413, T8112), a USB-C monitor in one port leaves a dock that offers DisplayPort Alt Mode in the other port without USB. The dock's hub enumerates for a moment, the PHY switches to the DP mode, and the port then never gets a USB role back. Keyboard, mouse and everything else behind the dock stay dead until the monitor is unplugged: tps6598x 0-0038: failed to configure Type-C connection: -28 tps6598x 0-0038: failed to configure Type-C connection: -28 tps6598x 0-0038: failed to configure Type-C connection: -28 tps6598x 0-0038: cable revalidation failed after 3 attempts T8112 has one external display pipeline, and the monitor holds it. The DCP fabric reports that as -ENOSPC on every SoC (dcp_typec_route_set()). cd321x_typec_update_mode() is meant to flag that error as a busy display, so that cd321x_update_work() sets the USB role without the display and does not retry. Commit c1ef888 ("usb: typec: tipd: Retry a display mux that is only busy") gave -ENOSPC that meaning and made -EBUSY a transient error to retry. Commit dea3f3b ("usb: typec: keep the H17 display route handshake") kept that on T8140 and T8142 only, and made -EBUSY the busy display everywhere else. On the other SoCs, -ENOSPC is now retried like any failure. Every attempt fails the same way, and cd321x_update_work() never reaches usb_role_switch_set_role(). No route in this tree reports a taken pipeline as -EBUSY any more, so go back to the single meaning on every SoC. h17_display stays for the H17 HPD rules. Fixes: dea3f3b ("usb: typec: keep the H17 display route handshake") Assisted-by: Claude:claude-opus-5-5 Signed-off-by: Paul Mairhofer <86946817+invaliddayta@users.noreply.github.com>
|
Rebased this branch locally against 186's head (2a37f6f): the two PRs collide in the same function. Overlap:
So this PR was not boot-tested and will need a rebase onto (or with) 186 whichever lands first. Not tested here: no boot run (conflict above), no CI checks reported on this branch yet. |
chriskearney
left a comment
There was a problem hiding this comment.
Reviewed exact head b8930ad8c5d319d74f9c284c764b7df29d879881, all four changes and current DCP/mux/ATC error producers plus DP/USB-role callers. Source/host PASS, subject to required CI and full MQ.
Current no-pipeline/no-free-route errors are ENOSPC. EBUSY can instead mean generic mux-transaction contention or a PHY transition, so keeping the bounded retry for EBUSY is correct. ENOSPC reaches the existing USB continuation without claiming a display route is active. Ownership, PM/removal and retry budgets are unchanged.
115 extracted header/caller assertions pass; the actual base predicate fails 18 intended cases; three compiled semantic mutants are caught. The four changed-component baselines are byte-identical to the author's J413 before/after setup (0/3 vs 10/10 reported dock plugs). No new physical boot is needed solely for this errno correction, and QEMU is not dock/display qualification. Existing USB re-enumeration/mouse-replug limitations remain.
#186 contains an alternative overlapping predicate/test change and is not a dependency. Do not merge both current heads unchanged; its overlapping tipd portion needs resolution preserving the current ENOSPC contract, with its separate DCP changes reviewed independently.
|
J615 combined-stack field observation: the user reports stable unplug/replug and lid-open/closed use on local 7.2.11-dcpexp-usb-recovery-20261108. Its dirty source carries the same -ENOSPC-only cd321x_display_taken() policy, plus deferred routing for no-HPD DP-alt ports (overlapping #186), #357 idle-route reclaim, J615 display/brightness and thermal work. The installed Image matches the local build artifact. This is not an exact-PR-branch build/boot test and does not isolate which change produced the improvement. Current read-only USB inspection shows functioning enumerated HID and UVC devices on USB2 (480M); USB3 root hubs are present but empty. SuperSpeed recovery, provider-order variations and fault injection are not established by this observation. A source-level reclaim-error interaction needing review is documented at #357 (comment) . No duplicate USB PR is being opened. |
|
Same failure on a second SoC and Type-C controller: MacBook Pro 14" M3 Pro (Mac15,6, T6030), sn201202x driver, packaged Setup: two Dell U2412M monitors on two of the three USB-C ports (DP Alt Mode) take both external pipelines. The third port gets a USB-C hub that has a video output, with only a USB keyboard plugged into it. Result: the hub never gets USB, on either free port, every time it is plugged in. No USB device enumerates beyond the root hubs, and the port's xHCI ( The same thing happened after I moved the hub to the right port ( Workaround that did not help: writing So on T6030, Filed by Claude Opus 5.5 via Claude Code. |
|
Same failure on M1 (MacBook Pro 13" 2020, J293, Setup: LG 16MR70 USB-C monitor (DP alt mode) on one port. A USB-C hub with DP alt mode and no display attached (GenesysLogic 05e3:0610/0625) on the other, carrying a C920 webcam and storage. This worked on Before: whichever device connects second gets no USB at all, in either plug order: Patch: I rebuilt only After: the monitor was plugged in at boot and the hub afterwards: There was no revalidation loop. The hub and its devices enumerate, and the monitor stays up. I've only run one session on it so far. This adds t8103 to T8112 (#163), t600x (#186) and T6030 (comment above). Diagnosed and drafted with Claude Code; patch built and verified on my machine. |
I declared it at 7 am and you had it evaluated by lunch. Most reproducible wish I've ever made.
On a MacBook Air M2 (J413, T8112), a USB-C monitor in one port leaves a DP Alt Mode dock in the other port without USB. The dock's hub (VIA Labs 2109:2817/0817) enumerates for a moment and then disappears, and the port never gets a USB role back:
Cause:
-ENOSPCon every SoC (dcp_typec_route_set()).-ENOSPCthe error that means "display taken": tipd then sets up the port's USB without the display and does not retry.-EBUSYthe taken display on every other SoC. So on T8112,-ENOSPCis retried until revalidation gives up, andusb_role_switch_set_role()is never reached.Fix: go back to the one meaning on every SoC:
cd321x_display_taken()isret == -ENOSPCagain, and the KUnit case expects that. I could not find a route in this tree that still reports a taken pipeline as-EBUSY. The remaining-EBUSYsources on that mux chain are the ATC PHY's transitions, which c1ef888 wants retried.h17_displaystays, because the H17 HPD rules use it.If the
-EBUSYbranch for the older SoCs was there for a reason I missed, the narrower alternative isret == -ENOSPC || (!h17 && ret == -EBUSY). That keeps it and still fixes the dock.Tested on J413 (MacBook Air M2, T8112):
cable revalidation failed after 3 attempts.-28events were followed by USB on that port within 3 s;device descriptor read/64, error -32, thendevice not accepting address 6, error -71) until it was replugged.tools/aurora-ci/run-kunit.pyon 34c7dfe plus this patch, arm64 under QEMU TCG): 1396 pass, 0 fail, 3 skip, which matcheskunit-expected.json.checkpatch.pl --strict: 0 errors, 0 warnings.Written with an AI assistant (
Assisted-bytrailer). I reviewed it and tested it on the machine above.