Repository navigation
drm/apple: keep what a running DCP drives through s2idle (DP audio, DP PHY, HDMI link) - #2953
Conversation
A DCP that keeps its coprocessor running through a system sleep sets its wakeup path in its suspend, so genpd keeps its power domains on. The DP audio block that DCP firmware drives sits in a domain of its own, which the dp-audio device holds only while runtime-active: its late sleep callback suspends it, and genpd powers the domain off at noirq under the still running DCP firmware. On the Mac mini M2 (J473, macOS 27.2 firmware), once Linux has started the primary DCP, s2idle then hard-resets the machine almost every time (19 of 20 attempts, no log). The J473 is the M2 machine that enables the primary DCP's DP audio block; the external DCP's block, enabled on every M2, sits in a domain marked always-on. With the dp-audio device unbound, which leaves the domain held, the same kernel passes 5 of 5 sleeps in one boot; with appledrm not loaded, 4 of 4; and the production kernel, which never starts that DCP, 5 of 5. Hold the domain from the late callback when the linked DCP has set its wakeup path for this sleep, or has no driver bound (its firmware may still run, left by a boot stage or an earlier bind). Every device's .suspend has run by then, so the DCP's choice is known. The decision comes from the DCP's own sleep state and the OF graph link, not from the SoC or firmware version. Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
Build the real dcpaud_suspend_late() and dcpaud_pm_ops from drivers/gpu/drm/apple/audio.c against stubs and run every combination of OF graph link, DCP device, bound driver, DCP wakeup path and runtime force-suspend result. The domain is held exactly when the linked DCP is on its own wakeup path or has no driver; every reference is dropped; pm_runtime_force_suspend() runs once and its result is returned; the late sleep slots carry the new callback. Four mutations (bound-only, leak-device, leak-node, invert-wakeup) and the code before the change must fail. Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
DjDeveloperr
left a comment
There was a problem hiding this comment.
Formal §1–§6 pre-PR checklist review at live head 16930559199091aa1f83267934a31d5ac4e1455c (CI green: host-tests).
Technical Audit
drivers/gpu/drm/apple/audio.c(dcpaud_suspend_late): Looks up the linked DCP via OF graph (port@0/endpoint@0->of_graph_get_remote_port_parent->of_find_device_by_node), setsdevice_set_wakeup_path(dev)when!device_is_bound(&dcp_pdev->dev) || device_wakeup_path(&dcp_pdev->dev), drops all node/device references, and delegates topm_runtime_force_suspend(dev).- Host test (
tools/asahi/dcpaud-sleep-hold-tests.py): Clean 128-case topology/refcount matrix with 4 mutations and old-code negative control (a7638d51880c).
Checklist Summary
- §1 No model gating: Needs cross-Mac proof (mechanism itself has no chip/board/FW gates, but per §1 the change must be proven across the other lab Macs that contain a DP audio block — see Blocker 1).
- §2 Production-ready: Pass (default cmdline, no module params, no sleeps/retries).
- §3 Safety: Pass (no hardcoded safety limits).
- §4 Clean-room & attribution: Pass. Both commits (
7e8f0dce,16930559) have human author/committer (Ryan Murray) andSigned-off-by:, zero AI trailers in commits; PR body ends withAssisted-by:. - §5 Evidence: Fail (see Blockers 1 & 2).
- §6 Naming: Pass.
Blockers
- §1 / §5 — Unverified cross-Mac & S2R impact (
device_wakeup_path()is also set when DCP stops firmware): The PR description states "no change expected where the DCP stops its firmware for the sleep or the block is already always-on." However, indrivers/gpu/drm/apple/dcp.c,dcp_s2r_suspend()(dcp.c:8850),dcp_s2r_ext_suspend()(dcp.c:8796), andiomfb_m4_suspend()(dcp.c:9802) all calldevice_set_wakeup_path(dcp->dev)even when the DCP coprocessor is stopped for sleep (onlydcp_v27_sleep_suspend()andext_deadomit it). Consequently, on Macs whose DP audio domains are notapple,always-on(e.g., M4 Props_dpa1/ps_dpa2, Neops_dpa1, M5ps_dispext0_adma),dcpaud_suspend_late()will also setwakeup_pathduring S2R/s2idle whenever those domains carryGENPD_FLAG_ACTIVE_WAKEUP. Per §1 ("Prove the change on every Mac you have that contains the block") and §5, run the pending s2idle and S2R regression rows on the other lab Macs with DP audio blocks (M2 Air, M1 Pro, M4 Pro, Neo) and either confirm holdingdpa*across S2R is benign or narrow the condition so stopped-firmware S2R paths do not hold the domain unnecessarily. - §5 — Full regression triad & unmerged stack dependency: The J473 row ran on
fleet82 + #2853 + #2868(both unmerged;#2853is still OPEN/DIRTY) and reportsEnforcing, 0 AVCwithout0 failed unitsand0 new kernel errors. Please include the full §5 regression check (0 SELinux denials, 0 failed units, 0 new kernel errors) alongside the cross-Mac rows.
Non-blocking nits
device_is_bound()locking contract (drivers/gpu/drm/apple/audio.c:2097):drivers/base/dd.c:438documents thatdevice_is_bound()must be called withdevice_lock()held, anddevice_suspend_late()does not holddevice_lock(&dcp_pdev->dev). Takingdevice_lock(&dcp_pdev->dev)around the check (or usingdevice_trylock/ checkingREAD_ONCE(dcp_pdev->dev.driver)) would satisfy the driver-core locking contract cleanly.
Assisted-by: LLM (Gemini 4 Neon)
…e runs dcpaud_suspend_late() kept the DP audio domain whenever the linked DCP was on its wakeup path. The DCP's suspend also sets that path where it stops its firmware (the S2R stops, the T8132 external stop and power gate), so on those sleeps the domain stayed on with nothing using it. Have the DCP record whether its suspend left the coprocessor running (the default hold, a retained external DCP, a running T8132 DCP) and read that from the DP audio late suspend through dcp_sleep_keeps_firmware(). A DCP without a driver still counts as running, as before. The driver data is read under the DCP's device lock. The host test now builds dcp_sleep_keeps_firmware() too and checks the lock; its mutations cover holding for a stopped DCP, inverting the flag, dropping the unbound case and skipping the lock. Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
RyanTheTide
left a comment
There was a problem hiding this comment.
Independent source review at d64d9816b3de. The updated late callback uses the DCP's suspend decision instead of its wakeup bit and holds a device reference while reading driver state. Please add the final J473 row with the live DCP stack: verify dpa0 stays on in the noirq interval across short s2idle cycles and DP audio enumerates again after wake. The 13.5 Air's no-regression row exercises a different PM domain. Include the USB4 peer-drop variant once #2868 makes the route available.
… test dcpext26-suspend-route-tests builds the retained-external block of dcp_platform_suspend() against its own struct apple_dcp, which now needs the sleep_fw_runs field that block sets. Add it, and check that the flag is set together with the wakeup path and stays clear when the retained sleep is refused (firmware not running, disconnect failure). Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
|
Cross-Mac regression results for the v2 driver on the stock fleet85 command lines and production Stage 2. The signed
The completed rows were Enforcing with zero AVC denials, zero failed units, and no new kernel error signatures. The recurring DWC3 prepare error also appears on the stock rows. Each short cycle used a 12-second RTC wake. J473 with both firmware-27.2 DCP routes active still needs the v2 A/B on the same stack, including the dpa0 noirq power state and post-wake ALSA ELD and PipeWire availability. The USB4 peer-disconnect case also remains open. |
RyanTheTide
left a comment
There was a problem hiding this comment.
Re-review at 19f90d0. The driver now uses a firmware-runs flag set by the DCP suspend branch, separate from the wakeup-path bit used by stopped-firmware paths. The late callback reads the bound device and its state under the device lock. The updated retained-route fixture compiles and passes its native26, H17P and rollback cases. The DP-audio matrix also passed 128/128 and held the domain in six cases. Host and KUnit checks are green at this head.
Please describe the helper as late-suspend only. Its current kernel-doc also names noirq as a valid caller, but device_lock() can sleep there. The hardware items remain a J473 combined 27.2 DCP/DP-audio row at the v2 driver revision, with the full regression checks, and the remaining shared-path rows.
|
J413 (MacBook Air M2, T8112, 13.5 stub), fleet85
Both arms logged the same pre-existing dwc3-apple Current PR head |
|
Host and arm64 QEMU regression row at
The J473 |
It takes the DCP's device lock, which can sleep, so a noirq caller must not use it. Its only caller is the DP audio late suspend. Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
RyanTheTide
left a comment
There was a problem hiding this comment.
Re-reviewed 002e5071067d. The kernel-doc now restricts the helper to late suspend and explains the sleepable device lock. The cumulative delta since 19f90d0e8a3a changes that comment only. The DP-audio PM entry point remains wired to late suspend.
On the exact new source, the host matrix passed 128/128, including six domain holds, and the retained-route fixture passed its native v26, H17P, PM refusal and disconnect rollback checks. That closes my documentation finding. The J473 combined v27.2 DCP and DP-audio resume row remains open.
|
Hardware provenance for
The completed rows used the default command line, production Stage 2 and short RTC wakes. They had zero AVCs, failed units or new kernel error signatures. An earlier J316s attempt reset when its USB4 peer rebooted. The live J473 |
DjDeveloperr
left a comment
There was a problem hiding this comment.
Formal §1–§6 pre-PR checklist re-review at verified live head 002e5071067d1c7ae3cb28dd81aff48115c06652 (CI 2/2 green: Apple DRM KUnit / kunit, Host tests / host-tests).
Prior Finding Verification
- Stopped-firmware S2R/T8132 over-holding (Prior Blocker 1) — FIXED:
dcp_platform_suspend()now tracksdcp->sleep_fw_runsseparately fromdevice_wakeup_path(), clearing it at both suspend entry (dcp.c:9773) and resume entry (dcp.c:9931), setting it only when firmware remains running (iomfb_m4when!iomfb_m4_sleep_stopped(dcp)underdcp->lock, retained external, and default hold), and leaving itfalseondcp_s2r_suspend(),dcp_s2r_ext_suspend(),dcp_v27_sleep_suspend(),ext_dead, and refused-suspend paths. - Driver-core locking & documentation (Prior Nit) — FIXED:
dcp_sleep_keeps_firmware()(dcp.c:9755-9767) readsdev->driveranddrvdataunderdevice_lock(dev)(with no AB-BA inversion sincedcp_platform_pm_opshas no.suspend_late) and documents late-suspend-only calling context (002e5071067d). - Cross-Mac non-regression (Prior Blocker 1) — FIXED: fleet85 A/B rows on J413 (3/3 s2idle), J700 (5/5 s2idle, 3/3 deep), J316s (4/4 s2idle with USB4 peer quiet), and J616s (3/3 s2idle) are complete with Enforcing / 0 AVC / 0 failed units / 0 new kernel errors.
- Refcounting & PM lifecycle audit:
dcpaud_suspend_late()(audio.c:2085-2105) balances all OF node andplatform_devicereferences, delegates topm_runtime_force_suspend(dev), anddevice_prepare()resetsdev->power.wakeup_pathat the start of every sleep cycle. Host tests (dcpaud-sleep-hold-tests: 128 cases + 7 mutations + old-code negative control;dcpext26-suspend-route-tests+ 2 mutations) all pass in CI.
Checklist Summary
- §1 No model gating: Pass (uses OF graph link and DCP sleep state; cross-Mac non-regression complete).
- §2 Production-ready: Pass (no new parameters, sleeps, or hacks).
- §3 Safety: Pass (0 code/locking/refcount blockers).
- §4 Clean-room & attribution: Pass (all 5 commits carry human author/committer
Ryan Murray <ryan@aurorasilicon.org>and humanSigned-off-by:only, zero AI trailers in commits; PR body disclosure present). - §5 Evidence: Blocked — see below.
- §6 Naming: Pass.
Remaining Blocker
- §5 — Owed v2 affected-hardware row on J473 (Mac mini M2): None of the four cross-Mac non-regression Macs exercise the
dpa0active-wakeup hold path in hardware (dpa1on J413 is always-on;dpa1/dpa2on J700, J316s, and J616s lackGENPD_FLAG_ACTIVE_WAKEUP). As noted in## Still to runand your comment at002e5071067d, the target J473 row has not yet been run on the v2 driver (d64d9816b3de/002e5071067d) withdpa0noirq domain logging, post-wake DP audio enumeration, and the full §5 regression triad (SELinux Enforcing, 0 AVC denials, 0 failed units, 0 new kernel errors).
Verdict
REQUEST_CHANGES — code and CI are clean; ready to approve once the owed J473 v2 hardware row and full regression triad are posted.
Assisted-by: LLM (Gemini 4 Neon)
|
J473 (M2 mini) booted a guarded 27.2 DCP test kernel containing the exact PR head The first 12-second Apple PMU RTC freeze reset the machine at the scheduled wake. The GPU had reported a compute timeout earlier in the same boot, and one systemd unit had already failed before suspend. The reset prevented capture of the noirq transition log and post-wake DP-audio enumeration. Fleet85 came back as the saved default with This run establishes the live setup and records the reset. The isolated dpa0 hold and post-wake enumeration row with a clean regression tuple remains open. Assisted-by: LLM (Codex) |
…a sleep A DCP that keeps its coprocessor running through a sleep puts itself on the wakeup path, so genpd leaves its own domains up. The DP PHY that its firmware drives is a separate device under its own domain, and genpd powers that domain off at noirq like any other. With the firmware still running, that resets the SoC: on the M2 Mac mini (J473) with firmware 27.2, s2idle reset in the first freeze whenever a DCP driver was bound, both for the HDMI dcpext (dptx_ext_phy) and for the USB-C primary (its route's ATC PHY). Holding both PHY domains on through the sleep was enough for the sleep to pass; holding either one alone was not. Where the suspend leaves the firmware running (sleep_fw_runs), also put the provider devices of the DCP's dp-phy and of its active Type-C route's PHY on the wakeup path. A DCP that stops its firmware for the sleep leaves its PHYs to genpd as before. Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
Build the real dcp_phy_set_wakeup_path() and dcp_sleep_hold_phys() from dcp.c against a small driver-core model and check which PHY providers end up on the wakeup path: a dcpext's own dp-phy, a primary's Type-C route PHY, both, neither, an error pointer from the optional lookup and a PHY without a provider. Four mutations (no route PHY, no own PHY, the class device instead of the provider, no error check) must fail. Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
|
MERGETRAIN6 source review at The affected J473 row still reset before post-wake verification. Please qualify the exact integrated driver with both PHY and audio domains kept over three short RTC wakes, both displays active, and the DP audio endpoints still present after wake. The PHY fix can be verified on the production DT without enabling audio playback. Assisted-by: LLM (Codex) |
|
MERGETRAIN6 review at Blocking in the added PHY change: PMGR providers that start off only honor a consumer wakeup-path mark if they advertise active wakeup. The J473 PHY provider nodes in the trial DT lack the explicit capability, so cold/no-sink boot followed by a late plug still needs coverage and a scoped provider fix where necessary. Please also snapshot the active route and its PHY under the fabric lock. The final J473 row should verify that both outputs relight and that DP audio endpoints remain visible after wake, with a peer regression on the same code. Assisted-by: LLM (Codex) |
DjDeveloperr
left a comment
There was a problem hiding this comment.
Formal §1–§6 pre-PR checklist re-review at verified live head c672252ba5d2569273cf90b1bc6b01fbf5ba8361 (CI: Apple DRM KUnit / kunit SUCCESS, Host tests / host-tests FAILURE).
Delta Audit (3437a5a3730e, c672252ba5d2)
dcp_phy_set_wakeup_path()/dcp_sleep_hold_phys()(drivers/gpu/drm/apple/dcp.c:9775-9788): Clean, hardware-driven mechanism putting the provider devices (phy->dev.parent) ofdcp->phyandREAD_ONCE(dcp->active_typec_route)->phyon the wakeup path only whendcp->sleep_fw_runsis true (iomfb_m4when!iomfb_m4_sleep_stopped(dcp), retained external, and default hold). Stopped-firmware paths (dcp_s2r_suspend,dcp_s2r_ext_suspend,dcp_v27_sleep_suspend,ext_dead) remain untouched.tools/asahi/dcp-sleep-phy-hold-tests.py: Good topology and mutation coverage (6 topologies, 4 mutations).- J473 hardware progress: s2idle 5/5 in one boot at
c672252b(integration/aurora 0f111a0d+#2953+#2868+#2853, default cmdline, production Stage 2f13056d9, Enforcing, 0 AVC, 0 failed units) is a great step forward.
Checklist Summary
- §1 No model gating: Code has no SoC/board/FW gate; cross-Mac hardware proof for the new PHY-hold path is still owed (Blocker 2).
- §2 Production-ready / CI: Blocked —
host-testsCI fails (Blocker 1). - §3 Safety: Pass in mechanism; pending cross-Mac verification of holding PHY provider domains across sleep.
- §4 Clean-room & attribution: Pass — all 7 commits carry human author/committer (
Ryan Murray <ryan@aurorasilicon.org>) and humanSigned-off-by:only, zero AI trailers in commits; PR body disclosure present. - §5 Evidence: Blocked — see Blocker 2.
- §6 Naming: Pass.
Blockers
- CI failure (
Host tests / host-tests):tools/asahi/dcpext26-suspend-route-tests.pyfails to compile because commit3437a5a3730eaddeddcp_sleep_hold_phys(dcp);inside thedcp_is_retained_external()suspend block extracted by that harness without declaring/stubbing it (error: call to undeclared function 'dcp_sleep_hold_phys'). Updatedcpext26-suspend-route-tests.pyto model/verifydcp_sleep_hold_phys()and get CI green. - §1 / §5 — Cross-Mac non-regression rows for the new PHY-hold commits (
3437a5a3730e) & complete J473 triad:- The four peer Mac rows (J413, J700, J316s, J616s) were run on
d64d9816b3de(DP-audio hold only) beforedcp_sleep_hold_phys()was added. Note also thatdcp->phyis acquired at probe for fixeddp-phyoutputs even when no external display is attached, so the new code is not inert on HDMI Macs without a display plugged. As listed in## Still to run, please add cross-Mac no-regression rows at the fixed head with external displays attached (e.g., J413 USB-C, M1 Pro HDMI, J616s) with full §5 regression counts. - On the J473 row at the fixed head, please also confirm
0 new kernel errorsexplicitly alongside Enforcing / 0 AVC / 0 failed units (and post-wake DP audio enumeration on the relit USB-C path).
- The four peer Mac rows (J413, J700, J316s, J616s) were run on
Assisted-by: LLM (Gemini 4 Neon)
The system suspend of a DCP whose firmware keeps running reported its fixed HDMI output unplugged and released its link on every sleep, since 0b1c93b ("drm: apple: dptx: Issue HPD event early on gpio/type-c disconnect"), also with the display still attached. After the wake nothing connects it again: HPD stayed high through the sleep, so no edge comes, and the CRTC that userspace turned off for the unplug never runs dcp_poweron(). On the M2 Mac mini (firmware 27.2) the release also timed out (RemotePort call 7, -110) and the converter pulsed HPD after the relink, and HDMI stayed dark after the first s2idle. Release it only when its HPD reads low, as DPMS off does (dcp_poweroff()). A display that stays attached keeps its link through the sleep, as through DPMS off, and resume lights it again through dcp_poweron(). A display that is unplugged during the sleep is still reported and released as when awake. Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
|
MERGETRAIN6 re-review at Blocking: the previously reported cold-probe provider and route snapshot findings still apply. This head retains the lockless PHY/route lookup, and the J473 providers still lack the explicit active-wakeup property for a domain that starts off. Please carry the scoped fix and its host fixture update, then verify cold/no-sink boot and late attachment. The cross-Mac HDMI and USB-C cases on the final heads remain outstanding. Assisted-by: LLM (Codex) |
DjDeveloperr
left a comment
There was a problem hiding this comment.
Formal §1–§6 pre-PR checklist re-review at verified live head 2267280d9c771a7df3b616272977b18c6a19c698 (CI: Apple DRM KUnit / kunit SUCCESS, Host tests / host-tests FAILURE — 475/478 passed).
Delta Audit (c672252ba5d2...2267280d9c77)
- Commit
2267280d9c77(drm/apple: dcp: keep a still-attached HDMI link through a sleep): Narrowly guards thedcp_platform_suspend()HDMI disconnect (drivers/gpu/drm/apple/dcp.c:9943-9947) withgpiod_get_value_cansleep(dcp->hdmi_hpd) <= 0. Good hardware progress on J473 (both HDMI-A-1 and DP-2 now relight across 5/5 s2idle cycles with no RemotePort-110timeout), anddcp->hdmi_hpd_irq != 0guaranteesdcp->hdmi_hpd != NULL(dcp.c:7598-7610,7052-7053). However, keeping the HDMI link across sleep introduces two correctness issues on resume/unplug (Blockers 2 & 3 below), and neither blocker from#6033495066nor theMERGETRAIN6findings were cleared.
Checklist Summary
- §1 No model gating: Code has no SoC/board/FW gate; cross-Mac hardware proof for both PHY-hold (
3437a5a3730e) and HDMI keep-link (2267280d9c77) is still owed (Blocker 6). - §2 Production-ready / CI: Blocked —
host-testsCI still fails (Blocker 1); code/locking/resume bugs (Blockers 2–5). - §3 Safety: Blocked — cold/no-sink boot PMGR
GENPD_FLAG_ACTIVE_WAKEUPgap (Blocker 5) and T6030external_nativeresume teardown under an active HDMI link (Blocker 3). - §4 Clean-room & attribution: Pass — all 8 commits (
7e8f0dce76e8..2267280d9c77) carry human author/committer (Ryan Murray <ryan@aurorasilicon.org>) and humanSigned-off-by:only, zero AI trailers in commits; PR body disclosure present. - §5 Evidence: Blocked — see Blocker 6.
- §6 Naming: Pass.
Blockers
- CI failure (
Host tests / host-tests, still open from#6033495066):tools/asahi/dcpext26-suspend-route-tests.py(all 3 runs: default,--native-parks,--drop-h17p-park) still fails to compile witherror: call to undeclared function 'dcp_sleep_hold_phys'because3437a5a3730eaddeddcp_sleep_hold_phys(dcp);inside thedcp_is_retained_external()block extracted by that test. Updatedcpext26-suspend-route-tests.pyto model/verifydcp_sleep_hold_phys()and get CI green. - §1 / Correctness — HDMI unplug during sleep leaves stale connected state (
2267280d9c77):dcp_platform_suspend()callsdisable_irq(dcp->hdmi_hpd_irq), which writesREG_GPIOx_IN_IRQ_OFF(drivers/pinctrl/pinctrl-apple-gpio.c:323-324), so a falling HPD edge while asleep is not latched. On resume,dcp_platform_resume()runsdcp_fabric_run_resume(&dcp_resume_ops, dcp)->enable_irq()+dcp_fabric_hdmi_resume(), which is a no-op on non-hybrid fixed HDMI DCPs (dcp_hdmi_settle_enabled()requiresnr_typec_routes > 0,dcp-fabric-effects.h:15) and on hybrids only updateshdmi_presencewithout callingdisconnected_hpd_event()/dcp_dptx_disconnect(). Thendcp_poweron()(dcp.c:5201-5208) only connects whenconnectedis true and never disconnects whenconnectedis false. Consequently, an HDMI display unplugged during s2idle remains stuck connected in DRM and DCP (contradicting the commit message claim "A display that is unplugged during the sleep is still reported and released as when awake"). After re-enablinghdmi_hpd_irqindcp_platform_resume(), sampledcp->hdmi_hpdwhen!dcp->active_typec_routeand, if low, calldisconnected_hpd_event(dcp->connector)anddcp_dptx_disconnect(dcp, 0)(and update fabric state on hybrids). - §1 / §3 — T6030
external_nativeHDMI resume tears down PHY & crossbar underneath a kept link (dcp.c:10007-10008,dcp-fabric.c:1343-1379):dcp->external_nativereachesdcp.c:9931, so2267280d9c77now keeps its HDMI link connected across sleep. Yetdcp_platform_resume()still unconditionally callsdcp_fabric_hdmi_reinit(dcp, "after system sleep"), which documents "No HDMI link is up when this runs" and cyclestypec_mux_set(SAFE -> DP_STATE_C)plusmux_control_deselect(dcp->fixed_xbar)/dcp_fixed_output_select()underneath the active DPTX link. Either keep disconnecting onexternal_nativeor guarddcp_fabric_hdmi_reinit()so it does not tear down an active kept HDMI link. - Locking & PR-body accuracy in
dcp_sleep_hold_phys()(dcp.c:9781-9788, concurring withMERGETRAIN6):dcp->phyanddcp->active_typec_routeare mutated underdcp_typec_fabric_lock(dcp-fabric.c:714,751,862,911,924,936,5181).dcp_sleep_hold_phys()readsdcp->phywithoutREAD_ONCEand reads both fields withoutdcp_typec_fabric_lock, including on paths (iomfb_m4,dcp_is_ext26) wheredcp_disable_typec_work()has not run. Snapshot the active PHY(s) underdcp_typec_fabric_lock(e.g., via a helper indcp-fabric.c). Also correct the PR body note "On Macs without an external display the new code holds nothing":dcp->phyis populated at probe for both fixeddp-phy(dcp.c:7513) and Type-C routes (dcp-fabric.c:4957-4958, and parked back ontypec_routes[0].phyon deactivate atdcp-fabric.c:924,938), sodcp_sleep_hold_phys()marks that provider even when no display is attached. - Cold/no-sink boot PMGR
GENPD_FLAG_ACTIVE_WAKEUPgap (concurring withMERGETRAIN6):apple_pmgr_ps_probe()(drivers/pmdomain/apple/pmgr-pwrstate.c:1026-1035) only setsGENPD_FLAG_ACTIVE_WAKEUPwhen a domain is already ON at probe or carriesapple,sleep-wakeup-path.ps_dptx_ext_phy,ps_atc0_usb,ps_atc1_usb, andps_dpa0inarch/arm64/boot/dts/apple/t8112-pmgr.dtsilackapple,sleep-wakeup-path, so on a cold/no-sink boot followed by a late monitor plug,device_set_wakeup_path()indcp_sleep_hold_phys()/dcpaud_suspend_late()will be silently ignored by genpd at noirq. Carry the scoped PMGR/DT fix (or track/gate explicitly if landed in a companion DT PR per §1 chicken-and-egg) and verify cold/no-sink boot + late plug + s2idle. - §1 / §5 — Exact-head hardware evidence & cross-Mac non-regression (still open from
#6033495066):- On J473 at the final fixed head, include the complete §5 regression tuple (SELinux Enforcing, 0 AVC denials, 0 failed units, 0 new kernel errors), post-wake DP audio enumeration, HDMI unplug-during-sleep behavior, and cold/no-sink boot + late-plug s2idle.
- Peer Mac rows (J413, J700, J316s, J616s) are still from
d64d9816b3de(prior to both3437a5a3730eand2267280d9c77). Add exact-head cross-Mac no-regression rows with external displays attached acrosshdmi-hpdMacs (e.g., M1/M2 Pro/Max, and T6030external_nativeif applicable) and USB-C Macs (J413, J616s) with full §5 regression tuples.
Assisted-by: LLM (Gemini 4 Neon)
The test builds dcp_platform_suspend() from dcp.c, which now also holds the DP PHYs of a DCP whose firmware runs through the sleep. That hold has its own test; stub it here. Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
DjDeveloperr
left a comment
There was a problem hiding this comment.
Formal §1–§6 pre-PR checklist re-review at verified live head 245f899b2725ea8111f6ceb71bdd15a90fb2693f (CI at review time: Apple DRM KUnit / kunit SUCCESS, Host tests / host-tests IN_PROGRESS).
Delta Audit (2267280d9c77...245f899b2725)
- Commit
245f899b2725(tools/asahi: stub the DP PHY hold in the dcpext26 suspend route test): Addsstatic void dcp_sleep_hold_phys(struct apple_dcp *d) { (void)d; }totools/asahi/dcpext26-suspend-route-tests.py:73-74, addressing theundeclared function 'dcp_sleep_hold_phys'compile failure from#6034135865Blocker 1 (pendingHost tests / host-testscompletion to confirm green). Note (non-blocking): unlikewake_pathsandsleep_fw_runs, the stub is a no-op rather than counting invocations (phy_holds), so the fixture does not assertdcp_sleep_hold_phys()is called on retained-sleep success and skipped on-EHOSTDOWN/-EBUSYrefusal. - No driver, DT, or hardware-evidence changes landed in this push; Blockers 2–6 from
#6034135865remain open.
Checklist Summary
- §1 No model gating: Code remains free of SoC/board/FW gates; cross-Mac hardware proof for
3437a5a3730eand2267280d9c77is still owed (Blocker 5 below). - §2 Production-ready / CI: Blocked —
host-testsstillIN_PROGRESSat review time (compile fix landed, awaiting green CI); code/locking/resume bugs remain open (Blockers 1–4 below). - §3 Safety: Blocked — T6030
external_nativeresume teardown underneath a kept HDMI link (Blocker 2 below) and cold/no-sink boot PMGRGENPD_FLAG_ACTIVE_WAKEUPgap (Blocker 4 below). - §4 Clean-room & attribution: Pass — all 9 commits (
7e8f0dce76e8..245f899b2725) carry human author/committer (Ryan Murray <ryan@aurorasilicon.org>) and humanSigned-off-by:only, zero AI trailers in commits; PR body disclosure present. - §5 Evidence: Blocked — see Blocker 5 below.
- §6 Naming: Pass.
Status of Previous Blockers (#6034135865)
- Cleared in code (awaiting green CI): Previous Blocker 1 (
tools/asahi/dcpext26-suspend-route-tests.pycompile fix in245f899b2725; confirmHost tests / host-testsfinishesSUCCESS).
Remaining Blockers
- §1 / Correctness — HDMI unplug during s2idle leaves stale connected state (previous Blocker 2, unchanged):
dcp_platform_suspend()(drivers/gpu/drm/apple/dcp.c:9932,9943-9947) masksdcp->hdmi_hpd_irq(REG_GPIOx_IN_IRQ_OFF) and only disconnects if HPD is already low at suspend. On resume,dcp_platform_resume()(dcp.c:10010-10011) callsdcp_fabric_run_resume(&dcp_resume_ops, dcp)->dcp_fabric_hdmi_resume()(drivers/gpu/drm/apple/dcp-fabric.c:1329-1335), which is a no-op on non-hybrid fixed HDMI DCPs (dcp_hdmi_settle_enabled()requiresnr_typec_routes > 0) and on hybrids does not invokedisconnected_hpd_event()/dcp_dptx_disconnect().dcp_poweron()(dcp.c:5201-5208) only callsdcp_dptx_connect()whenconnectedis true and never disconnects when false. Unplugging HDMI during s2idle therefore leaves DRM/DCP stuck connected. After re-enablinghdmi_hpd_irqindcp_platform_resume(), sampledcp->hdmi_hpdwhen!dcp->active_typec_routeand, if low, calldisconnected_hpd_event(dcp->connector)anddcp_dptx_disconnect(dcp, 0)(and update hybrid fabric state as needed). - §1 / §3 — T6030
external_nativeHDMI resume tears down PHY & crossbar underneath a kept link (previous Blocker 3, unchanged):dcp->external_nativereachesdcp.c:9931and now keeps its HDMI link across sleep, butdcp_platform_resume()(dcp.c:10007-10008) still unconditionally callsdcp_fabric_hdmi_reinit(dcp, "after system sleep")(dcp-fabric.c:1343-1379, which documents "No HDMI link is up when this runs" and cyclestypec_mux_set(SAFE -> DP_STATE_C)plusmux_control_deselect(dcp->fixed_xbar)/dcp_fixed_output_select()). Either keep disconnecting onexternal_nativeor guarddcp_fabric_hdmi_reinit()so it does not tear down an active kept HDMI link. - Locking & PR-body accuracy in
dcp_sleep_hold_phys()(previous Blocker 4, unchanged):dcp_sleep_hold_phys()(dcp.c:9781-9788) still readsdcp->phywithoutREAD_ONCEand reads bothdcp->phyanddcp->active_typec_routewithoutdcp_typec_fabric_lock(the lock guarding mutations indcp-fabric.c:714,751,862,911,924,936,4958,5181), including oniomfb_m4(dcp.c:9853) anddcp_is_ext26(dcp.c:9910) paths wheredcp_disable_typec_work()has not run. Snapshot the active PHY(s) underdcp_typec_fabric_lock. Also correct the PR body note "On Macs without an external display the new code holds nothing", sincedcp->phyis populated at probe (and parked ontypec_routes[0].phyon deactivate). - Cold/no-sink boot PMGR
GENPD_FLAG_ACTIVE_WAKEUPgap (previous Blocker 5, unchanged):apple_pmgr_ps_probe()(drivers/pmdomain/apple/pmgr-pwrstate.c:1026-1035) only setsGENPD_FLAG_ACTIVE_WAKEUPwhen a domain is ON at probe or carriesapple,sleep-wakeup-path.ps_dpa0,ps_dptx_ext_phy,ps_atc0_usb, andps_atc1_usbinarch/arm64/boot/dts/apple/t8112-pmgr.dtsi(:443-450,:712-718,:1285-1301) still lackapple,sleep-wakeup-path, so on a cold/no-sink boot followed by a late monitor plug,device_set_wakeup_path()indcp_sleep_hold_phys()/dcpaud_suspend_late()will be ignored by genpd at noirq. Carry the scoped DT/PMGR fix (or explicitly gate/track per §1 chicken-and-egg) and verify cold/no-sink boot + late plug + s2idle. - §1 / §5 — Exact-head hardware evidence & cross-Mac non-regression (previous Blocker 6, unchanged):
- At the final fixed head on J473, provide the complete §5 regression tuple (SELinux Enforcing, 0 AVC denials, 0 failed units, 0 new kernel errors), post-wake DP audio enumeration, HDMI unplug-during-sleep verification, and cold/no-sink boot + late-plug s2idle.
- Peer Mac rows (J413, J700, J316s, J616s) are still from
d64d9816b3de(prior to3437a5a3730eand2267280d9c77). Add exact-head cross-Mac no-regression rows with external displays attached acrosshdmi-hpdMacs (M1/M2 Pro/Max, plus T6030external_nativeif applicable) and USB-C Macs (J413, J616s) with full §5 regression tuples.
Assisted-by: LLM (Gemini 4 Neon)
Read the selected Type-C route and the PHY pointers together while the display fabric holds its route lock. Mark those provider devices before a route handoff can change the selected PHY. The host fixture checks that the provider is marked under the same lock. Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
Describe active wakeup for the external DPTX and two ATC USB domains. A domain that is off at PMGR probe can be powered by a later display attachment. The property lets genpd honor a subsequent consumer wakeup-path mark while the DCP keeps running through suspend. Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
|
The cold-attach and route cases are addressed at The arm64 Assisted-by: LLM (Codex) |
A DCP whose firmware runs through a sleep keeps an attached HDMI display's link, so the display lights again on wake. Its HPD IRQ is masked through the sleep, and on a fixed HDMI output nothing else sees an unplug made then: the connector stayed connected after the wake. On resume, before the HPD IRQ is enabled again, release a display whose HPD now reads low, as an unplug while awake is: report the hotplug, release the DPTX link and tell the fabric. An edge from then on is replayed when the IRQ comes back. A failed GPIO read cannot establish absence and leaves the display connected; a pipeline a Type-C display owns is not touched. A T6030 native HDMI output still releases its link at suspend, attached or not: its resume sets the converter, PHY and crossbar up again (dcp_fabric_hdmi_reinit()), which needs the link down. tools/asahi/dcp-hdmi-sleep-unplug-tests.py runs the real suspend HDMI block and the resume release over kept, unplugged-in-sleep, gone-before, GPIO error, borrowed and T6030 native cases, and checks the release runs before the IRQ comes back; five mutations are killed. Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
|
Review of the HDMI resume change at The new resume path still needs to serialize its fixed-output release against route reassignment. Please keep the ownership check, disconnect and presence update in one fabric critical section using the existing fabric-to-HPD lock order, or identify the existing PM fence that excludes both route entry points until this release returns. This is a source review finding. The exact J473 wake and peer rows are still pending. Assisted-by: LLM (Codex) |
The J473 combined kernel stalled before journald with the newly composed Stage 2 and reached userspace with the earlier Stage 2 on the same kernel. The compiled device trees differ by the three wakeup properties added by 1274718. Remove those properties while the handoff is investigated. The J473 and J413 device trees compile, and the combined J473 firmware-27 DTB built after this revert is byte-identical to the booted reference. Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
|
The T8112 wakeup properties are reverted at Four J473/J413 device trees compiled. On the exact combined source, restoring the prior provider properties produced the same firmware-27 J473 DTB SHA-256 as the payload that booted, Assisted-by: LLM (Codex) |
|
Hardware rows at this head ( J473 (Mac mini M2, 27.2). Kernel =
M4 Pro MacBook Pro (J616s, T6040). fleet85 + this PR's appledrm module, default command line, production Stage 2. s2idle 3/3, Enforcing, 0 AVC, 0 failed units, 0 kernel errors at priority 3. Its external ports were empty. Not run yet: an HDMI unplug during the sleep, and a cold boot with no display followed by a late plug. Both need someone at the machine to move a cable, and the lab has no switchable sink. The new resume release is covered by Evidence paths (lab store)
|
Takes linux#2853 (merged) and the current integration tip. The only conflict is the host-test registry, where both sides add entries. Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
DjDeveloperr
left a comment
There was a problem hiding this comment.
Formal §1–§6 pre-PR checklist re-review at exact live head 87819806b2a214c9ff19acb982fe02671004ccb8 (base: integration/aurora; follows review #6034212495 at 245f899b2725).
Resolved Since 245f899b2725
- Previous CI compile failure: Cleared — both
Apple DRM KUnit / kunitandHost tests / host-testspassed atca69a305525d(re-running now on merge head87819806b2a2). dcp_sleep_hold_phys()locking (702e0c301cfb): Cleared — moved intodrivers/gpu/drm/apple/dcp-fabric.c:5008-5019underguard(mutex)(&dcp_typec_fabric_lock), snapshottingdcp->active_typec_route,dcp->phy, androute->phyand marking providers under the fabric lock (dcp-sleep-phy-hold-tests.pyverifies lock ownership).- T6030
external_nativeHDMI resume safety (31ba92a7d68c): Cleared —dcp_platform_suspend()(drivers/gpu/drm/apple/dcp.c:9924-9929) releasesdcp->external_nativelinks at suspend sodcp_fabric_hdmi_reinit()does not tear down an active link on resume (covered bydcp-hdmi-sleep-unplug-tests.py+keep-nativemutation). - HDMI unplug-during-sleep resume hook added (
31ba92a7d68c):dcp_hdmi_unplugged_in_sleep()+tools/asahi/dcp-hdmi-sleep-unplug-tests.py(6 cases, 5 mutations) added; see Blocker 1 for a remaining lock-serialization bug. - Merge conflict resolved (
87819806b2a2): Clean merge ofintegration/aurora(e1826fa80960, carrying#2853and#2868), resolving onlytools/asahi/run-host-tests.py(mergeable: MERGEABLE). - §4 Attribution & §6 Naming: Pass — all PR commits (
7e8f0dce76e8..87819806b2a2) carry human author/committer (Ryan Murray <ryan@aurorasilicon.org>) and humanSigned-off-by:only, with 0 AI commit trailers; clean naming.
Remaining Blockers (REQUEST_CHANGES)
- Concurrency / locking race in
dcp_hdmi_unplugged_in_sleep()(drivers/gpu/drm/apple/dcp.c:9950-9960, 10004-10010— concurring with source review#7123427417):dcp_platform_resume()runsdcp_enable_typec_work(dcp)(dcp.c:10004) beforedcp_hdmi_unplugged_in_sleep(dcp)(dcp.c:10010), anddcp_hdmi_unplugged_in_sleep()checksREAD_ONCE(dcp->active_typec_route), clearsconnector->connectedviadisconnected_hpd_event(), and callsdcp_dptx_disconnect(dcp, 0)without holdingdcp_typec_fabric_lock(onlydcp_fabric_hdmi_unplugged()takes it afterward). Oncedisconnected_hpd_event()clearsfixed_connector->connectedwith HPD low,dcp_typec_route_fixed_output_busy()(dcp-fabric.c:286-291) reports the pipeline free, allowing a concurrent Type-C or tunnel assignment underdcp_typec_fabric_lockto claim the pipeline and DPTX port 0 beforedcp_dptx_disconnect(dcp, 0)executes. Keep the ownership check, connector disconnect, DPTX port-0 disconnect (already called underdcp_typec_fabric_lockindcp-fabric.c:644), and fabric presence update serialized underdcp_typec_fabric_lock(and cover the lock assertion in the host fixture). - Cold/no-sink boot PMGR
GENPD_FLAG_ACTIVE_WAKEUPgap reopened byca69a305525d+ stale PR body: Commitca69a305525dreverted1274718dc5fd(apple,sleep-wakeup-pathonps_dptx_ext_phy,ps_atc0_usb,ps_atc1_usb) after J473 stalled before journald with combined Stage 25a6fcfc699e6(andps_dpa0was still uncovered). The PR body still states "On the T8112,dptx_ext_phy,atc0_usbandatc1_usbcarryapple,sleep-wakeup-path(1274718d)". Either resolve the Stage 2 stall and carry the scoped DT/PMGR fix, or update the PR body to remove the stale1274718dclaim and explicitly track the cold/no-sink boot limitation as a companion DT/PMGR follow-up per §1 chicken-and-egg. - CI on
87819806b2a2:Apple DRM KUnit / kunitandHost tests / host-testsare currentlyIN_PROGRESSon the merge head and must finishSUCCESS. - §1 / §5 Exact-head hardware & cross-Mac non-regression evidence:
- J473
r14(#7124720416) ran at31ba92a7with1274718d's DTB swapped into production Stage 2 (prior toca69a305525d's DT revert and87819806b2a2) and still omits post-wake DP audio enumeration; post the exact-head J473 wake row on the reverted/final DT + lock-fixed head (with post-wake DP audio enumeration and full 0/0/0 regression tuple). - Cross-Mac non-regression with external displays attached remains open (
peer-j616s-r1had empty external ports; attached-display rows onhdmi-hpdMacs such as M1/M2 Pro/Max and USB-C Macs such as J413/J616s are still pending).
- J473
Assisted-by: LLM (Gemini 4 Neon)
The resume path checks the fixed HDMI connector before releasing the link, then acquires the fabric mutex to update connector presence. A competing Type-C route selection can claim the DPTX port in that gap. Hold the fabric mutex across the ownership check, port release and presence update. Keep the established fabric-to-HPD lock order. The extracted fixture verifies that resume holds the fabric guard while releasing the link. Both arm64 DCP objects build and all six fixture mutations are rejected. Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
|
The resume ownership finding is fixed at Both arm64 DCP objects compiled with empty diagnostics. The ASan/UBSan fixture passed and rejected all six mutations. The current-head hardware request includes the normal paired-display wake and the shared output case. Prior source finding Assisted-by: LLM (Codex) |
|
Changed-head hardware row at
Not run: an HDMI unplug during the sleep. It needs someone at the machine. |
Problem
On the Mac mini M2 (J473, macOS 27.2 system firmware), once Linux has started the primary DCP (the state linux#2853 brings up), s2idle hard-resets the machine on almost every attempt, with no log. The DCP keeps its coprocessor running through s2idle, so its own domains stay on. The DP audio block that this DCP's firmware drives sits in a separate domain (dpa0). The dp-audio device holds that domain only while it is runtime-active, so genpd powers it off at noirq under the still-running DCP firmware.
Update (DP PHY): with both J473 DCPs bound and the live 27.2 stack on today's production Stage 2, holding the DP audio domain was not enough: s2idle still reset in the first freeze in 9 of 9 one-shots, with either version of the hold and with the kernel that passed 13/13 on 11-23. Lab device trees that held selected power domains through the sleep found the second cause: the DP PHY that the running DCP firmware drives. The HDMI dcpext drives
dptx_ext_phy, and the USB-C primary drives its route's ATC PHY. Holding both PHY domains let the sleep pass; holding either one alone did not.Change
The DCP records, in its system suspend, whether the sleep leaves its coprocessor running: the default hold, a retained external DCP, or a T8132 DCP that was neither stopped nor power-gated. Every path that stops the firmware (S2R, the 27.x sleep, the T8132 external stop, the power gate) leaves the flag clear.
dcp_sleep_keeps_firmware()reads it under the DCP's device lock.The dp-audio late sleep callback finds its DCP through the OF graph. If that DCP keeps its firmware running, or has no driver bound (a boot stage or an earlier bind may have left the firmware running), the callback sets the dp-audio device's wakeup path, so genpd keeps the domain through noirq.
The decision comes from the DCP's own sleep state, not from the SoC, board or firmware version. No new parameters.
A DCP whose firmware keeps running through the sleep (the same
sleep_fw_runsdecision) also puts the provider devices of its owndp-phyand of its active Type-C route's PHY on the wakeup path, so genpd keeps those domains at noirq too. A DCP that stops its firmware leaves its PHYs to genpd as before. The PHYs come from the DCP's own DT (phys,typec-routes). No SoC, board or firmware gate.The suspend no longer reports a still-attached HDMI display unplugged or releases its link: only a display whose HPD reads low is released, as DPMS off does. Before, the J473's HDMI stayed dark after the first s2idle: HPD stays high through the sleep, so no edge comes, and the CRTC userspace had turned off never powered on again.
The PHYs to hold are read under the Type-C fabric lock, which guards every change to them (
702e0c30).1274718daddedapple,sleep-wakeup-pathto the T8112dptx_ext_phy,atc0_usbandatc1_usbdomains, so the hold would also cover a display plugged in after a cold boot with no display.ca69a305reverts it for now. One combined GPU+display trial boot with that DTB hung early. The same signed combined kernel booted with the earlier Stage 2 without these properties. R14 also booted with the three properties in a separate display-only kernel and Stage 2 pairing. The cold no-sink boot followed by late attachment remains a companion DT/PMGR follow-up. A domain that was off at probe still lacksGENPD_FLAG_ACTIVE_WAKEUP.A display unplugged while the machine sleeps is released on resume (
31ba92a7). The HPD IRQ is masked through the sleep, and on a fixed HDMI output nothing else reports the unplug. Before the IRQ is enabled again, the resume releases a kept display whose HPD now reads low, the same steps as an unplug while awake: hotplug event, DPTX link release, fabric update. An edge after that is replayed when the IRQ comes back. A failed GPIO read leaves the display connected, and a pipeline that a Type-C display owns is left alone.be351654holds the fabric mutex across the fixed-output ownership check, the link release, and the presence update, so the fabric cannot allocate the pipeline midway through the release.A T6030 native HDMI output still releases its link at suspend, attached or not. Its resume sets the converter, PHY and crossbar up again (
dcp_fabric_hdmi_reinit()), and that needs the link down.The first version keyed on the DCP's wakeup path. The S2R and T8132-stop paths set that path too after stopping the firmware, so it would also have held the domain on sleeps where nothing uses it. The second commit narrows this.
Testing
Current source head
be351654:dcp.oanddcp-fabric.ocompiled for arm64 with empty diagnostics. Clang ASan/UBSan passed the resume harness and rejected all six mutations, including removal of the fabric mutex. M2-COMBINE independently replayed the changed path. Hosted KUnit passed. The hardware rows below are earlier candidates.M4 Pro MacBook Pro (J616s, T6040) at
31ba92a7: fleet85 with this PR's appledrm module, default command line, production Stage 2. s2idle 3/3 with 12 s RTC wakes in one boot. Enforcing, 0 AVC, 0 failed units, no kernel errors at journal priority 3. Its external ports were empty, so this is a no-regression row only.Host test
tools/asahi/dcp-hdmi-sleep-unplug-tests.pyruns the real suspend HDMI block anddcp_hdmi_unplugged_in_sleep()over six cases: kept, unplugged during the sleep, gone before it, GPIO error, Type-C-owned pipeline and T6030 native. It also checks that the release runs before the HPD IRQ comes back. It kills 5 mutations. The Apple DCP host suites pass (53 of 53 apart from this test), Apple DRM KUnit gives 117 passed and 1 skipped, anddcp.obuilds clean with W=1.J473, full series at
2267280d(+ #285306e155e8for the AV service): s2idle 5/5, and both monitors light again after every wake (HDMI-A-1 and DP-2 connected and enabled, both CRTCs active). No HDMI release, no RemotePort -110, no converter HPD pulse and no AV re-announce around the sleeps. Before this commit the sleeps passed, but HDMI stayed dark after the first wake.J473 on the earlier
c672252bdisplay candidate. Kernel =integration/aurora0f111a0d+ this PR + #2868 + #2853. Default command line, production Stage 2 and DTB (aura mainf13056d9), both monitors on apple-drm (HDMI 1080p180, USB-C 1440p144). Result: s2idle 5/5 in one boot (suspend_stats success 5, fail 0), Enforcing, 0 AVC, 0 failed units. The same kernel without the PHY hold reset on the first freeze every time.J473 split rows with lab aura-try DTBs that set
apple,always-onon chosen domains:dptx_ext_phy,atc0_usb,atc1_usb,sio_cpu,sio_adma,dpa0dptx_ext_phy,atc0_usb,atc1_usbdptx_ext_phyonlyatc0_usb,atc1_usbonlypm_test=devicespasses.pm_test=platformsurvived the default 5 s hold once and reset once, and it reset with a 20 s hold. Disabling the CPU PD idle state still reset, which puts the fault in the noirq hold.Host test
tools/asahi/dcp-sleep-phy-hold-tests.pybuilds the realdcp_phy_set_wakeup_path()anddcp_sleep_hold_phys(). It runs 6 topologies and kills 4 mutations: no route PHY, no own PHY, the class device instead of the provider, and no error-pointer check.run-host-tests --only dcp-sleep-phy5/5.J473 (first version, same decision for this s2idle path): kernel = fleet82 + linux#2853 + linux#2868, default cmdline, production Stage 2. Control without the patch: RESET on the first freeze. With the patch: 13 of 13 freezes PASS over 3 boots.
Current version on the fleet85 kernel (appledrm module only differs), default cmdline, production Stage 2, 12 s RTC wakes. Each Mac has a production control row in the same boot setup. pmgr dynamic debug records every power-domain change inside each sleep, and a kretprobe records each
dcp_sleep_keeps_firmware()result:On the Neo, M1 Pro and M4 Pro the DP audio domains were off at probe and carry no
GENPD_FLAG_ACTIVE_WAKEUP, so a requested hold changes nothing in hardware there. Their domain sequences match production exactly. On the Neo's deep sleeps the S2R stop clears the flag, so no hold is requested at all. All patch rows: SELinux enforcing, 0 AVC denials, 0 failed units, no new kernel errors (the only error lines are thedwc3-apple ... genpd_prepare returns -11lines that every production control row shows too).dcp_sleep_keeps_firmware()is documented as late-suspend only: it takes the DCP's device lock, which can sleep.tools/asahi/dcpaud-sleep-hold-tests.pynow also builds the realdcp_sleep_keeps_firmware()and checks it reads the driver data under the device lock. 128 cases; 7 mutations killed (hold for a stopped DCP, inverted flag, unbound case dropped, no lock, two reference leaks, DCP ignored) plus the old-code control.dcpext26-suspend-route-tests.pychecks that the flag is set together with the wakeup path and stays clear when the retained sleep is refused.Still to run
hdmi-hpdGPIO (M1/M2 Pro/Max) with a display attached. A still-attached HDMI display now keeps its link through the sleep, the same state as DPMS off.dp-phyis still held while its firmware runs.Evidence and mechanism detail
traces/display/20261124-m2mini-display-full(r1b..r10, README);traces/power/20261123-s2idle2-dpa(this version: per-Mac control and patch rows, PS lines, kretprobe results, triad) andtraces/power/20261123-j473-s2idle-usbc(first version: r0 genpd diff on production, r1 dp-audio unbound 5/5, f1 control, f2..f4 fix).Assisted-by: LLM (Claude:Opus 5.5), LLM (OpenAI:Codex)