Skip to content

soc: apple: display gate: bring the T6041 externals up on a late PMP - #905

Merged
RyanTheTide merged 2 commits into
integration/aurorafrom
fix/t6041-display-late-pmp
Nov 3, 2026
Merged

RyanTheTide merged 2 commits into
integration/aurorafrom
fix/t6041-display-late-pmp

Conversation

@RyanTheTide

Copy link
Copy Markdown
Contributor

On an encrypted root the T6041 display gate gave up on the M4 Pro external displays for the whole boot. apple-pmp.ko loads only after the passphrase, the gate's 20 s PMP wait ran out first, and the PMP that bound at 55 s was ignored:

[    0.047972] apple-t6041-display: routes enabled, waiting for the PMP
[   20.454084] apple-t6041-display: no PMP within 20000 ms: external displays stay off, internal panel only (0)
[   55.476793] apple_pmp 500700000.pmp: PMP firmware and endpoint ready

The distro side (apple-pmp and appledrm in the initramfs) is aurora-silicon/alarm-aurora#117. This is the kernel side, so a late PMP bind works on every distro.

What changes

  • The display subsystem stays held back until the PMP binds, however late. appledrm needs apple-pmp's symbols, so nothing could drive a display before that anyway.
  • At the 20 s deadline the Type-C port controllers are let go with the USB muxes only, with the routes disabled again, as the old fallback did. A Type-C keyboard works at the passphrase prompt.
  • A PMP that binds after the deadline runs the normal power-up. The routes come back in the same changeset as both DCPs and /display-subsystem, so each dcpext registers them when it probes, and the display master is still created once with every DART in its iommus.
  • Once every processor that still has an enabled route is bound, the released port controllers that are still wired to an enabled route get the managed device link that fw_devlink would have made from the held fwnode link, and they are probed again, once. That drops their USB host for a moment after the PMP binds. A controller whose processor gave up on its routes keeps its USB-only probe.
  • The internal-panel fallback stays for a PMP whose probe failed (BUS_NOTIFY_DRIVER_NOT_BOUND). One still unbound at the deadline falls back there, and past the deadline it gets 20 s after the failure, because a deferral sends NOT_BOUND too. A failed power-up falls back as before.
  • The power-up steps are now a small state machine (waiting, released, started, fallback). Its transition function has a new KUnit suite, apple-display-gate-t6041.
  • Comment blocks, Kconfig help and the KUnit help are updated to match.

On an unencrypted install (PMP bound at about 1.8 s) nothing changes: stage 0, stage 1, then processors and display subsystem.

Tested

  • kunit.py run --arch=arm64 (native gcc, qemu virt) with APPLE_DISPLAY_GATE, its KUnit test and PROVE_LOCKING: 49/49 pass, including the existing T6030, T6031 and T8122 suites.
  • make W=1 drivers/soc/apple/ for arm64 (gcc): no warnings.
  • checkpatch --strict: one long user-visible printk string left unsplit, and two DECLARE_WORK / notifier lines right after their functions, matching the existing code.

Needs hardware

Not run on a J616s yet. Needed:

  1. An encrypted-root boot with the externals plugged in. Expect the deadline info line, then stage 0/1, "processors and display subsystem enabled" and "N Type-C port controllers probed again with the display routes" after the passphrase, and working HDMI and Type-C DP.
  2. A Type-C USB keyboard at the passphrase prompt. Check that it comes back after the one re-probe.
  3. An unencrypted boot shows no regression.
  4. If possible, a forced PMP probe failure to check the internal-panel fallback.

🤖 Generated with Claude Code

RyanTheTide and others added 2 commits November 3, 2026 23:04
The T6041 gate powers the M4 Pro external display chain up when the PMP
binds. If that took more than 20 s it fell back to the internal panel
and ignored a PMP that bound later, for the whole boot. On an encrypted
root apple-pmp.ko lives on the root file system and loads only after
the passphrase, so a J616s showed

  apple-t6041-display: no PMP within 20000 ms: external displays stay off, internal panel only (0)
  apple_pmp 500700000.pmp: PMP firmware and endpoint ready

at 20 s and 55 s, and never had external displays.

