Repository navigation
usb: typec: tipd: keep a dock's USB when the display pipeline is taken - #163
Open
invaliddayta wants to merge 1 commit into
Open
invaliddayta wants to merge 1 commit into
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 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.