Repository navigation
usb: typec: tipd: keep a dock's USB when its display has no pipeline (M1/M2) - #1023
Merged
Merged
Conversation
…line The DCP route reports a Type-C port that finds no free display pipeline as -ENOSPC on every SoC (dcp_typec_route_set()). cd321x_display_taken() took -ENOSPC as a taken display only on T8140 and T8142, a leftover from when the route still returned -EBUSY on the other SoCs. On an M1 or M2, which have one external display pipeline, a monitor on one port and a dock on the other therefore failed the dock's whole Type-C connection: "failed to configure Type-C connection: -28" three times, then "cable revalidation failed". The mux transaction was aborted and retried, and the dock's USB devices and network never came up. Take -ENOSPC as a taken display on every SoC. The port then sets up its USB path without the display, as on T8140 and T8142, and the DCP route gives the display a pipeline when one frees. -EBUSY keeps its meaning on each SoC. Log the waiting display at debug level: the DCP route already says which display waits. Assisted-by: LLM Signed-off-by: Ryan Murray <[email protected]>
The previous commit took -ENOSPC as a taken display everywhere but kept -EBUSY as one on SoCs other than T8140 and T8142. That -EBUSY rule dates from when the DCP route still returned it for a taken pipeline there. The route now returns -EBUSY only for a crossbar or PHY that is mid-transition, which clears on its own and should be retried, as it already is on T8140 and T8142. Use one rule on every SoC: -ENOSPC is a taken display, anything else is retried. This is the contract the apple-dcp selftests already expect from a tree with the single-argument helper. Assisted-by: LLM Signed-off-by: Ryan Murray <[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.
On an M1 or M2 with a monitor on one USB-C port and a dock on the other, the dock's USB never came up, so nothing behind it worked (keyboard, mouse, storage, wired network). The log had three "failed to configure Type-C connection: -28" lines and "cable revalidation failed".
These Macs have one external display pipeline. The monitor holds it, so the DCP route answers the dock's DP alt mode with -ENOSPC ("no free pipeline"), which it does on every SoC now. tipd only treated -ENOSPC as a taken display on T8140/T8142 and still expected -EBUSY elsewhere, left over from when the route returned -EBUSY. So on M1/M2 the whole mux transaction failed and was retried until it gave up, and the dock's USB path was never set.
With this, -ENOSPC means a taken display on every SoC. The port sets up USB without the display (the same path the Neo already takes) and the DCP route gives the dock's display a pipeline when the other monitor goes away. -EBUSY is retried everywhere, which is what the route means by it now. The warning for this case is now debug only, since the DCP route already logs which display waits.
Tested on the M2 (fleet17 + this, one-shot boot):
M1 Pro regression boot: no change to its Type-C ports, 0 AVCs. Host tests 185/185, including the apple-dcp typec-probe and lifecycle selftests that already expect the single-argument helper.
🤖 Generated with Claude Code