Holding the display subsystem back past the deadline costs nothing:
appledrm needs apple-pmp's symbols, so it cannot drive any display
before the PMP is there. The deadline now only lets the Type-C port
controllers go with the USB muxes only, so that a Type-C keyboard works
at the passphrase prompt; the routes are disabled again for that, as
the fallback did. A PMP that binds later, before or after the deadline,
powers the chain up. Past the deadline the routes come back in the same
changeset as the processors and the display subsystem, so each
processor registers them when it probes and the display master is still
created once with every DART in its iommus.

The released controllers then need the display mode switches. Probing
a controller again takes its USB host down, so it is done once, and
only for the controllers still wired to an enabled route, after every
processor that still has an enabled route is bound (bus notifier,
BOUND or NOT_BOUND of a processor). Each gets the managed link to its
processor that fw_devlink would have made of the held controller's
fwnode link, so a processor that unbinds still takes its controllers
along. A controller whose routes its processor gave up on keeps its
USB-only probe.

The internal panel fallback stays, for a PMP whose probe failed: one
still unbound at the deadline, or STAGED_PMP_WAIT_MS after a failure
past the deadline. NOT_BOUND is also sent for a deferral, so a deferring
PMP gets that long to bind. A power-up that fails falls back as before.

The steps of the power-up are now a small state machine (waiting,
released, started, fallback) whose transition function the display gate
KUnit test checks, in a new T6041 suite.

Assisted-by: LLM
Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
@RyanTheTide

Copy link
Copy Markdown
Contributor Author

Hardware test, 2026-11-04 (fleet16 merge lane)

Kernel 7.3.0-aurora-f16c1: integration/aurora 67c64c8 plus this PR plus #902, using the fleet15 recipe and config (unchanged). The merged tree equals this branch (7262c1a) merged with #902 (3e6e80c). All boots were one-shot; fleet15 stayed the default.

J616s (T6041), against the fleet15 baseline 348af05f

  • Normal boot, efa93e63. Unchanged:
    • stage 0/1, then "processors and display subsystem enabled";
    • eDP-1, DP-2 (Acer QG270) and DP-3 (MSI MPG 325CQRXF) are all enabled;
    • -p 3 is 0/0, there are 0 new AVCs, no failed units, and Wi-Fi and Touch ID work.
  • Late-PMP repro without LUKS, e3846ed9. A one-shot entry with modprobe.blacklist=apple_pmp,appledrm,aurora,apple_pmp_thermal, and a timer that ran modprobe at 40.1 s and then restarted gdm:
    [20.606] apple-t6041-display: no PMP within 20000 ms: Type-C ports on USB only, external displays wait for it (0)
    [40.261] apple_pmp 500700000.pmp: PMP firmware and endpoint ready
    [40.266] apple-t6041-display: stage 0 enabled
    [40.269] apple-t6041-display: stage 1 enabled
    [43.963] apple-t6041-display: processors and display subsystem enabled
    [44.379] apple-t6041-display: 3 Type-C port controllers probed again with the display routes
    
    • The dock's USB keyboard (SteelSeries Apex Pro) enumerated at 22.7 s, during the USB-only window.
    • It dropped at 40.5-44.2 s for the re-probe and was back at 45.6 s.
    • Afterwards all three displays were enabled in Mutter and Touch ID was restored. The row was clean: -p 3 0, 0 AVCs, no failed units.
  • Negative control: fleet15 with the same late PMP, ee62d21b. "no PMP within 20000 ms: external displays stay off, internal panel only", and only eDP-1 exists. The repro shows the bug, and this PR fixes it.
  • Not covered:
    • an actual LUKS install;
    • a forced PMP probe failure, the internal-panel fallback (test plan item 4).

Neo (T8140) and M2 (T8112): the same f16c1 boots are row-clean against fleet15, with no change. Details are on #902.

Gates (buildbox)

  • W=1 on drivers/soc/apple/display-gate.o: 0 new warnings.
  • display-gate KUnit (arm64, LLVM, DEBUG_KERNEL + PROVE_LOCKING): 49/49, against 48/48 on the base.
  • run-host-tests: 180/180. apple-dcp selftests: 85/85.
  • DTBs are identical to the base.

Assisted-by: LLM

🤖 Generated with Claude Code

@RyanTheTide
RyanTheTide merged commit e938f97 into integration/aurora Nov 3, 2026
@RyanTheTide
RyanTheTide deleted the fix/t6041-display-late-pmp branch November 3, 2026 17:43
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