Skip to content

drm/apple: keep the DP audio and DP PHY domains while the DCP firmware runs - #2953

Open
RyanTheTide wants to merge 7 commits into
integration/aurorafrom
m2mini/dpaudio-sleep-hold
Open

RyanTheTide wants to merge 7 commits into
integration/aurorafrom
m2mini/dpaudio-sleep-hold

Conversation

@RyanTheTide

@RyanTheTide RyanTheTide commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

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_runs decision) also puts the provider devices of its own dp-phy and 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 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

  • J473 at this head (c672252b). Kernel = integration/aurora 0f111a0d + this PR + #2868 + #2853. Default command line, production Stage 2 and DTB (aura main f13056d9), 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-on on chosen domains:

    domains held result
    dptx_ext_phy, atc0_usb, atc1_usb, sio_cpu, sio_adma, dpa0 PASS
    dptx_ext_phy, atc0_usb, atc1_usb PASS
    dptx_ext_phy only RESET
    atc0_usb, atc1_usb only RESET

    pm_test=devices passes. pm_test=platform survived 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.py builds the real dcp_phy_set_wakeup_path() and dcp_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-phy 5/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:

Mac sleeps (control / patch) result hold decision DP audio domains inside the sleep
MacBook Air M2 (T8112) 3 s2idle / 3 s2idle 3/3, 3/3 n/a dpa1 stays on in both
Neo (T8140) 3 s2idle + 2 deep / 5 + 3 5/5, 8/8 s2idle: hold; deep: no hold dpa1 off in every sleep, both
MacBook Pro M1 Pro (T6000) 3 s2idle / 4 s2idle 3/3, 4/4 hold x8 dpa1, dpa2 off in every sleep, both
MacBook Pro M4 Pro (T6040) 3 s2idle / 3 s2idle 3/3, 3/3 hold x6 dpa1, dpa2 off in every sleep, both

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 the dwc3-apple ... genpd_prepare returns -11 lines 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.
  • Host tests: tools/asahi/dcpaud-sleep-hold-tests.py now also builds the real dcp_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.py checks that the flag is set together with the wakeup path and stays clear when the retained sleep is refused.

Still to run

  • After resume on the J473, the HDMI output (adopted dcpext) does not relight. Its CRTC stays off: the converter's AV service is refused on re-announcement (-ENODEV) and the remote-port call 7 times out at suspend. USB-C relights. This is tracked on drm/apple: adopt a DCP handed over running (M2 Mac mini HDMI on 27.2) #2853 and does not affect whether the sleep survives.
  • No-regression rows for the PHY hold on a Mac with an external display attached through the sleep (J413 USB-C, M1 Pro HDMI, J616s). On Macs without an external display the new code holds nothing.
  • The USB4 peer link-drop-during-sleep case is a separate fault and is tracked with linux#2868's route work.
Evidence and mechanism detail
  • Evidence (lab store): J473 PHY rows 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) and traces/power/20261123-j473-s2idle-usbc (first version: r0 genpd diff on production, r1 dp-audio unbound 5/5, f1 control, f2..f4 fix).
  • genpd_finish_suspend() skips powering off a device's domain only when device_awake_path(dev) is set and the domain has GENPD_FLAG_ACTIVE_WAKEUP. pmgr-pwrstate sets that flag for domains that are on at probe (or that carry its sleep-wakeup-path property). On the J473, dpa0 is on at probe; on the Neo, M1 Pro and M4 Pro the DP audio domains are not.
  • pm_runtime_force_suspend() still runs; genpd_power_off() does nothing while the domain is prepared for system sleep, so only the noirq decision matters.
  • On the J473, dpa0 is not critical in the ADT pmgr device list (flags 0x00), while dpa1 is (0x09, already apple,always-on). So the hold belongs in the driver, not in DT.
  • Every device's .suspend has run before the late phase, so the DCP's flag is final when dp-audio reads it; the DCP's resume clears it.
  • One M1 Pro attempt with this version reset during its second s2idle at the moment the M1 Pro's USB4 peer (a lab Mac on the Thunderbolt cable) rebooted. That matches a separate USB4 peer link-drop-during-sleep fault seen on other lab Macs, and it is independent of this change: the M1 Pro's domains behave as in production with the patch. The repeat with the peer quiet passed 4/4.

Assisted-by: LLM (Claude:Opus 5.5)

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 DjDeveloperr left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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), sets device_set_wakeup_path(dev) when !device_is_bound(&dcp_pdev->dev) || device_wakeup_path(&dcp_pdev->dev), drops all node/device references, and delegates to pm_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) and Signed-off-by:, zero AI trailers in commits; PR body ends with Assisted-by:.
  • §5 Evidence: Fail (see Blockers 1 & 2).
  • §6 Naming: Pass.

