Skip to content

pmdomain: apple: pmp-report: hold a wakeup-path consumer's request through sleep - #401

Open
briantoll wants to merge 1 commit into
omacom:integration/aurorafrom
briantoll:pmp-report-wakeup-path
Open

briantoll wants to merge 1 commit into
omacom:integration/aurorafrom
briantoll:pmp-report-wakeup-path

Conversation

@briantoll

Copy link
Copy Markdown

Problem

With APPLE_USE_PMP on T600x (t6000-j314s today) the display processors take their power domain from pmp-report entries instead of PMGR domains. dcp_platform_suspend() calls device_set_wakeup_path() on every DCP ("which forces its power domains to stay on") because the DCP firmware is not shut down for sleep and cannot be restarted. PMGR honours that: apple_pmgr_ps_probe() gives every domain that is on at boot GENPD_FLAG_ACTIVE_WAKEUP. A pmp-report entry only gets the flag when it is apple,always-on.

pmp-dispext1 (report@e) is not always-on; pmp-disp0 and pmp-dispext0 are. So at suspend_noirq genpd withdraws dcpext1's request, the PMP drops the external display block, and the entry is asserted again at resume with the coprocessor's firmware gone. The first DPTX call on it after the resume times out and a display routed through dcpext1 stays dark until reboot:

apple-dcp 28cc00000.dcp: AFK[ep:2a]: AppleDCPDPTXRemotePort (chan:1) command type 0xc0 tag 0x0000 timed out after 1000 ms
apple-dcp 28cc00000.dcp: dcp_dptx_connect: failed to validate DPTX target 0:1: -110
apple-dcp 28cc00000.dcp: Type-C DPTX reconnect failed after 5 retries: -110
thunderbolt-apple-acio b01ac0000.cio: dpin0: DP tunnel setup failed: -110

followed by tb_dp_wait_dprx: ... DPRX read timeout about a dozen times a second for as long as the display is plugged in. The Thunderbolt side is healthy (device authorized at 40 Gb/s, tunnel paths activate); the external DCP never answers again, and it logs nothing from its RTKit after the resume. A Thunderbolt DP tunnel is routed through dcpext1 here, so a Studio Display XDR plugged in after a sleep hits it every time. The HDMI port and anything on dcpext0 are unaffected because that entry is always-on.

Change

Give every pmp-report entry GENPD_FLAG_ACTIVE_WAKEUP. The flag only holds a request while a consumer is in the wakeup path, which the display processors are; an always-on entry still seeds its request at probe, and an apple,release-for-sleep entry (T6030, b28cb3a) still withdraws its request explicitly in its own noirq callbacks, so nothing changes there. dispext1 stays powered through suspend-to-idle, as it does without PMP (PMGR path) and as dispext0 already does; that saving comes back once the T600x external processor can be restarted after sleep.

The host graph test (tools/asahi/t6030-pmp-graph-tests.py) gets a case with an entry that is not always-on: it is not seeded and it carries the flag. The new mutation wakeup-path-dropped fails that case; the full --mutations run passes (22 cases), and the new case fails against the unfixed source (--ref integration/aurora).

Evidence

MacBook Pro 14" M1 Max (j314c), integration/aurora c46d7dc with a local APPLE_USE_PMP define for j314c, Studio Display XDR over a Thunderbolt DP tunnel on the left-front port:

date PMP sleep before the plug result
2026-11-03 08:43 off 3 s2idle cycles both tiles up within 2 s
2026-11-03 18:37 off 5 more s2idle cycles both tiles up
2026-11-04 17:48 on 5 s2idle cycles, last one 4 h DPTX -110, dark until reboot
2026-11-06 21:24 on one s2idle of 4 h 46 min DPTX -110, dark until reboot

Live genpd summary with PMP on and nothing attached: pmp-disp0, pmp-dispext0, pmp-dispext1 on; dcpext1 has no runtime PM, so only system sleep ever takes its request away.

Tested

Same machine, PMP on (PMP manages fabric and DCS p-states), kernel = integration/aurora c46d7dc + this change, 2026-11-06 22:12: XDR unplugged, suspend-to-idle 22:09:13 to 22:12:08, display plugged in one second after the resume. It connects through dcpext1 exactly as before the sleep: 28cc00000.dcp: dcp_dptx_connect_session(port=0) passes validate and connect, dpin0/dpin1: DP tunnel up, both tiles at 5120x2880@60, no -110 anywhere in the log. The unfixed kernel failed on the first DPTX call within a second of the same plug.

Host test: tools/asahi/t6030-pmp-graph-tests.py --mutations passes (22 cases); --ref integration/aurora (unfixed driver, new test) fails on the new assertion.

🤖 Generated with Claude Code

…rough sleep

On T600x with APPLE_USE_PMP the display processors take their power
domain from pmp-report entries instead of PMGR domains.
dcp_platform_suspend() sets the wakeup path on the processor, "which
forces its power domains to stay on", because the DCP firmware is not
shut down for sleep and cannot be restarted. The PMGR domains honour
that: apple_pmgr_ps_probe() gives every domain that is on at boot
GENPD_FLAG_ACTIVE_WAKEUP. A pmp-report entry gets the flag only when it
is apple,always-on.

pmp-dispext1 is not. For a plain entry genpd withdraws the request at
suspend_noirq, the PMP drops the external display block, and the entry
is asserted again at resume with dcpext1's firmware gone. The first DPTX
call on it after the resume times out, and a display routed through it
stays dark until reboot:

  apple-dcp 28cc00000.dcp: AFK[ep:2a]: AppleDCPDPTXRemotePort (chan:1) command type 0xc0 tag 0x0000 timed out after 1000 ms
  apple-dcp 28cc00000.dcp: dcp_dptx_connect: failed to validate DPTX target 0:1: -110
  apple-dcp 28cc00000.dcp: Type-C DPTX reconnect failed after 5 retries: -110
  thunderbolt-apple-acio b01ac0000.cio: dpin0: DP tunnel setup failed: -110

followed by tb_dp_wait_dprx "DPRX read timeout" a dozen times a second
for as long as the display is plugged in. pmp-dispext0 is always-on, so
the HDMI port and a display routed through dcpext0 do not show it; a
Thunderbolt DP tunnel is routed through dcpext1 here.

Give every entry GENPD_FLAG_ACTIVE_WAKEUP. It only holds a request while
a consumer is in the wakeup path, which the display processors are. An
always-on entry still seeds its request at probe, and an
apple,release-for-sleep entry still withdraws its request explicitly in
its own noirq callbacks. dispext1 stays powered through suspend-to-idle,
as it does without PMP and as dispext0 already does; the saving returns
once the T600x processor can be restarted after sleep.

The host graph test gets a case with an entry that is not always-on: it
is not seeded and it carries the flag, and the mutation that drops the
flag fails it.

Seen on a MacBook Pro 14" M1 Max (j314c) with PMP enabled and a Studio
Display XDR plugged in after a resume from suspend-to-idle: two of two
plugs after a resume failed this way, and the same kernel without PMP
connected the display after three and after five sleep cycles.
With the change, on the same machine and PMP configuration, the display
plugged in one second after a resume from a three-minute suspend-to-idle
connects through dcpext1 as before the sleep: validate, connect and link
training on 28cc00000.dcp complete, both tiles come up at 5120x2880@60.

Fixes: 96151d9 ("pmdomain: apple: Add PMP reporting interface")
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Signed-off-by: Brian Toll <[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