Skip to content

drm/apple: power off idle firmware-27 external display processors - #3410

Merged
DjDeveloperr merged 15 commits into
mainfrom
feat/dcp-v27-ext-idle-off
Dec 2, 2026
Merged

DjDeveloperr merged 15 commits into
mainfrom
feat/dcp-v27-ext-idle-off

Conversation

@erikwb

@erikwb erikwb commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

What: Power off unattached Type-C-only firmware-27 external display processors (dcpext) after 5 seconds of inactivity once no route, cable, display connector, active open DP-audio DMA stream, or Type-C work is active, waking synchronously on attach, DP-audio DMA setup, or system suspend. Defer ADMA channel setup on unplugged dcp-dp-audio PCM opens with a vmalloc void buffer fallback and pin idle-capable external DCPs across open DMA-backed PCM lifetimes so probing /dev/snd/pcm* while DISPEXT*_SYS is powered off does not fail -ENODEV (0xb4f).

Tested: At current head 9f33c3f95939 (adds 9f33c3f95939 per-open managed_buffer_alloc selection + KUnit/host tests on top of ed71e9b038f2):

  • ARCH=arm64 LLVM=1 W=1 KCFLAGS="-Werror" object builds (audio.o, av.o, dcp.o, dcp-fabric.o, iomfb.o, iomfb_v27.o, iomfb_h17p.o, iomfb_v26_6_desktop.o), checkpatch.pl --strict --git ed71e9b038f2..HEAD (0 errors, 0 warnings, 0 checks), and git diff --check origin/main..HEAD (0 issues) pass.
  • arm64 QEMU KUnit: drivers/gpu/drm/apple/tests/display.kunitconfig (207 run: 206 passed, 1 skipped apple_g17_rx_util_min_test needing CONFIG_UCLAMP_TASK, including apple-dcp-firmware 7/7: dcp_ext_idle_s2r_disp_dart_gate and dcp_ext_idle_audio_dma_pin), display.kunitconfig with CONFIG_SOUND=y + CONFIG_SND=y (294 run: 292 passed, 2 skipped, including apple-dcpaud-legacy 11/11: dcpaud_legacy_unplugged_void_buffer, dcpaud_legacy_unplugged_hotplug_managed_buffer, dcpaud_legacy_plugged_close_unplug_reopen_vmalloc), display.kunitconfig with CONFIG_SOUND=y + CONFIG_SND=y + CONFIG_DMADEVICES=y + CONFIG_DEBUG_KERNEL=y + CONFIG_DEBUG_MUTEXES=y + CONFIG_DRM_APPLE_DCP_T6030_AUDIO=y (294 run: 293 passed, 1 skipped, including apple-dcpaud-legacy 11/11), drivers/gpu/drm/apple/tests/topology.kunitconfig (236 run: 235 passed, 1 skipped), and drivers/gpu/drm/apple/tests/.kunitconfig (117/117 passed).
  • Host & selftests: dcpaud host suite (22/22 passed including dcpaud-open-fallback-tests + 12/12 mutants killed and dcpaud-sleep-hold-tests), dart host suite (24/24 passed), dcp-tunnel-prepare-tests.py (PASS), dcpext26-startup-tests.py + --mutants (PASS), backlight-coldboot-tests.py (PASS), display-sleep-merge-tests.py (17/17 passed), and selftests/drivers/gpu/apple-dcp/run.py --group audio (2/2 passed).
  • Verified hardware passes containing exact head 9f33c3f95939:
    • J313 (T8103, firmware 27.2) in a composite trial kernel (origin/main d3de772ac0c1 + stacked #3334 7be3a9cd7395 carrying #3410 9f33c3f95939, alongside #3507, #3332, #3850, #3359, #3300, #3289; composite 807c3bbf2263): unattached 271c00000.dcp powered off idle ~5 s after DP tunnel drop (dcpext idle: powered off in 1 ms; PMGR dispext_fe 0x2300, dispext_cpu0 0x0f040300, target 0 / actual 0), woke on attach (dcpext idle: woke in 1-2 ms, 0x23ff / 0x1404034f within 0.3 s, idle-off again ~17 s later; repeated twice), opened unattached USBC DP-audio PCM with rc 0 (no -ENODEV) without waking domains, passed >= 7 internal eDP-1 DPMS off/on cycles across 3 boots and 3/3 docked deep S2R resumes including one entered from the idle-powered-off state (dispext back to 0x3ff / 0x1404034f, DP-2 reconnected, 0 new err lines, 0 Oops/WARN/SError), and cleanly refused docked s2idle (-EBUSY at suspend_noirq from 501f00000.nhi).
    • J716c (T6050, firmware 27.2) in a composite trial kernel (origin/main d3de772ac0c1 + stacked #3398 e270795bddde carrying #3410 9f33c3f95939, alongside #3717, #3409, #3273, #3289, #3359; composite 8d250d354c97): desktop boot clean (0 Oops/WARN/BUG/Call trace) and 3x eDP-1 DPMS off/on cycles (3456x2234 restored, enabled).

Historical checks at prior heads (predate 9f33c3f95939; f39fdeec3e43 also predates c7e82c6303b3 and the origin/main fdad0c5804d8 merge at ed71e9b038f2):

  • Hosted CI at ed71e9b038f2: apple-build, host-tests (including dcp-tunnel-prepare-tests.py), pr-text, KUnit dcp-fabric dcp-topology dcp-display, and readiness passed (an earlier cancelled readiness run also appears in rollup).
  • Historical offline checks at f39fdeec3e43: W=1 KCFLAGS="-Werror" object builds, checkpatch.pl --strict, display.kunitconfig (191 run), display.kunitconfig + CONFIG_SOUND=y CONFIG_SND=y (277 run), topology.kunitconfig (217 run), tests/.kunitconfig (117/117), and host/selftests (dcpaud 20/20, dart 24/24) passed before ed71e9b038f2 merged additional main display changes and before 9f33c3f95939 updated audio.c/av.c.

Prior hardware rows (predate c53590aa9533 / f39fdeec3e43 / ed71e9b038f2 / 9f33c3f95939):

  • J713 (M4 MacBook Air, T8132, 27.2 firmware, default command line) at feef88606c29 (429e7e15f122 merged, before #2673 merged): unaffected-main smoke passes: boots with 0 failed units (system and user), 0 AppArmor denials, 0 oops/WARN, eDP-1 2560x1664@60 enabled, 3 internal-panel DPMS off/on cycles and one 15 s s2idle clean; kernel err lines are the 3 on the default boot plus 2 from the external display processors, which did not probe on 429e7e15f122 (-ENODEV, "no IOMMU domain"). That tree had no dcp-dp-audio PCM (aplay -l lists only the jack and speaker cards), so the unplugged DP-audio PCM open / hw_params / hw_free / close path was not exercised on J713; it is covered by KUnit and the host suite above and needs a Mac with a probed external display processor (J813, or refreshed J713 on 41ab8f546874 with #2673 now merged).
  • J716c (T6050) at c4797d399ba0 with #3398 + #3662: TS5 dock with two 3840x2160 displays, 30 s deep sleep resume clean.
  • J313 (T8103) USB-C hot-plug pass on stacked #3334 (93c1460e0500), J813 (T8142, appledrm.s2r_untested=1) deep-sleep pass at 944b0ba788d2 (later failed unplugged DP-audio probe at c4797d399ba0), and J713 (T8132) combined trial build (05d728d91d68 + companion PRs #2673, #3297, #3300).

Risk: two-way door · Type-C-only firmware-27 external display processors with driver-profile s2r_ext, !s2r_disp_dart_with_dcp, DT apple,display-power, and dcp-dp-audio PCM opens (apple_dcp_hw_t8142_dcpext with appledrm.s2r_untested=1; apple_dcp_hw_t8132_dcpext_v27 on main via #2673 alongside #3297, #3300; apple_dcp_hw_t8103_dcpext keeps runtime idle-off disabled via !s2r_disp_dart_with_dcp until #3334 lands).

Revert: git revert -m 1 <merge_commit> on main (or revert 9f33c3f95939, c7e82c6303b3, f39fdeec3e43, 38c26d8a6b57, 8dfc3f8783aa, and 3daae875ba72 in reverse order). Kernel driver and test changes only; no persistent on-disk, ESP, Stage 2, or DT state is modified.

Not yet:

  • Live hardware verification and hosted CI at current head 9f33c3f95939:
    • J716c (T6050, passed desktop boot and 3x eDP-1 DPMS off/on via stacked #3398 e270795bddde): docked hot-plug, external DCP idle-off domain/debug verification, DP audio playback/unplug (playback -> close -> unplug -> idle-off -> reopen -> hw_params), s2idle with local key-press wake, and real deep sleep/resume.
    • J713 (T8132, with #2673 on main) refreshed smoke + external DCP idle-off/S2R/hotplug wake + DP audio row (J713 currently off-network/unreachable; trial kernels built and staged).
    • J313 (T8103) standalone #3410 unaffected-main smoke (verified at 9f33c3f95939 via stacked #3334 7be3a9cd7395; in #3410 alone, !s2r_disp_dart_with_dcp keeps runtime idle-off disabled until #3334 lands; physical-unplug undocked s2idle also remains unvalidated on #3334).
    • J813 (T8142, fw 27.2, appledrm.s2r_untested=1) unplugged dcp-dp-audio PCM probe after idle-off (PipeWire/WirePlumber cold boot), physical USB-C hot-plug DP audio + display playback, unplug, re-gate, and default-command-line T8142 qualification (hardware not on site; failed at c4797d399ba0 before f39fdeec3e43).
  • Hosted CI at 9f33c3f95939; stacked PRs #3334 and #3398 must be retargeted to main before #3410 merges.
Details

Replaces #3308 targeting main (origin/main fdad0c5804d8 merged at ed71e9b038f2). Six PR commits (3daae875ba72, 8dfc3f8783aa, 38c26d8a6b57, f39fdeec3e43, c7e82c6303b3, 9f33c3f95939):

  • Introduces an explicit idle state machine (DCP_EXT_IDLE_ON, OFF, FAILED, CLOSED) under ext_idle_lock strictly inner to dcp_typec_fabric_lock, scoped to dcp_ext_idle_capable(dcp) pipelines (dcp_s2r_ext_capable(), !dcp->hw.s2r_disp_dart_with_dcp, DCP_FIRMWARE_V_27_0, DRM_MODE_CONNECTOR_USB, !hdmi_hpd).
  • Keeps dcp_ext_idle_capable() false when dcp->hw.s2r_disp_dart_with_dcp is set (38c26d8a6b57) so landing #3410 alone on main never triggers T8020 dark-DART power-gating without #3334's fixes, while preserving dcp_s2r_ext_capable() for system sleep.
  • Resolves origin/main (41ab8f546874) in c53590aa9533: preserves both dcp_ext_idle_kick(dcp) and fixed_deselected = true on mux_control_deselect() in dcp-fabric.c, and preserves dcp_ext_idle_suspend() ahead of the firmware-27 deep-sleep refusal for external processors without a stop in dcp.c.
  • Defers dcp-dp-audio ADMA channel request and DMAengine setup (f39fdeec3e43, 9f33c3f95939) when dcp_pcm_open() opens while disconnected (open_unplugged = !dcpaud->connected), selecting substream->managed_buffer_alloc per open (0 at the start of dcp_pcm_open(), enabling snd_pcm_set_managed_buffer() / managed_buffer_alloc = 1 only when opening plugged with DMA) so an unplugged reopen after an earlier plugged open+close never triggers ALSA's pre-hw_params managed DMA allocation and instead uses the SNDRV_DMA_TYPE_VMALLOC void-playback buffer fallback (dcpaud_alloc_void_buffer() / dcpaud_free_void_buffer()). Unplugged streams track the exact allocated void_dmab pointer and free it symmetrically via snd_dma_free_pages() + kfree(dmab) on hw_free, hw_params reallocation, and close without calling snd_pcm_lib_free_pages() and detaching the runtime buffer only when runtime->dma_buffer_p == dmab.
  • When dcp_pcm_open() opens plugged (DMA-backed), dcp_audio_dma_get(dcp_dev) wakes any idle-gated parent external DCP and increments dcp->ext_idle_audio_users under ext_idle_lock (gating dcp_ext_idle_eligible()). Plugged opens on an external DCP whose idle state latched DCP_EXT_IDLE_FAILED return ext_idle_err (or -EIO if unset). On open failure after channel acquisition or on PCM close, DMA is released (dcpaud_release_dma(), or dcpaud_release_dma_locked() inside dcp_pcm_native_close() / dcp_pcm_native_open() error cleanup) before dcp_audio_dma_put(dcp_dev) drops the pin and re-kicks idle power-off so unplugged PCM opens avoid requesting ADMAC channels and plugged streams hold the external DCP awake until their TX DMA channel is released. Non-apple_platform_driver test devices safely no-op.
  • Adds dcp_ext_idle_wake() and dcp_ext_idle_kick() stubs in tools/asahi/dcp-tunnel-prepare-tests.py (c7e82c6303b3).
  • Tracks idle admission pause via ext_idle_paused under hpd_mutex, checks pending Type-C work non-blockingly, adds dcp_push_try(), darkens/drains display and DCP DARTs before A500, polls iomfb_channels_idle() before RTKit stop, tracks ext_idle_domains_off, and wakes idle-gated pipes on suspend or unbind.
Evidence
  • Current head 9f33c3f95939 (9f33c3f95939 per-open managed_buffer_alloc fix on top of ed71e9b038f2):
    • git diff --check origin/main..HEAD — 0 issues.
    • ./scripts/checkpatch.pl --strict --git ed71e9b038f2..HEAD — 0 errors, 0 warnings, 0 checks on 9f33c3f95939 (and 0/0/0 across 3daae875ba72, 8dfc3f8783aa, 38c26d8a6b57, f39fdeec3e43; c7e82c6303b3 has 1 missing-description warning).
    • make O=_build ARCH=arm64 LLVM=1 W=1 KCFLAGS="-Werror" drivers/gpu/drm/apple/audio.o drivers/gpu/drm/apple/av.o drivers/gpu/drm/apple/dcp.o drivers/gpu/drm/apple/dcp-fabric.o drivers/gpu/drm/apple/iomfb.o drivers/gpu/drm/apple/iomfb_v27.o drivers/gpu/drm/apple/iomfb_h17p.o drivers/gpu/drm/apple/iomfb_v26_6_desktop.o (aurora_defconfig + asahi.config, CONFIG_RUST=n): 0 errors, 0 warnings.
    • ./tools/testing/kunit/kunit.py run --arch=arm64 --make_options LLVM=1 --kunitconfig=drivers/gpu/drm/apple/tests/display.kunitconfig: 207 run: 206 passed, 1 skipped (apple_g17_rx_util_min_test needing CONFIG_UCLAMP_TASK), including apple-dcp-firmware 7/7 (dcp_ext_idle_s2r_disp_dart_gate, dcp_ext_idle_audio_dma_pin).
    • ./tools/testing/kunit/kunit.py run --arch=arm64 --make_options LLVM=1 --kunitconfig=drivers/gpu/drm/apple/tests/display.kunitconfig --kconfig_add CONFIG_SOUND=y --kconfig_add CONFIG_SND=y: 294 run: 292 passed, 2 skipped (apple_g17_rx_util_min_test, dcpaud_no_sio_test), including apple-dcpaud-legacy 11/11 (dcpaud_legacy_unplugged_void_buffer, dcpaud_legacy_unplugged_hotplug_managed_buffer, dcpaud_legacy_plugged_close_unplug_reopen_vmalloc) and apple-dcp-firmware 7/7.
    • ./tools/testing/kunit/kunit.py run --arch=arm64 --make_options LLVM=1 --kunitconfig=drivers/gpu/drm/apple/tests/display.kunitconfig --kconfig_add CONFIG_SOUND=y --kconfig_add CONFIG_SND=y --kconfig_add CONFIG_DMADEVICES=y --kconfig_add CONFIG_DEBUG_KERNEL=y --kconfig_add CONFIG_DEBUG_MUTEXES=y --kconfig_add CONFIG_DRM_APPLE_DCP_T6030_AUDIO=y: 294 run: 293 passed, 1 skipped (apple_g17_rx_util_min_test), including apple-dcpaud-legacy 11/11.
    • ./tools/testing/kunit/kunit.py run --arch=arm64 --make_options LLVM=1 --kunitconfig=drivers/gpu/drm/apple/tests/topology.kunitconfig: 236 run: 235 passed, 1 skipped (apple_g17_rx_util_min_test).
    • ./tools/testing/kunit/kunit.py run --arch=arm64 --make_options LLVM=1 --kunitconfig=drivers/gpu/drm/apple/tests/.kunitconfig: 117/117 passed (apple-dcp-fabric).
    • python3 -I tools/asahi/run-host-tests.py --only dcpaud: 22/22 passed (dcpaud-open-fallback-tests + 12/12 mutants killed: no-retry, wait-any, gone-fails, keep-cookie, mask-all, drop-put-dma, void-lib-free, void-alloc-lib-free, managed-in-init-dma, void-free-runtime-dmab, stale-managed-on-unplug, no-rearm-managed-on-plug; dcpaud-sleep-hold-tests + 7 mutants + ref).
    • python3 -I tools/asahi/run-host-tests.py --only dart: 24/24 passed.
    • python3 -I tools/asahi/dcp-tunnel-prepare-tests.py: PASS.
    • python3 -I tools/asahi/dcpext26-startup-tests.py --mutants: PASS.
    • python3 -I tools/asahi/backlight-coldboot-tests.py: PASS.
    • python3 -I tools/asahi/display-sleep-merge-tests.py: PASS (17/17).
    • python3 tools/testing/selftests/drivers/gpu/apple-dcp/run.py --group audio: 2/2 passed (compact-audio-reply-bounds, cec-only-av-endpoint).
  • Hardware passes carrying 9f33c3f95939:
    • J313 (T8103, fw 27.2) composite (origin/main d3de772ac0c1 + stacked #3334 7be3a9cd7395 carrying 9f33c3f95939, composite 807c3bbf2263): 271c00000.dcp powered off idle ~5 s after DP tunnel drop via software NHI unbind+rebind (dcpext idle: powered off in 1 ms, PMGR dispext_fe 0x2300 / dispext_cpu0 0x0f040300, target 0 / actual 0), woke on attach (dcpext idle: woke in 1-2 ms, 0x23ff / 0x1404034f within 0.3 s, idle-off again ~17 s later; repeated twice), unattached USBC DP-audio PCM open returned rc 0 without waking domains, >= 7 eDP-1 DPMS cycles passed, 3/3 docked deep S2R resumes passed including one entered from idle-off (dispext 0x3ff / 0x1404034f, DP-2 reconnected, 0 new err lines, 0 Oops/WARN/SError), and docked s2idle cleanly refused -EBUSY (501f00000.nhi).
    • J716c (T6050, fw 27.2) composite (origin/main d3de772ac0c1 + stacked #3398 e270795bddde carrying 9f33c3f95939, composite 8d250d354c97): desktop boot (0 Oops/WARN/BUG/Call trace) and 3x eDP-1 DPMS off/on (3456x2234 restored, enabled).
  • Historical checks at prior heads (predate 9f33c3f95939):
    • Hosted CI at ed71e9b038f2: apple-build, host-tests, pr-text, KUnit dcp-fabric dcp-topology dcp-display, and readiness PASS (an earlier readiness run was cancelled).
    • Historical offline checks at f39fdeec3e43 (predates c7e82c6303b3, the origin/main fdad0c5804d8 merge at ed71e9b038f2, and 9f33c3f95939): W=1 KCFLAGS="-Werror" builds, checkpatch.pl --strict, display.kunitconfig (191 run / 190 passed), display.kunitconfig + CONFIG_SOUND=y CONFIG_SND=y (277 run / 275 passed), topology.kunitconfig (217 run / 216 passed), tests/.kunitconfig (117/117), and host/selftests (dcpaud 20/20, dart 24/24) passed.
  • Prior hardware runs (predate c53590aa9533 / f39fdeec3e43 / ed71e9b038f2 / 9f33c3f95939):
    • J713 (M4 MacBook Air, T8132, 27.2 firmware, default command line) at feef88606c29 (429e7e15f122 merged): unaffected-main smoke passed (0 failed units, 0 AppArmor denials, 0 oops/WARN, eDP-1 2560x1664@60, 3x DPMS, 15 s s2idle clean; external DCPs did not probe on 429e7e15f122).
    • J716c (T6050) at c4797d399ba0 with #3398 + #3662: TS5 dock with two 3840x2160 displays, both lit and survived 30 s deep sleep, 0 oopses.
    • J813 (T8142, fw 27.2, appledrm.s2r_untested=1) at 944b0ba788d2: 2x deep sleep/resume clean (boot object resumes 0 -> 1 -> 2). Later at c4797d399ba0, PipeWire/WirePlumber's unplugged /dev/snd/pcmC*D0p probe failed PS dispext0_adma / PS dispext1_adma (0xb4f -> -ENODEV), which f39fdeec3e43 fixes.
    • J313 (T8103, fw 27.2.1) USB-C hot-plug pass on stacked #3334 (93c1460e0500) and J713 (T8132) combined candidate (05d728d91d68 + companion PRs #2673, #3297, #3300).

Power off unattached Type-C-only firmware-27 external display processors
(dcpext) after 5 seconds of inactivity once no Type-C route, cable,
display connector, or Type-C background work is active.

Use an explicit idle state machine (ON, OFF, FAILED, CLOSED) serialized
under ext_idle_lock strictly inside dcp_typec_fabric_lock and scoped to
idle-capable pipelines:
- dcp_ext_idle_wake() never blocks on cancel_delayed_work_sync() while
  holding fabric locks, and dcp_ext_idle_off_work() checks pending Type-C
  work non-blockingly under hpd_mutex without calling
  dcp_disable_typec_work(), avoiding fabric/worker lock inversions and
  workqueue disable-depth imbalance.
- Poll iomfb_channels_idle() after A500 instead of an unconditional sleep,
  restore admission on pre-send A500 allocation failure (-ENOMEM), abort
  before cutting power if quiescence or DART stream shutdown fails,
  recover only domain power-off failures via dcp_s2r_ext_cycle(), latch
  FAILED across subsequent wake attempts and dcp_poweron(), and reconcile
  state on a successful sleep restart.
- Initialize ext_idle state early at probe, close admission (waking an
  idle-gated pipe before unbind/remove tears down resources) on component
  unbind, platform remove, and shutdown, and wake an idle-gated pipe
  before system suspend so DART PM never accesses registers while the
  display domains are powered off, re-arming the idle timer on resume.

On main, this remains gated by dcp_s2r_ext_capable() (currently requiring
s2r_ext and s2r_untested on firmware-27 external processors) until J713
v27.2 external display support lands.

Signed-off-by: Erik Bourget <erik@ebourget.net>
…in' into feat/dcp-v27-ext-idle-off

# Conflicts:
#	drivers/gpu/drm/apple/dcp.c
@erikwb
erikwb requested review from a team and DjDeveloperr as code owners November 27, 2026 16:49
@github-actions github-actions Bot added area:display Area from CODEOWNERS (bot) area:gpu Area from CODEOWNERS (bot) ci-failing A check failed at the PR head (bot) door:two-way Revertible or not, from Merge risk (bot) needs-review No approving review from Core or Omarchy Mac yet (bot) labels Nov 27, 2026
@github-actions

github-actions Bot commented Nov 27, 2026 •

Copy link
Copy Markdown

Merge readiness at 465d7cf3: not ready yet

Check Detail
CI at head ok no CI for this change (the hardware row is the gate)
Review no needs one approving review from Core or Omarchy Mac (not the author)
Requested changes ok none
Hardware row at head ok comment at 465d7cf3
Conflicts ok none
PR text ok Risk: two-way · Type-C-only firmware-27 external display processors with driver-profile s2rext, !s2rdispdartwithdcp, DT apple,display-power, and dcp-dp-audio PCM opens (appledcphwt8142dcpext with appledrm.s2runtested=1; appledcphwt8132dcpextv27 on main via #2673 alongside #3297, #3300; appledcphwt8103dcpext keeps runtime idle-off disabled via !s2rdispdartwithdcp until #3334 lands). Revert: git revert -m 1 <merge_commit> on main (or revert 9f33c3f95939, c7e82c6303b3, f39fdeec3e43, 38c26d8a6b57, 8dfc3f8783aa, and 3daae875ba72 in reverse order). Kernel driver and test changes only; no persistent on-disk, ESP, Stage 2, or DT state is modified.

Areas: area:display, area:gpu

Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels.

dcp_push() now delegates to dcp_push_try() in iomfb.c, so extract
dcp_push_try() alongside dcp_push() in
tools/asahi/dcpext26-startup-tests.py.

Signed-off-by: Erik Bourget <erik@ebourget.net>
@erikwb

erikwb commented Nov 28, 2026

Copy link
Copy Markdown
Contributor Author

Fixed the host-tests failure (dcpext26-startup-tests) in 8dfc3f8783aa.

3daae875ba72 moved the dcp_push() implementation into dcp_push_try() in drivers/gpu/drm/apple/iomfb.c, which left tools/asahi/dcpext26-startup-tests.py failing to compile dcp_push() without dcp_push_try(). Commit 8dfc3f8783aa extracts dcp_push_try() alongside dcp_push() in tools/asahi/dcpext26-startup-tests.py and makes no changes to any kernel or driver source files, so the J813 hardware run at 944b0ba788d2 and the J713 combined trial run (#3308 component 05d728d91d68 combined with #2673 7a8022a6d24d, #3297 2b1bab104938, #3300 6a84c1d95460, #3307 eab8b5157340, and 3daae875ba72; combined build SHA unrecorded) remain valid for the built kernel.

Verified at 8dfc3f8783aa:

  • python3 -I tools/asahi/dcpext26-startup-tests.py and --mutants: PASS
  • python3 tools/asahi/backlight-coldboot-tests.py: PASS
  • ./scripts/checkpatch.pl --strict --git 9dd8b87b003c..8dfc3f8783aa: 0 errors, 0 warnings, 0 checks
  • python3 -I tools/asahi/run-host-tests.py --jobs 32: 726/727 passed (apple-dcp failed 5/96 subtests locally under clang 23.1.5, including cpuidle-s2idle on -Werror,-Wunused-but-set-global; CI host-tests passed apple-dcp on clang 18 at 944b0ba788d2)

@aurora-silicon-review aurora-silicon-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Verdict: FINISH, then merge at 8dfc3f87

Blockers:

  1. Hosted CI is not yet complete at 8dfc3f87 (readiness was cancelled and KUnit suites from asahi onward are still queued; wait for all checks to finish green).
  2. External Type-C/Thunderbolt display hot-plug verification after an external DCP has been powered off idle is still needed (carried forward from the review on closed #3308), and confirm default-command-line behavior without appledrm.s2r_untested=1 on the targeted boards (note companion PRs #2673/#3297/#3300 for J713).

Checked: PR body and commit delta (8dfc3f87 only extracts dcp_push_try in tools/asahi/dcpext26-startup-tests.py, leaving driver files identical to 944b0ba7 reviewed on #3308), no AI attribution, human Signed-off-by, apple-build/host-tests/kunit/pr-text status.

Evidence
  • 8dfc3f87 fixes the dcpext26-startup-tests structural failure without changing any kernel C file relative to 944b0ba7.
  • apple-build, host-tests, kunit, pr-text, and KUnit ane-boot/ane-pm/dcp-fabric/dcp-topology PASS at 8dfc3f87; readiness was cancelled and remaining KUnit jobs are queued.
  • Carrying forward the remaining gates noted on #3308 (full green CI + real external Type-C/TB hotplug after idle power-off).

@github-actions github-actions Bot removed the ci-failing A check failed at the PR head (bot) label Nov 28, 2026
@sithglan

Copy link
Copy Markdown
Contributor

CI at 8dfc3f8783aa is now 21/21 green (all KUnit jobs finished), so this and the stacked #3334 (fix/t8103-dcpext-idle-dart) look very close to ready to merge.

To help close Blocker #2 from review, I have an M5 Air (J813 / T8142, fw 27.2) and an M1 Air (J313 / T8103, fw 27.2.1) here with a physical USB-C DisplayPort monitor (EIZO) and Thunderbolt NVMe enclosure. If an exact-head 8dfc3f8783aa J813 hot-plug-after-idle-off row (boot unplugged -> confirm both external DCPs idle-off -> plug USB-C monitor -> confirm wake + output -> unplug -> confirm re-gating, with appledrm.s2r_untested=1) or a J313 row on #3334 (93c1460e0500) helps unblock #3410 + #3334 for merge, let me know and I can run it.

@sithglan

Copy link
Copy Markdown
Contributor

Ran physical USB-C display (EIZO 2560x1440@60) hot-plug-after-idle-off tests on both J313 and J813:

  1. M1 Air (J313 / T8103, fw 27.2.1, default cmdline, s2r_untested=N) at stacked #3334 head 93c1460e0500 (carrying #3410 driver code unchanged over 944b0ba788d2):
    • Unplugged EIZO (t=65.15 s) -> 271c00000.dcp powered off idle.
    • Re-plugged EIZO (t=304.106 s): dcpext idle: woke in 1 ms, Switched dpphy to dispext0,0, set_digital_out_mode finished:8274 (2560x1440@60, card1-DP-1: connected, enabled), 0 DART/IOMMU faults, 0 Oops/BUG/WARNING/SError.
    • On a subsequent active unplug hitting the pre-#3523 (#3157) setPowerState(0) timeout 1000 ms, iomfb_queue_settle() safely deferred idle power-off (dcpext idle: updates pending, deferring).
  2. M5 Air (J813 / T8142, fw 27.2) at exact head 8dfc3f8783aa:
    • Boot hit an asynchronous SError in n1-up (x21=0xbc2020018, 0000:01:00.2 Beta BAR0) because 8dfc3f8783aa is based on e12e25d49a76, predating d77eb3148dd1 (wifi: apple: centauri: enable function memory space before polling Beta BAR0) on main.
    • Happy to re-run the exact-head J813 idle-off -> hot-plug -> unplug -> re-gate row as soon as #3410 is rebased onto current main.

…-off

Signed-off-by: Erik Bourget <erik@ebourget.net>
External display processors whose display DART shares the coprocessor
power domain (s2r_disp_dart_with_dcp) require T8020 dark-DART state
saving, post-restore wake ordering, and layout-wide domain-off tracking
before runtime idle power-gating can safely power-cycle the display
DART.

Keep dcp_ext_idle_capable() false when s2r_disp_dart_with_dcp is set so
system suspend continues to work on main while runtime idle-off remains
gated on dark-DART wake support, and add a KUnit test covering the
capability gate.

Signed-off-by: Erik Bourget <erik@ebourget.net>
@erikwb

erikwb commented Nov 28, 2026

Copy link
Copy Markdown
Contributor Author

Added commit 38c26d8a6b57 on top of 58e5de18ccba (which merged origin/main 18058ea228e2, including d77eb3148dd1 for the T8142 Wi-Fi Beta BAR0 SError) so #3410 is safe to land on main independently:

  • dcp_ext_idle_capable() now requires !dcp->hw.s2r_disp_dart_with_dcp so pipelines whose display DART shares the coprocessor power domain keep runtime idle-off disabled until stacked #3334 lands with T8020 dark-DART save/restore and wake-ordering fixes, while dcp_s2r_ext_capable() continues to handle system sleep.
  • Added dcp_ext_idle_s2r_disp_dart_gate to drivers/gpu/drm/apple/dcp-firmware-test.c verifying s2r_disp_dart_with_dcp does not arm idle-off while non-coupled pipelines arm and disarm cleanly.

Verified at 38c26d8a6b57:

  • ./scripts/checkpatch.pl --strict --git 18058ea228e2..HEAD: 0 errors, 0 warnings, 0 checks across 3daae875ba72, 8dfc3f8783aa, and 38c26d8a6b57; git diff --check 18058ea228e2..HEAD clean.
  • make ARCH=arm64 LLVM=1 W=1 (defconfig + asahi.config, CONFIG_RUST=n) for drivers/gpu/drm/apple/{iomfb,iomfb_v27,iomfb_h17p,iomfb_v26_6_desktop,dcp,dcp-fabric}.o: 0 errors, 0 warnings.
  • arm64 QEMU KUnit: drivers/gpu/drm/apple/tests/display.kunitconfig 168 passed, 1 skipped (apple_g17_rx_util_min_test, needs CONFIG_UCLAMP_TASK, including apple-dcp-firmware 6/6); topology.kunitconfig 209 passed, 1 skipped; drivers/gpu/drm/apple/tests/.kunitconfig (apple-dcp-fabric) 117/117 passed.
  • Host tests at 38c26d8a6b57: tools/asahi/dcpext26-startup-tests.py PASS (including --mutants), tools/asahi/backlight-coldboot-tests.py PASS, tools/asahi/run-host-tests.py --only dart 16/16 passed, and tools/testing/selftests/drivers/gpu/apple-dcp/run.py --group quiesce --group lifecycle 30/35 passed (same 5 pre-existing local clang 23.1.5 failures as origin/main). Preserved the prior 726/727 host-test result and 21 successful old-head CI checks (distinct from the cancelled readiness check) at 8dfc3f8783aa.

Hardware status & open items:

  • J716c (T6050, batched trial kernel 3545ebecb76f at 58e5de18ccba with stacked #3398 b963090c1f2d): unaffected smoke row for #3410 (J716c idle-off behavior came from #3398 layered on #3410). All four dcpext instances returned to fControllerPowerState 0 after the pm_test cycles, 3x DPMS cycles (samples DCP state 0 during DPMS-off and records display re-enable during DPMS-on) passed, smoke clean, and 0 new failed system units (aurora-peripherals.service fails on default Stage 2 after warm reboots on this Mac).
  • J313 (T8103, Group E at 58e5de18ccba): trial kernel was built and parity-checked against main ee36fbdcd1c8 (all changed PR files IDENTICAL), and never booted because J313 became unreachable after the second deep-sleep cycle on baseline main (awaiting physical recovery; baseline s2idle also hard-resets J313).
  • Prior runs (predating 38c26d8a6b57): J313 USB-C physical hot-plug pass on stacked #3334 93c1460e0500 (iommu/apple-dart, drm/apple: fix T8020 display DART save/wake #3334 (comment)), J813 944b0ba788d2 deep-sleep pass with appledrm.s2r_untested=1 alongside the later 8dfc3f8783aa J813 boot failure before d77eb3148dd1 (drm/apple: power off idle firmware-27 external display processors #3410 (comment)), and the J713 combined trial build (historical combined build SHA unrecorded).
  • Current-head 38c26d8a6b57 hotplug and default-command-line qualification (J713, J813, J313 unaffected smoke) plus real s2idle / attach on J716c stay under **Not yet:**. Hosted CI must run on the final diff, and both #3334 and #3398 must be retargeted to main before #3410 merges.

@aurora-silicon-review aurora-silicon-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Verdict: FINISH at 38c26d8

The power-domain capability gate keeps runtime idle-off disabled for coupled display DARTs while preserving system sleep. The new KUnit exercises both sides of that gate. The prior J313 hot-plug is from the stacked series; the standalone revision needs default-command-line hot-plug on an eligible pipeline, unaffected coupled-pipeline smoke, and current hosted CI. Keep the two dependent branches coordinated before landing.

@github-actions github-actions Bot added ci-failing A check failed at the PR head (bot) merge-conflict Conflicts with the base branch (bot) labels Nov 29, 2026
Signed-off-by: Erik Bourget <erik@ebourget.net>

@aurora-silicon-review aurora-silicon-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Verdict: HOLD at c4797d399ba0

Blockers:

  • Hosted CI at c4797d399ba0 is still queued (1 passed, 0 failed, 20 queued/in-progress). Note that c4797d39 merged main at 94104a69 (just before #3672 / ae5505be fixed the apple-dcp probe-transaction-rollback host test on main), so host-tests may report that pre-existing main failure unless merged forward past ae5505be.
  • Standalone exact-head hardware verification on the default command line (external Type-C display hot-plug wake after idle-off on a non-coupled pipeline plus confirming coupled s2r_disp_dart_with_dcp pipelines remain disabled without #3334, as noted in the prior 38c26d8a review) is still pending.

Checked:

  • Forward-merge c4797d399ba0 (38c26d8a + origin/main 94104a69): verified clean conflict-free integration across all 12 PR files with human Signed-off-by and MERGEABLE status on main.
  • Verified dcp.c, dcp-fabric.c, dcp-internal.h, and dcp-firmware-test.c: !dcp->hw.s2r_disp_dart_with_dcp capability guard in dcp_ext_idle_capable(), dcp_ext_idle_s2r_disp_dart_gate KUnit coverage, dcp_ext_idle_close(dcp, false) before dcp_comp_unbind() on shutdown, and dcp_ext_idle_wake()/dcp_ext_idle_kick() hooks in dcp_typec_route_activate()/deactivate() survive intact.
  • Verified iomfb.c/iomfb_template.c (dcp_push_try() + iomfb_s2r_500() refcount cleanup) and all four host-test harnesses (backlight-coldboot-tests.py, dcpext26-startup-tests.py, lifecycle.py, quiesce.py); no Apple material or AI attribution.
Evidence
  • Head: c4797d399ba023bd6c22a50c8b5caab6b1c80a2d (base: main, MERGEABLE, +515/-20, 12 files, 7 commits).
  • Merge parents: 38c26d8a + 94104a69.

@github-actions github-actions Bot removed the ci-failing A check failed at the PR head (bot) label Nov 30, 2026
@github-actions github-actions Bot removed the changes-requested A reviewer requested changes (bot) label Dec 2, 2026
A plugged dcp-dp-audio PCM open sets substream->managed_buffer_alloc on
the persistent substream, which stays armed after close. If the sink is
then unplugged and the external display processor powers off at idle, a
subsequent unplugged open leaves managed_buffer_alloc set so ALSA
allocates or reuses the DMA buffer before hw_params() instead of taking
the uncounted vmalloc void buffer path.

Reset substream->managed_buffer_alloc at the start of dcp_pcm_open()
and enable it only when opening plugged with DMA (calling
snd_pcm_set_managed_buffer() on the first plugged open and setting
managed_buffer_alloc on subsequent plugged opens), so each open selects
its own buffer ownership.

Add KUnit and host open-fallback coverage for playback -> close ->
unplug -> idle-off -> reopen -> hw_params -> replug.

Signed-off-by: Erik Bourget <erik@ebourget.net>
erikwb added a commit that referenced this pull request Dec 2, 2026
…t-idle-dart

Signed-off-by: Erik Bourget <erik@ebourget.net>
erikwb added a commit that referenced this pull request Dec 2, 2026
…t-idle-off-t6050

Signed-off-by: Erik Bourget <erik@ebourget.net>
@github-actions github-actions Bot added the merge-conflict Conflicts with the base branch (bot) label Dec 2, 2026
Signed-off-by: DjDeveloperr <43033678+DjDeveloperr@users.noreply.github.com>
@DjDeveloperr

Copy link
Copy Markdown
Contributor

Forward-merged main bfe0462ae8b3 at 465d7cf315aa (tree 0bdb5976d491). This preserves 9f33c3f95939 and the earlier fixes. The Type-C activation and rollback paths retain both firmware-specific idle handlers, and deactivation keeps the atomic route clear.

  • Arm64 Clang W=1 drivers/gpu/drm/apple/ passed and linked the DCP, AFK and unplugged PCM KUnit cases into appledrm.o. KUnit was compiled and linked.
  • tools/asahi/run-host-tests.py --only passed for dcp-tunnel (18/18), dcpext26-startup (1/1), apple-afkv2 (2/2) and dcpaud-open (13/13).

The new head needs the J313 external idle-off and replug row, the J813 unplugged PCM and DP audio retest, and independent approval.

@DjDeveloperr DjDeveloperr removed the merge-conflict Conflicts with the base branch (bot) label Dec 2, 2026
@DjDeveloperr

Copy link
Copy Markdown
Contributor

SKIPPED (no external display attached) J714s (M5 Pro, T6050) linux#3410 head 465d7cf in composite b6002784 (main c2f1583 + #3410 465d7cf + #3334 7be3a9c + #3717 99fc90d + #3970 9b4f688, 7.3.0-m5-comp-3410-3970): only internal card2-eDP-1 connected (card2-DP-1..6 all disconnected) so ext-DCP DPMS-off/DP-audio check skipped; no-regression across boot + 2x rtcwake -m mem -s 20 + post-resume GPU smoke (0 DCP/DART/GPU/Oops/WARN/BUG faults, WDT armed, clean stock handback b2c723cd).

@DjDeveloperr

Copy link
Copy Markdown
Contributor

Review at 465d7cf315aa: the code is fine to merge once the hardware rows below are in.

I read the full diff. Idle-off applies only to Type-C firmware-27 external display processors whose display DART is not in the coprocessor's power domain. The off work runs under ext_idle_lock. It defers while any Type-C work is busy, and it pauses relinks under hpd_mutex before stopping anything. Each failure before the stop reopens the DARTs and retries. A failure after the stop marks the processor failed instead of leaving it half off. Attach, DP connect, power-on, suspend and unbind all wake the processor synchronously before they touch it. The pre-suspend drain does nothing for a processor without a panel, so the off work cannot wait on its own waiters. An unplugged PCM open no longer touches the ADMA channel. A plugged open pins the processor until close, and every exit path undoes that pin. This covers the earlier J813 -ENODEV report. Shutdown leaves an idled processor off and does not unbind it.

Local checks on a merge with main b3a5fda631b9 (merge-tree clean, merge tree 5e9f2b24a1b3), on the x86_64 build box:

  • make ARCH=arm64 LLVM=1 W=1 drivers/gpu/drm/apple/ (aurora_defconfig, CONFIG_DRM_APPLE_KUNIT_TEST=m, CONFIG_DRM_APPLE_DCP_T6030_AUDIO=y): 47 objects rebuilt, including dcp.o with dcp-firmware-test.c and audio.o with audio-legacy-test.c, with 0 warnings and 0 errors. main alone was also clean. The KUnit cases compiled but were not run (no QEMU here).
  • git diff main..merge | scripts/checkpatch.pl --strict --no-signoff -: 0 errors, 0 warnings, 0 checks.
  • git diff --check main..merge: clean.
  • python3 -I tools/asahi/run-host-tests.py --jobs 16 (full suite, in the hosted workflow's ubuntu 24.04 image with clang 18 and rust 1.96, no network): 974/976 passed, including dcpaud-open, dcp-tunnel, dcpext26-startup, backlight-coldboot and display-sleep-merge. The 2 failures are centauri-scan-tests and its negative controls, which fail the same way on plain main (the Bluetooth harness doesn't build there).

Still needed before merge: hardware rows at exact head 465d7cf315aa on two generations (the M4 mini and M5 Pro composite results).

@github-actions github-actions Bot removed the needs-hw-row No hardware row at the PR head (bot) label Dec 2, 2026
@DjDeveloperr

Copy link
Copy Markdown
Contributor

J773g (T8132 / M4 mini) exact-head 465d7cf315aa (465d7cf315aa2be0bf1b39aded6954318277cb62): PASS (non-apple,display-power T8132 control, composite 7.3.0-j773g-comp-3410-3334 on main c2f1583e + #3410 + #3334 + #3717 + #3970 + #3799, merge tree 2d03eb2c7dbd, boot_id=edc6e272-ea87-4529-819a-b7d752dbe77f, panic=10, WDT 178 s).

  • Display / DCP PM: Both external DCPs (286e00000.dcp, 48ae00000.dcp) log no apple,display-power in the device tree, the firmware keeps running (expected on t8132-j773g.dtb; dispext0/1 genpds stay on). DP-3 (3840x2160@60) DPMS Off -> On (rc=0, dcp_poweroff() done -> dcp_poweron() starting) and forced connector disconnect (off) -> reconnect (detect) + plasmalogin active all restored cleanly.
  • Audio: t8132-j773g.dtb has no /sound node (--- no soundcards ---; ADMACs 393300000/393800000 bind cleanly), so HDMI/DP ALSA playback was skipped.
  • Health: 0 DART faults, 0 WARN/BUG/Oops/SError, 0 failed systemd units.

@DjDeveloperr

Copy link
Copy Markdown
Contributor

PASS (no-regression control) J714s (M5 Pro, T6050) linux#3410 head 465d7cf in composite b6002784 (7.3.0-m5-comp-3410-3970): apple_dcp_hw_t6050_dcpext leaves .s2r_ext=false so dcp_ext_idle_capable() is false on T6050; all 4 external DCPs (2b2e00000, 392e00000, 302e00000, 306e00000) stayed on apple,display-method-sleep across boot + 2x rtcwake -m mem -s 20 + post-resume Vulkan/GL smoke with internal card2-eDP-1 healthy and 0 DCP/DART/GPU/Oops/WARN/BUG faults, WDT armed, clean stock handback (b2c723cd).

@DjDeveloperr

Copy link
Copy Markdown
Contributor

Approve and merge at 465d7cf315aa. My review is in the comment above. I also checked the last main merge in this head. It keeps both the firmware-27 and the M4 idle wake on Type-C activation, and on each later error path it kicks the firmware-27 idle work and releases the M4 one. The dcp.c resolution drops a duplicate copy of main's dcp_commit_stop_disarm() block, so main's resume code is unchanged.

Hardware at this exact head:

  • J773g (M4 mini, T8132): PASS. External DPMS off/on and connector disconnect/reconnect restored cleanly, with 0 DART faults and 0 WARN/BUG/Oops. Its device tree has no apple,display-power, so idle-off stays inactive there.
  • J714s (M5 Pro, T6050): no regression across boot, two rtcwake -m mem sleeps and a post-resume GPU smoke, with 0 DCP/DART/GPU faults. No external display was attached, and T6050 idle-off needs drm/apple: wire firmware-27 T6050 external DCPs into runtime idle off #3398.

Both are no-regression rows. Idle-off itself, the replug wake and the unplugged DP-audio open were exercised on J313 at 9f33c3f95939, and the code has changed only through main merges since then. Local checks, all passing apart from the two centauri-scan-tests failures that main has too, are in my comment above.

@DjDeveloperr
DjDeveloperr merged commit e06db86 into main Dec 2, 2026
@DjDeveloperr
DjDeveloperr deleted the feat/dcp-v27-ext-idle-off branch December 2, 2026 19:49
@DjDeveloperr
DjDeveloperr restored the feat/dcp-v27-ext-idle-off branch December 2, 2026 19:49
@DjDeveloperr
DjDeveloperr deleted the feat/dcp-v27-ext-idle-off branch December 2, 2026 19:50
DjDeveloperr added a commit that referenced this pull request Dec 2, 2026
Bring in main ccb3d8b, which now carries #3410. Keep both the
external idle power-off fields and the firmware 27 idle-cache fields in
struct apple_dcp. Take main's dcp_push_try() and pass unwind_on_err =
false there, so only the idle-cache submit unwinds a failed send, and
keep the KUnit iomfb_test_push_context() wrapper.

Signed-off-by: DjDeveloperr <hey@djdev.me>
@RyanTheTide

Copy link
Copy Markdown
Contributor

Build break at 465d7cf3 with a modular (fleet-style) config

Building this head with our fleet kernel config (CONFIG_DRM_APPLE=m, CONFIG_SND=m, CONFIG_SND_PCM=m, CONFIG_DRM_APPLE_DISPLAY_KUNIT_TEST=y; arm64, LLVM 22.1.6) fails at modpost:

ERROR: modpost: drivers/gpu/drm/apple/appledrm.ko: symbol 'snd_pcm_lib_preallocate_free' undefined!

audio.c includes the new audio-legacy-test.c under IS_ENABLED(CONFIG_DRM_APPLE_DISPLAY_KUNIT_TEST), and that test calls snd_pcm_lib_preallocate_free() (audio-legacy-test.c:384). That function is declared in include/sound/pcm.h but has no EXPORT_SYMBOL in sound/core/pcm_memory.c, so the link only works when ALSA is built in. Options: use an exported helper (e.g. snd_pcm_lib_preallocate_free_for_all() or snd_pcm_set_managed_buffer() teardown), or make that test depend on SND=y.

The J713 hardware row is running now on the same head with only DRM_APPLE_DISPLAY_KUNIT_TEST turned off (runtime code unchanged); I'll post it separately.

@RyanTheTide

Copy link
Copy Markdown
Contributor

J713 row at exact head 465d7cf3: no regression, but idle-off does not engage on this J713 (MacBook Air M4, T8132, firmware 27.2, two apple,t8132-dcpext DCPs with apple,display-power, nothing attached)

  • A: saved 7.3.0-aurora-fleet94. B: one-shot 7.3.0-mrows3410 built from 465d7cf315aa with the fleet config. The only change is DRM_APPLE_DISPLAY_KUNIT_TEST=n, needed for the modpost break above, and that option only gates test code. Booted through a BLS one-shot entry; saved default unchanged. appledrm.s2r_untested=Y on both.
check A fleet94 B 465d7cf3
(1) nothing attached: dispext0_cpu / dispext1_cpu (+ _fe, pmc-dispext*-interface) in pm_genpd_summary, 60 s after boot all on all on (no idle-off)
(2) open/write/close the DP-audio PCM of each unplugged port (hw:8,0, hw:9,0, 1 s of zeros) returns in ~1 s, rc 0 returns in ~1 s, rc 0; no hang
(4) one rtcwake -d rtc1 -m freeze -s 20 resumes, rc 0 resumes, rc 0; both dcpext RTKits re-init on resume, domains on before and after
DCP crashes / DART faults / WARN / Oops 0 / 0 / 0 / 0 0 / 0 / 0 / 0
(3) USB-C hot-plug after idle-off not testable: no display is attached to this J713, and idle-off never happened same

Why no idle-off here: with dynamic debug enabled on all five dcpext idle: call sites, a re-kick (a DP-audio open/close) logs nothing. No firmware stop enabled / no display power layout / keeps running info line appears for 286e00000.dcp or 48ae00000.dcp either. So dcp_ext_idle_capable() looks false on this board: one of s2r_dt_layout_ok, the dcpep_unnamed_500 method tag, or fixed_connector_type == USB isn't met with this J713's device tree (aura b18 Stage 2). If the J713 needs a newer DT, or a companion PR for the T8132 dcpext, tell me which and I'll re-run. The one failed unit on B (speakerguardd-v2-switchtest, exit 1) is the speaker self-check reacting to a non-fleet kernel; it's unrelated to this PR.

Restored afterwards: saved fleet94, test entry/kernel/modules removed, SELinux Enforcing, 0 failed units.

@joshuaswarren

Copy link
Copy Markdown
Contributor

J293 (13-inch MacBook Pro M1, T8103) peer-row for the M1 side: boot 465d7cf on top of main, kernel-only one-shot (release 7.3.0-lab-dcp3410, boot_id ca344e93).

Build caveat first: this head does not build under aurora_defconfig (CONFIG_SND=m): audio-legacy-test.c:384 calls snd_pcm_lib_preallocate_free(), which exists but is NOT exported in 7.3 (only ..._for_all, ..._pages, ..._pages_for_all are) — modpost fails on appledrm.ko. Test kernel carries a 4-line carry patch swapping to the exported snd_pcm_lib_preallocate_free_for_all(sub->pcm). Worth fixing in the PR itself.

Results at head (base = main @ merge parent):

  • Boot: clean. root btrfs via initramfs from this tree's modules, 162 modules loaded.
  • eDP: eDP-1 (Apple Panel 2560x1600@60, DSI) enumerates and drives.
  • DPMS 3x off/on: all 3 cycles PASS (dpmsStatus 1->0->1 each, via hl.dispatch dpms on Hyprland). Panel re-lights correctly each time.
  • s2idle: 1/1 cycle PASS — suspend entry 13:52, slept 34m22s, wake on macsmc-input key tap, 'PM: resume devices took 0.499s', suspend_stats success=1 fail=0, same boot_id throughout (no reset).
  • dmesg: 0 Oops / 0 WARN / 0 DART faults / 0 Call traces across boot + DPMS cycles + suspend/resume.

M1 unaffected by the T8020 idle-off path as expected (idle-off stays disabled here per the PR design).

DjDeveloperr added a commit to m0d16l14n1/linux that referenced this pull request Dec 2, 2026
The apple-dcpaud-legacy KUnit cases release the substream's preallocated
buffer with snd_pcm_lib_preallocate_free(), which ALSA does not export.
aurora_defconfig builds DRM_APPLE, SND and KUNIT as modules with
KUNIT_ALL_TESTS, so DRM_APPLE_DISPLAY_KUNIT_TEST is on, audio.c
includes the test into appledrm.ko, and modpost rejects the module with
snd_pcm_lib_preallocate_free undefined.

The exported snd_pcm_lib_preallocate_free_for_all() is no stand-in: it
walks pcm->streams[], and the tests' PCM is a zeroed struct with no
substream on that list, so it would free nothing and leak the 1 MiB
buffer.

Free the substream's dma_buffer with snd_dma_free_pages() instead. It
is the exported call snd_pcm_lib_preallocate_free() ends in, and the
one audio.c already uses for its void buffer. The steps left out are
the card's total_pcm_alloc_bytes decrement and clearing
dma_buffer.area, on a test card and substream that KUnit frees right
after.

Fixes: f39fdee ("drm/apple: defer unplugged DP audio DMA and pin idle-off external DCP")
Reported-by: Joshua Warren <816217+joshuaswarren@users.noreply.github.com>
Closes: aurora-silicon#3410 (comment)
Signed-off-by: DjDeveloperr <hey@djdev.me>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:display Area from CODEOWNERS (bot) area:gpu Area from CODEOWNERS (bot) door:two-way Revertible or not, from Merge risk (bot) needs-review No approving review from Core or Omarchy Mac yet (bot)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants