Skip to content

soc: apple: display gate: let the port controllers wait instead of probing them again - #564

Merged
RyanTheTide merged 2 commits into
integration/aurorafrom
fix/display-gate-no-port-reprobe
Oct 29, 2026
Merged

RyanTheTide merged 2 commits into
integration/aurorafrom
fix/display-gate-no-port-reprobe

Conversation

@RyanTheTide

Copy link
Copy Markdown
Contributor

On the J616s, boots now and then stopped about 8 s in. The screen froze on the USB lines, PID 1 made no further progress after "Finished systemd-vconsole-setup", and the machine had to be reset. Four of the J616s boots on the night of 28 October stopped this way, and one the night before.

Cause

  • The T6041 stage in display-gate enables dcpext1, the processor that registers the routes' Type-C mode switches, only once the PMP is bound. The Type-C port controllers (sn201202x) usually probe before that. The Type-C core passes over a mode switch inside a disabled node, so they took only the USB muxes.
  • Once dcpext1 was bound, the stage called device_reprobe() on each port controller wired to a route, so that it would take the display muxes too.
  • Probing again unbinds first. cd321x_remove() drops the USB role, so dwc3 removed its xHCI host ("remove, state 1" on both buses) and the USB3 PHY went to sleep. That happened about 7.7 s into every such boot, right after the SuperSpeed root hub had registered and while udev and the devices behind a dock were being enumerated. The port controllers then probed again and USB came back about 1.4 s later.
  • Every frozen boot stopped inside that window. Of 22 boots on 28 October with full logs, 17 went through this teardown and 5 did not, because their port controllers happened to probe after dcpext1.

Change

  • When the stage prepares the tree, it adds a supplier link from each port controller wired to a route to the processor that registers that route. The device core then defers the port controller until that processor is bound, so it probes once, with every mux it is wired to, and USB comes up once.
  • If the stage falls back to the internal panel, it drops those links and attaches the port controllers, which then probe with the USB muxes only, as before.
  • staged_reprobe_port_controllers() and its device_reprobe() are gone.
  • If the PMP never binds, the port controllers now wait for the stage's fallback (20 s) before they probe. That only happens on a machine where the external displays cannot come up anyway.
  • Only the T6041 path changes. The other SoCs in display-gate do not run this code, and the Neo (T8140) does not use display-gate.

Testing on the J616s (test kernel: fleet4 with only this commit added)

  • Warm reboot loop over Wi-Fi, two fast reboots (about 16 s after boot) for every normal one. The dock was unplugged tonight, so this ran with the MSI on Type-C (DP-2) and the internal panel. The re-probe used to happen on every boot regardless of the dock.
  • In progress; final numbers follow in a comment. So far every boot: no "probed again", xHCI brought up once and never removed, eDP and DP-2 connected, GDM running, port controller bound, no freeze.
  • checkpatch is clean and the file builds with no warnings.

Still to do

  • A dock-attached loop once the dock is back on the J616s.
  • A Neo boot of this kernel as a sanity check, through the fleet kit.

🤖 Generated with Claude Code

…obing them again

The T6041 stage enables dcpext1, the processor that registers the routes'
Type-C mode switches, only once the PMP is bound. The Type-C port
controllers usually probe before that. The Type-C core passes over a
mode switch inside a disabled node, so they took only the USB muxes, and
once dcpext1 was bound the stage probed each of them again to take the
display ones too.

Probing a port controller again unbinds it first, and its remove drops
the USB role, so dwc3 removed its xHCI host and the PHY went to sleep.
That happened about 7.7 s into every such boot, right after the
SuperSpeed root hub had registered and while udev and the devices behind
a dock were being enumerated. The host came back about 1.4 s later. On
the J616s with a dock attached, boots now and then stopped there, with
PID 1 making no further progress.

Add a supplier link from each port controller wired to a route to the
processor that registers that route, when the stage prepares the tree.
The device core then defers the port controller until the processor is
bound, so it probes once and takes every mux it is wired to, and USB
comes up once. If the stage falls back to the internal panel, drop the
links and attach the port controllers, which then probe with the USB
muxes as before.

Assisted-by: LLM
Signed-off-by: Ryan Murray <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
@RyanTheTide

Copy link
Copy Markdown
Contributor Author

Loop result on the J616s, test kernel fleet4 + this commit:

  • 21 of 21 warm reboots clean: 14 fast (reboot about 16 s after boot) and 7 normal (about 76 s after boot), over Wi-Fi, dock unplugged.
  • Every boot: no "probed again for the display routes", the xHCI host brought up once and never removed, eDP and DP-2 (MSI on Type-C) connected and enabled with an active CRTC, GDM running, port controller bound.
  • Startup averaged 12.86 s (12.30 to 14.79 s).
  • The xHCI host still comes up at about 4.4 s and its SuperSpeed root hub registers at about 6.0 s, when the stage enables the processors. It now stays up instead of being torn down at 7.7 s.

Still to do: a dock-attached loop once the dock is back on the J616s, and a Neo sanity boot through the fleet kit.

🤖 Generated with Claude Code

…bled

A port controller whose node is disabled never gets a device. The link
from it to the route's processor then lands on its nearest device, the
already bound SPMI controller, as a sync-state-only link, which the
device core refuses with an error on every boot:

  apple-spmi 509188000.spmi: Failed to create device link (0x180) with
  supplier 602e00000.dcp for /spmi@509188000/usb-pd@c

There is nothing to hold for such a controller, so add the link only for
the enabled ones.

Assisted-by: LLM
Signed-off-by: Ryan Murray <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
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.

1 participant