Blockers

  1. §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, in drivers/gpu/drm/apple/dcp.c, dcp_s2r_suspend() (dcp.c:8850), dcp_s2r_ext_suspend() (dcp.c:8796), and iomfb_m4_suspend() (dcp.c:9802) all call device_set_wakeup_path(dcp->dev) even when the DCP coprocessor is stopped for sleep (only dcp_v27_sleep_suspend() and ext_dead omit it). Consequently, on Macs whose DP audio domains are not apple,always-on (e.g., M4 Pro ps_dpa1/ps_dpa2, Neo ps_dpa1, M5 ps_dispext0_adma), dcpaud_suspend_late() will also set wakeup_path during S2R/s2idle whenever those domains carry GENPD_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 holding dpa* across S2R is benign or narrow the condition so stopped-firmware S2R paths do not hold the domain unnecessarily.
  2. §5 — Full regression triad & unmerged stack dependency: The J473 row ran on fleet82 + #2853 + #2868 (both unmerged; #2853 is still OPEN/DIRTY) and reports Enforcing, 0 AVC without 0 failed units and 0 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

  1. device_is_bound() locking contract (drivers/gpu/drm/apple/audio.c:2097): drivers/base/dd.c:438 documents that device_is_bound() must be called with device_lock() held, and device_suspend_late() does not hold device_lock(&dcp_pdev->dev). Taking device_lock(&dcp_pdev->dev) around the check (or using device_trylock / checking READ_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 RyanTheTide left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>
@RyanTheTide

Copy link
Copy Markdown
Contributor Author

Cross-Mac regression results for the v2 driver on the stock fleet85 command lines and production Stage 2. The signed appledrm build used fleet85 (2ad96595b154) plus the driver changes through d64d9816b3de. The current head 19f90d0e8a3a changes only the retained-sleep host fixture. Both host-tests and KUnit are green at that head.

Mac Stock fleet85 Fleet85 + v2 DP audio power-domain observation
M2 Air (J413) 3/3 s2idle 3/3 s2idle dpa1 stayed on in both.
Neo (J700) 3/3 s2idle, 2/2 deep 5/5 s2idle, 3/3 deep across two boots dpa1 cycled in both. v2 reported firmware running on both instrumented s2idle cycles and stopped on the instrumented deep cycle.
M1 Pro (T6000) 3/3 s2idle 4/4 s2idle with the USB4 peer quiet dpa1/dpa2 cycled in both. An earlier v2 run passed cycle 1 and reset during cycle 2, concurrent with the USB4 peer reboot.
M4 Pro (J616s) 3/3 s2idle 3/3 s2idle v2 reported firmware running on all six decisions. dpa1/dpa2 cycled as on stock.

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 RyanTheTide left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@RyanTheTide

Copy link
Copy Markdown
Contributor Author

J413 (MacBook Air M2, T8112, 13.5 stub), fleet85 2ad96595b154, production cmdline and Stage 2, 12-second PMU RTC alarms.

Arm s2idle DP audio domains Enforcing / AVC / failed units / new kernel errors
Stock fleet85 3/3 dpa0 cycled, dpa1 stayed on Yes / 0 / 0 / 0
Fleet85 + v2 appledrm module, d64d9816b3de 3/3 dpa0 cycled, dpa1 stayed on Yes / 0 / 0 / 0

Both arms logged the same pre-existing dwc3-apple genpd_prepare returns -11 once per cycle. All three module wakes came from PMU RTC IRQ 70. Normal device resume on the module was 847, 857 and 848 ms. The separate stock fleet85 promotion gate measured 850 and 843 ms with the external display attached. J413 offers s2idle only. Production fleet85 was restored and verified after the module trial.

Current PR head 19f90d0e8a3a differs from the tested head only in tools/asahi/dcpext26-suspend-route-tests.py. Both heads have the same driver code. The active-external-DCP audio domain stays on in both Air arms. The live primary-DCP dpa0 case still needs the J473 row.

@RyanTheTide

RyanTheTide commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor Author

Host and arm64 QEMU regression row at 19f90d0e8a3a1dffc753589b17f06ca2430a2baa.

  • dcpaud-sleep-hold-tests.py passed 128/128 late-suspend cases under ASan and UBSan. Six cases held the domain. The matrix detected all seven mutations, including the missing device lock and leaked OF or device references.
  • The repaired dcpext26-suspend-route-tests.py passed and detected both route mutations. Its assertions cover retained firmware, H17P park/unpark, native route retention and disconnect rollback.
  • A test-only overlay linked apple-dcp-audio-sleep into appledrm.ko. It passed after loading the module on arm64 QEMU with fleet85. The case checks an unbound DCP, a bound DCP without driver data, a stopped DCP with the wakeup-path bit set, and a DCP that kept its firmware running.

The J473 dpa0 noirq and after-resume hardware rows remain open.

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 RyanTheTide left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@RyanTheTide

Copy link
Copy Markdown
Contributor Author

Hardware provenance for 002e5071067d1c7ae3cb28dd81aff48115c06652. The signed appledrm module used for the fleet85 A/B was built with d64d9816b3de. The two later commits update the retained-sleep host fixture and document that dcp_sleep_keeps_firmware() may sleep and is called from late suspend. The driver statements and data declarations are unchanged.

Mac Stock fleet85 Fleet85 + v2
J413 3/3 s2idle 3/3 s2idle
J700 3/3 s2idle, 2/2 deep 5/5 s2idle, 3/3 deep
J316s 3/3 s2idle 4/4 s2idle with the USB4 peer quiet
J616s 3/3 s2idle 3/3 s2idle

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 dpa0 noirq and post-resume DP audio checks remain open.

Four-Mac observations and J413 timings.

@DjDeveloperr DjDeveloperr left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 tracks dcp->sleep_fw_runs separately from device_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_m4 when !iomfb_m4_sleep_stopped(dcp) under dcp->lock, retained external, and default hold), and leaving it false on dcp_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) reads dev->driver and drvdata under device_lock(dev) (with no AB-BA inversion since dcp_platform_pm_ops has 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 and platform_device references, delegates to pm_runtime_force_suspend(dev), and device_prepare() resets dev->power.wakeup_path at 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 human Signed-off-by: only, zero AI trailers in commits; PR body disclosure present).
  • §5 Evidence: Blocked — see below.
  • §6 Naming: Pass.

Remaining Blocker

  1. §5 — Owed v2 affected-hardware row on J473 (Mac mini M2): None of the four cross-Mac non-regression Macs exercise the dpa0 active-wakeup hold path in hardware (dpa1 on J413 is always-on; dpa1/dpa2 on J700, J316s, and J616s lack GENPD_FLAG_ACTIVE_WAKEUP). As noted in ## Still to run and your comment at 002e5071067d, the target J473 row has not yet been run on the v2 driver (d64d9816b3de / 002e5071067d) with dpa0 noirq 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)

@RyanTheTide

Copy link
Copy Markdown
Contributor Author

J473 (M2 mini) booted a guarded 27.2 DCP test kernel containing the exact PR head 002e5071067d1c7ae3cb28dd81aff48115c06652 and the changes from #2853 and #2868. The Linux command line was the production default. With the DCP handoff enabled, both DCPs and both ALSA DP-audio controllers bound, and dpa0 and dpa1 were on before suspend.

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 next_entry empty, Enforcing and zero failed units.

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>
@RyanTheTide

Copy link
Copy Markdown
Contributor Author

MERGETRAIN6 source review at 002e5071067d. Blocking: none in this diff. The late audio callback uses the DCP's actual suspend outcome, holds the device reference while reading it, and leaves the stopped-firmware case to normal PM. The four peer results cover that side of the change.

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)

@RyanTheTide RyanTheTide changed the title drm/apple: audio: keep the DP audio domain while its DCP firmware runs drm/apple: keep the DP audio and DP PHY domains while the DCP firmware runs Nov 24, 2026
@RyanTheTide

Copy link
Copy Markdown
Contributor Author

MERGETRAIN6 review at c672252ba5d2. The J473 R10 module with the PHY hold returned from 5/5 RTC sleeps on the production Stage 2 and DT. HDMI still stayed dark after resume, with its connector connected and CRTC off.

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 DjDeveloperr left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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) of dcp->phy and READ_ONCE(dcp->active_typec_route)->phy on the wakeup path only when dcp->sleep_fw_runs is true (iomfb_m4 when !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 2 f13056d9, 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-tests CI 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 human Signed-off-by: only, zero AI trailers in commits; PR body disclosure present.
  • §5 Evidence: Blocked — see Blocker 2.
  • §6 Naming: Pass.

Blockers

  1. CI failure (Host tests / host-tests): tools/asahi/dcpext26-suspend-route-tests.py fails to compile because commit 3437a5a3730e added dcp_sleep_hold_phys(dcp); inside the dcp_is_retained_external() suspend block extracted by that harness without declaring/stubbing it (error: call to undeclared function 'dcp_sleep_hold_phys'). Update dcpext26-suspend-route-tests.py to model/verify dcp_sleep_hold_phys() and get CI green.
  2. §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) before dcp_sleep_hold_phys() was added. Note also that dcp->phy is acquired at probe for fixed dp-phy outputs 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 errors explicitly alongside Enforcing / 0 AVC / 0 failed units (and post-wake DP audio enumeration on the relit USB-C path).

Assisted-by: LLM (Gemini 4 Neon)

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.

2 participants