Skip to content

drm/apple: dcp: fix firmware-27 external and primary-HDMI s2r_ext deep sleep - #3822

Open
satchlj wants to merge 11 commits into
mainfrom
satchlj/dcp-s2r-ext-v27-disconnect
Open

satchlj wants to merge 11 commits into
mainfrom
satchlj/dcp-s2r-ext-v27-disconnect

Conversation

@satchlj

@satchlj satchlj commented Dec 1, 2026 •

Copy link
Copy Markdown
Member

Fixes #3790. Required for daily-use deep-sleep stability on Mac mini M2 (J473) with external USB-C and HDMI displays attached, and unblocks #3786 (T8112 deep sleep by default).

Problems

  1. Non-retained firmware-27 s2r_ext link withdrawal (-110 latch): dcp_s2r_ext_suspend() was the only caller of dcp_external_disconnect(dcp, false) not guarded by dcp_is_retained_external(dcp). On non-retained firmware-27 external DCPs, dptxport_set_hpd(false) used a 1000 ms timeout instead of the 15 s firmware-27 withdrawal bound, aborted without releasing the display on HPD-low error, and latched dcp->external_error for the rest of the boot.
  2. Primary external-output DCP routed through internal-panel dcp_s2r_capable() (-16 / no D572): On desktops whose primary DCP (231c00000.dcp) drives a fixed HDMI-A/DP PHY or external output rather than an internal eDP panel, dcp_poweroff() already turns the display pipe off on DPMS off and DRM suspend. Routing it through dcp_s2r_capable() sent a redundant set_power_state(0) waiting for D572 (timing out with -16), skipped HDMI HPD IRQ disable and link withdrawal before sleep, and bypassed fixed-HDMI reconnect on wake.
  3. Undrained s2r_ext teardown traffic before A500/idle (-62) and live-firmware crash cascade: When dcp_s2r_ext_suspend() withdraws an attached external display link immediately before sleep, hotplug work, AFK teardown replies, IOMFB callbacks, and RTKit RX/OSLOG traffic are still in flight before A500 and apple_rtkit_sleep_stop(). In addition, when apple_rtkit_sleep_stop() failed with the CPU still running (RUN set, not crashed), dcp_s2r_ext_suspend() unconditionally set dcp->crashed = true without undoing AP idle or restoring presentation/link work, so the next suspend entered dcp_s2r_stop_crashed() under live firmware and crashed warm restart.

Changes

  1. 5e7dcf85729e (dcp_s2r_ext_disconnect): Keep retained-external (H17P / ext26) pipes on dcp_external_disconnect(). For non-retained s2r_ext pipes, disconnect audio, mark typec_crtc_off (restored on error), withdraw split port 1 then port 0 with the 15 s firmware-27 HPD-low timeout, still attempt dcp_dptx_disconnect() if HPD-low fails, and never latch dcp->external_error.
  2. cb39f7a8f1eb (dcp_s2r_primary_external): Move dcp_s2r_pm_register() after fixed_phy and Type-C route setup in dcp_platform_probe_pipe(), exclude primary external-output DCPs from dcp_s2r_capable(), and route them (when s2r_no_secure_port is set) through dcp_s2r_ext_capable(). Internal eDP panels stay on dcp_s2r_capable() unchanged.
  3. 875c1cec941a (dcp_s2r_ext_quiesce_endpoints, dcp_s2r_ext_idle_stop): Flush hotplug work, RTKit RX, AFK endpoint workqueues, and in-flight IOMFB channels before A500; wait for IOMFB channels and RTKit RX after A500; poll and retry RTKit idle once when the firmware is still live; and on final refusal with a running non-crashed CPU restore AP power (dcp_s2r_idle_undo()), unpark the route, unpause presentation, re-enable Type-C work and HDMI HPD (reconnecting fixed HDMI when applicable), and leave dcp->crashed clear (matching dcp_s2r_quiesce()).

Tested

  • Untested on J473 hardware at head 875c1cec941a (no J473 or external USB-C DP monitor available here; kept as draft pending a J473 row at 875c1cec941a).
  • scripts/checkpatch.pl --strict across all three commits: 0 errors, 0 code warnings, 0 checks.
  • Host tests + negative-control mutations:
    • tools/asahi/dcp-s2r-ext-disconnect-tests.py: PASS + 6/6 mutations killed.
    • tools/asahi/dcp-s2r-primary-ext-tests.py: PASS + 6/6 mutations killed.
    • tools/asahi/dcp-s2r-ext-idle-tests.py: PASS + 6/6 mutations killed.
    • Related DCP host suites: dcp-hdmi-sleep-unplug-tests.py, dcp-sleep-phy-hold-tests.py, dcpext26-lifecycle-tests.py, dcpext26-suspend-route-tests.py all PASS.
  • Full arm64 build, KUnit, and run-host-tests.py suite running on CI at 875c1cec941a.

Risk

Two-way door. Scoped to non-retained s2r_ext external DCPs and primary external-output DCPs (with s2r_no_secure_port) during deep sleep (mem_sleep=deep); internal eDP panels, retained-external (H17P / ext26), and s2idle paths are unchanged.

dcp_s2r_ext_suspend() was the only caller of dcp_external_disconnect()
not guarded by dcp_is_retained_external(). On non-retained firmware-27
external DCPs (such as T8112/T8103/T8132-v27 dcpext), routing link
teardown through dcp_external_stop_locked() caused two failures during
deep sleep with a USB-C display attached:

1. dptxport_set_hpd(false) ran with v27_hpd_low_ms == 0 (1000 ms timeout)
   instead of the 15 s firmware-27 withdrawal bound used by
   dcp-v27-sleep.inc (V27_EXT_WITHDRAW_MS), and gave up without calling
   dptxport_release_display() when HPD-low failed or timed out.
2. Any error in release_link permanently latched dcp->external_error for
   the rest of the boot even though non-retained s2r_ext pipes have no
   retained epoch and stop the firmware cold on sleep, turning a single
   timeout into an immediate -110 refusal on every subsequent suspend.

Split the suspend link-withdrawal step into dcp_s2r_ext_disconnect():
- Keep dcp_external_disconnect(dcp, false) unchanged when
  dcp_is_retained_external(dcp) is true.
- For non-retained s2r_ext pipes, disconnect audio, mark attached Type-C
  outputs typec_crtc_off before dropping HPD (restoring it on failure),
  withdraw split port 1 (when active) then port 0 with
  DCP_V27_EXT_WITHDRAW_MS (15000 ms, shared with V27_EXT_WITHDRAW_MS) for
  DCP_FIRMWARE_V_27_0, still call dcp_dptx_disconnect() if HPD-low fails
  (matching dcp_poweroff() and dcp_t6040_ext_link_down()), and return any
  release error cleanly without latching dcp->external_error or mutating
  dcp->external_stopped.

Add host test tools/asahi/dcp-s2r-ext-disconnect-tests.py (registered in
tools/asahi/run-host-tests.py) exercising the extracted production code
against mocks and six negative-control mutations.

Signed-off-by: Satya Benson <satya@benson.earth>
@RyanTheTide

Copy link
Copy Markdown
Contributor

Row: 5e7dcf8 (+ #3786 8c8cce3, on main fe7d114) + J473 (Mac mini M2, 27.2 stub, USB-C + HDMI monitors both DPMS-off, default options, mem_sleep booted s2idle [deep]) + FAIL: a firmware crash in cycle 2 and a Mac reset in cycle 3.

  • Cycle 1: the link withdrawal now completes (dcp_dptx_disconnect(port=0), no DPTXRemotePort -110). Then apple-dcp 271c00000.dcp: RTKit: AP idle not acknowledged: -62 and firmware did not go idle: -62, control 0x10 status 0x2d, so dcp_platform_suspend returned -62 and the suspend aborted.
  • Cycle 2: 271c00000.dcp: firmware crashed: stopped cold for the sleep, started again after it with an RTKit crash dump (EL1 instruction abort). The primary then logged 231c00000.dcp: no D572 1059 ms after set_power_state(0) and returned -16, so the suspend aborted. USB, network, NVMe and the GPU triangle were still fine afterwards.
  • Cycle 3: the Mac reset during the suspend (nothing in the journal past rtcwake) and came back on the production kernel.

For comparison, #3786 alone on the same Mac in the same night state: 7/7 suspends aborted cleanly with -110 (#3790) and the Mac stayed healthy (#3786 issuecomment-7318187459). One difference: this time a USB4 peer link (thunderbolt0) was up, and the ACIO port power-off took 11 s of cycle 1. The resets are probably not the peer's doing, but I can rerun without it if that helps. Kit and logs are kept locally (not public); I can share specific lines.

@satchlj

satchlj commented Dec 1, 2026

Copy link
Copy Markdown
Member Author

Thanks for the J473 row — confirming dcp_dptx_disconnect(port=0) completed without -110 narrows this cleanly to two distinct follow-on failures once link withdrawal gets through:

  1. Cycle 1 (271c00000.dcp): A500 succeeded, then apple_rtkit_sleep_stop() timed out with AP idle not acknowledged: -62 (control 0x10 status 0x2d), leaving dcp->crashed = true after A500 + AP idle without an undo/stop — which then led to the Cycle 2 crash dump.
  2. Cycle 2 (231c00000.dcp): once 271c00000.dcp was stopped cold, primary 231c00000.dcp hit no D572 1059 ms after set_power_state(0) (-16) while already DPMS-off.

If you can share those specific apple-dcp / RTKit lines from the local log (no need to rerun yet):

  • Cycle 1 271c00000.dcp lines from suspend start through firmware did not go idle: -62 (especially whether DPTX port 0 HPD low failed appeared and any AFK/IOMFB messages between dcp_dptx_disconnect(port=0) and AP idle not acknowledged).
  • Cycle 2 271c00000.dcp crash header and 231c00000.dcp lines leading into no D572 1059 ms after set_power_state(0) (plus whether 231c00000.dcp logged any DPMS-off transition earlier in that boot).

@satchlj

satchlj commented Dec 1, 2026

Copy link
Copy Markdown
Member Author

Follow-up from code inspection while waiting on the Cycle 1 271c00000.dcp log lines — Cycle 2 (231c00000.dcp: no D572 1059 ms after set_power_state(0), -16) has a clear root cause on main:

  • #3405 moved J473's fixed HDMI-A port onto primary 231c00000.dcp (apple_dcp_hw_t8112, .s2r = true) and added dcp_has_external_output() (dcpext || nr_typec_routes || fixed_phy), but dcp_s2r_capable() / dcp_s2r_ext_capable() were not updated to match.
  • As a result, 231c00000.dcp still enters the internal-panel dcp_s2r_quiesce() path (set_power_state(0) + D572 wait, skipping hdmi_hpd_irq disable, DPTX release, and dcp_fixed_hdmi_reconnect() on resume). When the HDMI monitor is already DPMS-off, dcp_poweroff() already ran _dcp_poweroff() (setPowerState(0)) and set dcp->pipe_off = true, and dcp_s2r_quiesce() does not check pipe_off (unlike dcp_t6041_stop_one() after 4becf7429859), so the second set_power_state(0) never gets a D572, returns -16, and marks 231c00000.dcp crashed.

Still holding code edits until we see the Cycle 1 271c00000.dcp -62 log lines so we address both cleanly.

@RyanTheTide

Copy link
Copy Markdown
Contributor

Lines from the J473 row at 5e7dcf85 (+ #3786 8c8cce32, main fe7d114c; both displays DPMS-off before the sleeps, USB4 peer link up). Kernel log via journalctl; production cmdline (no dyndbg), so dev_dbg lines are absent, and the monotonic stamps are journal stamps (everything after "Suspending console(s)" is flushed at resume, so the gaps between those lines are not real).

Cycle 1, all 271c00000.dcp lines from suspend entry to the abort (nothing else from 271c00000 in between: no DPTX port 0 HPD low failed, no AFK/IOMFB syslog lines between dcp_dptx_disconnect(port=0) and AP idle not acknowledged):

[  242.730015] PM: suspend entry (deep)
[  253.990940] printk: Suspending console(s) (use no_console_suspend to debug)
[  253.990949] aurora 206400000.gpu: GPU prepared for deep sleep: submitted=820 completed=820 pending=0
[  253.991083] xhci-hcd xhci-hcd.1.auto: USB bus 3 deregistered
[  253.991146] ieee80211 phy0: brcmf_configure_lpas: LPAS setup failed (-107), using disconnect fallback
[  253.991252] apple-dcp 271c00000.dcp: __av_service_disconnect: stopping audio service
[  253.991355] apple-dcp 271c00000.dcp: dcp_hotplug() connected:0 valid_mode:0 nr_modes:31
[  253.991454] sd 0:0:0:0: [sda] Synchronizing SCSI cache
[  253.991580] apple-dcp 271c00000.dcp: dcp_dptx_disconnect(port=0)
[  253.991675] apple-dcp 271c00000.dcp: RTKit: AP idle not acknowledged: -62
[  253.991765] apple-dcp 271c00000.dcp: firmware did not go idle: -62, control 0x10 status 0x2d
[  253.991872] apple-dcp 271c00000.dcp: PM: dpm_run_callback(): dcp_platform_suspend [appledrm] returns -62
[  253.991960] apple-dcp 271c00000.dcp: PM: failed to suspend: error -62
[  253.992050] PM: Some devices failed to suspend, or early wake event detected
[  253.992062] tg3 0000:03:00.0 end0: Link is down
[  253.992192] aurora 206400000.gpu: GPU: deep sleep refused before commit

The suspend took 11.3 s wall, most of it before freeze (ACIO port power-off / xhci-hcd.1 removal, 242.75 -> 253.99).

Cycle 2 lead-in (271c00000 crash line, then 231c00000 into the -16):

[  283.748461] printk: Suspending console(s) (use no_console_suspend to debug)
[  283.748474] aurora 206400000.gpu: GPU prepared for deep sleep: submitted=844 completed=844 pending=0
[  283.748712] usb 3-1.4: USB disconnect, device number 4
[  283.748753] xhci-hcd xhci-hcd.1.auto: USB bus 3 deregistered
[  283.748814] ieee80211 phy0: brcmf_configure_lpas: LPAS setup failed (-107), using disconnect fallback
[  283.748976] apple-dcp 271c00000.dcp: firmware crashed: stopped cold for the sleep, started again after it
[  283.749148] apple-dcp 231c00000.dcp: RTKit: syslog message: FramebufferDCP.cpp:4778: clamshell value is 1
[  283.749298] sd 0:0:0:0: [sda] Synchronizing SCSI cache
[  283.749498] apple-dcp 231c00000.dcp: no D572 1059 ms after set_power_state(0)
[  283.749659] apple-dcp 231c00000.dcp: PM: dpm_run_callback(): dcp_platform_suspend [appledrm] returns -16
[  283.749795] apple-dcp 231c00000.dcp: PM: failed to suspend: error -16
[  283.749931] PM: Some devices failed to suspend, or early wake event detected

The RTKit crash dump of 271c00000 follows after failed to suspend (EL1t, ESR 0x86000004 instruction abort, PC = FAR = 0xe252912b58c90488).

231c00000 DPMS-off earlier in that boot: yes. Before the first sleep it went off -> on at boot, then IOMFB: power on -> off at 13.2 s (on again 13.45 s) and at 60.2 s (the runner DPMS-off; fSoftPowerState 0), and it stayed off through cycles 1 and 2:

[   13.217704] apple-dcp 231c00000.dcp: RTKit: syslog message: nifiedPipeline.cpp:5253: hard_power_state 0 fTimingsUpdatePowerState 0 fControllerPowerState 1 fSoftPowerState 1  newCtrlrState 0
[   13.217841] apple-dcp 231c00000.dcp: RTKit: syslog message: nifiedPipeline.cpp:5381: IOMFB: power on -> off vmaod 0 aot 0
[   13.450158] apple-dcp 231c00000.dcp: RTKit: syslog message: nifiedPipeline.cpp:5253: hard_power_state 1 fTimingsUpdatePowerState 1 fControllerPowerState 0 fSoftPowerState 1  newCtrlrState 1
[   13.450222] apple-dcp 231c00000.dcp: RTKit: syslog message: nifiedPipeline.cpp:5294: IOMFB: power off -> on vmaod 0 aot 0
[   60.213023] apple-dcp 231c00000.dcp: RTKit: syslog message: nifiedPipeline.cpp:5253: hard_power_state 1 fTimingsUpdatePowerState 1 fControllerPowerState 1 fSoftPowerState 0  newCtrlrState 0
[   60.213471] apple-dcp 231c00000.dcp: RTKit: syslog message: nifiedPipeline.cpp:5381: IOMFB: power on -> off vmaod 0 aot 0
[   60.252608] apple-dcp 231c00000.dcp: RTKit: syslog message: nifiedPipeline.cpp:5253: hard_power_state 0 fTimingsUpdatePowerState 0 fControllerPowerState 0 fSoftPowerState 0  newCtrlrState 0

Cycle 3 reset the Mac during the suspend; no log survived it.

A primary DCP driving an external output (fixed DP/HDMI PHY, Type-C
display routes, or an explicit HDMI/DP/USB connector type) has no
internal panel: dcp_poweroff() already turns the display pipe off on
DPMS off and DRM suspend. Routing it through internal-panel
dcp_s2r_capable() sends a redundant set_power_state(0) and times out
waiting for D572 (-16), skips HDMI HPD IRQ disable and DPTX link
withdrawal before sleep, and bypasses fixed-HDMI reconnect on wake.

Add dcp_s2r_primary_external() so primary external-output DCPs leave
dcp_s2r_capable() and (when s2r_no_secure_port is set) enter
dcp_s2r_ext_capable(). Move dcp_s2r_pm_register() after fixed_phy and
Type-C route setup in dcp_platform_probe_pipe() so the S2R PM notifier
sees the populated external-output state. Internal eDP panels stay on
dcp_s2r_capable() unchanged.

Add host tests and mutation checks in
tools/asahi/dcp-s2r-primary-ext-tests.py.

Signed-off-by: Satya Benson <satya@benson.earth>
… refusal

When dcp_s2r_ext_suspend() withdraws an attached external display link
immediately before system sleep, the firmware emits hotplug, AFK
teardown, IOMFB callback, and OSLOG counter traffic right before A500
and RTKit idle. Unlike dcp_s2r_quiesce(), dcp_s2r_ext_suspend() did not
flush hotplug work, AFK endpoint workqueues, or RTKit RX, did not wait
for IOMFB channels to go idle before or after A500, and did not poll and
retry RTKit idle once.

In addition, when apple_rtkit_sleep_stop() failed with the CPU still
running (control RUN set, not crashed), dcp_s2r_ext_suspend()
unconditionally latched dcp->crashed = true without undoing AP idle or
re-enabling presentation and link work. The next sleep then entered
dcp_s2r_stop_crashed(), clearing RUN under live firmware and crashing
warm restart.

Drain hotplug work, RTKit RX, AFK endpoint workqueues, and in-flight
IOMFB channels before A500, wait for IOMFB channels and RTKit RX after
A500, poll and retry RTKit idle once when the firmware is still live,
and on final idle refusal with a running non-crashed CPU restore AP
power, unpark the route, unpause presentation, re-enable Type-C work and
HDMI HPD (reconnecting fixed HDMI when applicable), and leave
dcp->crashed clear (matching dcp_s2r_quiesce()).

Add host test tools/asahi/dcp-s2r-ext-idle-tests.py (registered in
tools/asahi/run-host-tests.py) exercising the extracted production
functions against mocks and six negative-control mutations.

Signed-off-by: Satya Benson <satya@benson.earth>
@satchlj satchlj changed the title drm/apple: dcp: fix non-retained firmware-27 s2r_ext link withdrawal drm/apple: dcp: fix firmware-27 external and primary-HDMI s2r_ext deep sleep Dec 2, 2026
@satchlj

satchlj commented Dec 2, 2026

Copy link
Copy Markdown
Member Author

@RyanTheTide Thanks for the Cycle 1/2 log lines — they pinpoint all three failures cleanly. Pushed two follow-on commits on top of 5e7dcf85729e (merged latest main 844502ef16a3 so #3867 fixed-HDMI S2R support is in place; new head 875c1cec941a):

  1. Cycle 2 231c00000.dcp -16 (no D572 1059 ms after set_power_state(0)): Fixed in cb39f7a8f1eb. Primary fixed-HDMI DCPs have no internal panel and are already powered off by dcp_poweroff() on DPMS off, so dcp_s2r_primary_external() now routes them (with s2r_no_secure_port) through dcp_s2r_ext_capable() instead of dcp_s2r_capable(), skipping the redundant set_power_state(0) / D572 wait and wiring HDMI HPD disable + reconnect on wake. (dcp_s2r_pm_register() moves after fixed_phy and Type-C route setup so probe sees the populated external-output state.)
  2. Cycle 2 EL1t instruction abort (PC = FAR = 0xe252912b58c90488) and Cycle 3 reset: Fixed in 875c1cec941a. In Cycle 1, 271c00000.dcp refused idle (-62) while the CPU was still alive (control 0x10 status 0x2d), yet dcp_s2r_ext_suspend() unconditionally set dcp->crashed = true. Cycle 2 then entered dcp_s2r_stop_crashed() and pulled RUN=0 under live firmware. dcp_s2r_ext_idle_stop() now keeps dcp->crashed clear when !crashed && (ctrl & RUN), calls dcp_s2r_idle_undo(), and restores presentation, Type-C work, and fixed-HDMI HPD/reconnect (matching dcp_s2r_quiesce()). Genuine crashes still latch dcp->crashed = true.
  3. Cycle 1 271c00000.dcp -62 (AP idle not acknowledged): Addressed in 875c1cec941a. Unlike a USB4 dock (whose tunnel tears down during PM_SUSPEND_PREPARE), direct USB-C disconnects inside dcp_s2r_ext_suspend() right before A500, leaving hotplug work, AFK teardown replies, IOMFB callbacks, and RTKit RX/OSLOG traffic in flight. Added dcp_s2r_ext_quiesce_endpoints() (flushing hotplug work, RTKit RX, AFK endpoint workqueues, and in-flight IOMFB channels before A500), post-A500 IOMFB/RX drain, and a single poll+retry before refusing.

All three fixes are verified with host tests and 18/18 negative-control mutations (dcp-s2r-ext-disconnect-tests.py, dcp-s2r-primary-ext-tests.py, dcp-s2r-ext-idle-tests.py), not yet tested on J473 hardware. Whenever you have a J473 slot after CI finishes on 875c1cec941a, a re-test of 875c1cec941a + #3786 will tell us whether the pre-A500/post-A500 drain clears the Cycle 1 -62 too — and even if -62 still fires on J473, the Cycle 2 crash cascade is gone so one dyndbg="file rtkit.c +p; file dcp.c +p" run can capture what still holds AP idle cleanly.

RyanTheTide
RyanTheTide previously approved these changes Dec 2, 2026

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

Ran the three exact-head host fixtures for external disconnect, primary external routing, and idle refusal. All passed. The running-firmware refusal path undoes AP idle, restores presentation and link work, and leaves crashed clear. The primary HDMI route now goes through the external path while internal eDP keeps its original path. B7 still has the exact J473 dual-output committed sleep row.

@satchlj

satchlj commented Dec 2, 2026

Copy link
Copy Markdown
Member Author

Exact-head J413 (MacBook Air 13" M2, T8112, macOS 27.2 stub, internal eDP + dcpext with no external monitors attached) regression check at 875c1cec941a:

  • Boot (7.3.0-pr3822-ARCH, exact-head t8112-j413-fw27.dtb): 0 failed units, 231c00000.dcp (internal eDP) and 271c00000.dcp (dcpext) both bound with apple,display-power, MTP 3/3 inputs, Borealis 3D GPU render PASS.
  • s2idle (rtcwake -d rtc1 -m freeze -s 15, 2 cycles): 2/2 PASS, post-wake Borealis GPU render PASS.
  • Committed deep sleep (apple_sleep.deep=1 apple_sleep.untested_commit=1, echo deep > /sys/power/mem_sleep, rtcwake -d rtc1 -m mem -s 15, 3 cycles): 3/3 PASS (boot object resumes 0 -> 1 -> 2 -> 3, NUB.SPMI0.SW3, agx=1 gfx_err=0). Internal eDP (231c00000.dcp) stayed on dcp_s2r_capable() and dcpext (271c00000.dcp) ran dcp_s2r_ext_suspend() cleanly with 0 idle refusals, 0 no D572, 0 crashes/Oops/WARN; post-wake Borealis GPU render PASS, MTP 3/3, Wi-Fi up, 0 failed units.

(Note: J413 has internal eDP and no external HDMI/USB-C monitor attached; keeping PR in draft pending the J473 dual-output committed deep-sleep row at 875c1cec941a.)

@RyanTheTide

Copy link
Copy Markdown
Contributor

Row: 875c1ce + #3786 8c8cce32 (base main cf03d96b) + J473 (Mac mini M2, 27.2 stub) + FAIL: first deep sleep resets the Mac; s2idle 3/3 pass.

Setup: kernel-only one-shot, fleet94 config, production b18 Stage 2 (no T8112 DT change since). HDMI monitor on the primary DCP 231c00000; this time no USB-C monitor was connected (DP-1/DP-2 disconnected), so dcpext 271c00000 had no display. USB4 peer link up.

  • r1, production cmdline (mem_sleep = s2idle [deep] via soc: apple: sleep: T8112: enable deep sleep by default #3786): cycle 1 (rtc1, 20 s) reset the Mac. Nothing of that suspend reached the journal.
  • r2, same + netconsole to the buildbox (dmesg -n 8, printk console_suspend=N): the last line out is Freezing remaining freezable tasks completed, then the reset. No device prepare/suspend line at all, not even the GPU's prepared for deep sleep.
    For comparison, main cf03d96b + soc: apple: sleep: T8112: enable deep sleep by default #3786 without this PR (same J473, same displays, an hour earlier) gets through prepare and aborts cleanly in cycle 1 (231c00000 no D572 1049 ms after set_power_state(0) -16, 271c00000 idle, but not stopped: status 0x2d), then resets in cycle 2 (soc: apple: sleep: T8112: enable deep sleep by default #3786 comment 7341864491).
  • r3, same kernel + mem_sleep_default=s2idle: 3/3 s2idle PASS, USB/network/NVMe/GPU fine after each, no DCP crash, reboot PASS.

So on the J473 this head makes deep worse: an immediate reset instead of an abort. My guess is the new quiesce in the prepare/early suspend path on the HDMI-primary DCP (nothing is printed without dyndbg). The s2idle path is unaffected. If you want a dyndbg run (drm_apple/apple_dcp +p) or a USB-C-monitor run, say which, and I'll run it on the J473.

@RyanTheTide

Copy link
Copy Markdown
Contributor

Follow-up to my row above:

@satchlj

satchlj commented Dec 2, 2026

Copy link
Copy Markdown
Member Author

Thanks for testing this on J473 — two findings from auditing the trace against 875c1cec and Linux 7.3's suspend path:

1. Why netconsole stopped at Freezing remaining freezable tasks completed

netconsole stops transmitting before dpm_prepare() even with printk.console_suspend=N:

  • drivers/net/netconsole.c registers netconsole with CON_NBCON | CON_NBCON_ATOMIC_UNSAFE.
  • Right after Freezing remaining freezable tasks completed, suspend_devices_and_enter() calls console_suspend_all() (kernel/power/suspend.c), which sets console_irqwork_blocked = true before checking console_suspend_enabled (kernel/printk/printk.c).
  • With console_irqwork_blocked == true, NBCON switches to atomic output, and console_is_usable() skips CON_NBCON_ATOMIC_UNSAFE consoles unless panicking on that CPU.

So the absence of GPU prepared for deep sleep (which runs in dpm_prepare()) on netconsole is expected, and dyndbg over netconsole will not emit past that line either. Also verified in 875c1cec: nothing in #3822 runs in PM_SUSPEND_PREPARE or dpm_prepare() on T8112 — all of #3822 executes in dcp_platform_suspend() (dpm_suspend()).

2. Why Cycle 1 resets with #3822 vs Cycle 2 on #3786 alone

Comparing with your #3786-only run (#issuecomment-7341864491):

  • Without #3822, Cycle 1 aborted inside dpm_suspend() on 231c00000.dcp (no D572, latching dcp->crashed = true), so it never reached suspend_enter(). On Cycle 2, 231c00000.dcp hit dcp_s2r_stop_crashed() and returned 0, allowing deep sleep to proceed — and J473 reset on Cycle 2.
  • With #3822, 231c00000.dcp takes dcp_s2r_ext_suspend() on Cycle 1. Either:
    1. dcp_s2r_ext_suspend() succeeded on Cycle 1 and advanced straight to the same post-dpm_suspend / apple_sleep_enter() reset that #3786 alone hit on Cycle 2. Notable J473-vs-J413 differences in drivers/soc/apple/sleep-t8112.h and arch/arm64/boot/dts/apple/t8112-j473.dts: ps_dptx_ext_phy (0x3d8, held on via &framebuffer0 / &dptxphy, and phy-apple-dptx has no PM ops on T8112) is in t8112_ps_all[] but not in t8112_commit_off[] (and dcp_s2r_ext_suspend() leaves dcp->fixed_phy / dp2hdmi-pwren untouched), and J473 also has PCIe port01/port02 (ethernet0 tg3) enabled and &aop disabled.
    2. Or something inside dcp_s2r_ext_suspend() itself on primary HDMI 231c00000.dcp (e.g., dcp_s2r_stop_streams() on disp0_dart while &dptxphy is active, or link withdrawal / A500 / idle stop) resets before returning.

Cleanest J473 run to isolate (1) vs (2) with full journal + dyndbg

aurora_defconfig enables CONFIG_PM_DEBUG=y, so /sys/power/pm_test lets journalctl -k capture the full dcp.c/rtkit.c dyndbg trace without relying on netconsole:

  1. Test dpm_prepare() + dpm_suspend() + resume (pm_test=devices) with HDMI plugged on 231c00000.dcp:

    echo 'file drivers/gpu/drm/apple/dcp.c +p; file drivers/soc/apple/rtkit.c +p' > /sys/kernel/debug/dynamic_debug/control
    echo devices > /sys/power/pm_test
    echo mem > /sys/power/state
    echo none > /sys/power/pm_test
    • If pm_test=devices resets, the reset is inside dpm_suspend() (231c00000.dcp dcp_s2r_ext_suspend()).
    • If pm_test=devices passes and resumes, journalctl -k will show the exact 231c00000.dcp / 271c00000.dcp stop + HDMI wake trace.
  2. If devices passes cleanly, step pm_test to platform (dpm_suspend_late + dpm_suspend_noirq) and then core (secondary CPU offline + syscore_suspend, stopping right before suspend_ops->enter / apple_sleep_enter()), resetting back to none after each:

    • If devices + platform + core all pass and only real mem (none) resets, #3822 is clean on J473 and the reset is in apple_sleep_enter() (t8112_sleep_display_off / t8112_sleep_commit_regs / hardware wake — with ps_dptx_ext_phy 0x3d8 + dptxphy and port01/port02 tg3 as top suspects).

If you're able to run pm_test=devices (and platform/core if devices passes) with that dyndbg filter and paste the dcp/rtkit/apple-sleep journal lines, we'll immediately know whether the fix belongs in #3822 or #3786 / sleep-t8112.h.

@RyanTheTide

Copy link
Copy Markdown
Contributor

Control row: main 844502ef (this PR's base) + #3786, without this PR, on the same J473 in the same state (HDMI only, USB4 peer up), with netconsole:

  • Cycle 1: deep aborted after 2.2 s on 231c00000 (no D572 ... after set_power_state(0), -16); the Mac was fine after.
  • Cycle 2: the Mac reset.

That is the same as cf03d96b + #3786, so the 9 base merges don't matter. On the J473, the base aborts once and then resets on the next attempt; with this PR it resets on the first attempt.

Retraction: ignore the "last line out = Freezing remaining freezable tasks completed" part of my two comments above. In this control's cycle 1, which the Mac survived, netconsole is also silent from that line until well after resume. None of the -16 or resume lines arrived over the network, so the J473's network console is down for the whole suspend even with console_suspend=N. It can't show where a deep suspend dies, and the reset point with this PR is unknown.

What stands: J473 + this PR + #3786 resets on the first deep sleep (2/2 runs), and s2idle passes 3/3 on the same kernel. Next I trace how macOS 27.2 takes both DCPs into sleep on this J473 under our hypervisor and post the sequence.

Under run-host-tests.py, killed mutation runs must fail via a runtime
assertion without emitting a Python traceback (BROKEN_SIGN).

1. Pass -Wno-unused-function to cc only when --mutation is set so
   call-deleting mutations (skip-quiesce, skip-idle-undo,
   skip-fixed-hdmi-reconnect) compile and fail at their C assertions
   instead of failing compile with -Werror=unused-function.
2. Check the C test binary return code explicitly instead of passing
   check=True to subprocess.run(), so assertion aborts exit non-zero
   without printing a Python CalledProcessError traceback.

No kernel code changes.

Signed-off-by: Satya Benson <satya@benson.earth>
@RyanTheTide

Copy link
Copy Markdown
Contributor

Ran the pm_test=devices → platform → core sequence on J473 at #3822 875c1cec (+ #3786, kernel 7.3.0-aurora-b7dcp2, production b18 Stage 2, HDMI plugged on 231c00000.dcp, thunderbolt0 peer up, dyndbg enabled on dcp.c, rtkit.c, sleep.c):

Result: devices, platform, and core all PASSED (rc=0, 0 resets, 0 DCP crashes).
This isolates the J473 Cycle-1 reset to apple_sleep_enter() (real hardware commit, after syscore_suspend) rather than #3822 / dcp_s2r_ext_suspend().

Summary by stage

  • pm_test=devices: rc=0, PM: suspend devices took 10.323 seconds (first cycle hit suspend_test_finish >10s warning; cycles 2–3 took 0.455 s / 0.474 s), PM: resume devices took 2.759 seconds. Both DCPs stopped and came back cleanly; HDMI reconnected (connected:1) ~10 s after resume.
  • pm_test=platform: rc=0, suspend devices 0.455 s, resume devices 2.791 s. 236400000.sio transitioned 0x20 -> 0x201. Both DCPs stopped and came back cleanly; HDMI reconnected.
  • pm_test=core: rc=0, suspend devices 0.474 s, resume devices 2.752 s. Secondary CPUs 1–7 offlined and restored cleanly; both DCPs stopped and came back cleanly; HDMI reconnected.

pm_test=devices suspend/resume dcp / rtkit lines

[  120.447019] PM: suspend entry (deep)
[  138.729417] aurora 206400000.gpu: GPU prepared for deep sleep: submitted=751 completed=751 pending=0
[  138.729753] apple-dcp 271c00000.dcp: RTKit: AP power state transition: 0x20 -> 0x201
[  138.730039] apple-dcp 271c00000.dcp: RTKit: IOP power state transition: 0x20 -> 0x201
[  138.730141] apple-dcp 271c00000.dcp: RTKit: idle, but not stopped: status 0x2d
[  138.730243] apple-dcp 271c00000.dcp: firmware stopped for sleep: control 0x0 status 0x2d
[  138.730339] apple-dcp 231c00000.dcp: __av_service_disconnect: stopping audio service
[  138.730440] apple-dcp 231c00000.dcp: dcp_hotplug() connected:0 valid_mode:0 nr_modes:31
[  138.730533] apple-dcp 231c00000.dcp: dcp_dptx_disconnect(port=0)
[  138.730635] apple-dcp 231c00000.dcp: RTKit: AP power state transition: 0x20 -> 0x201
[  138.730729] apple-dcp 231c00000.dcp: RTKit: IOP power state transition: 0x20 -> 0x201
[  138.730823] apple-dcp 231c00000.dcp: RTKit: idle, but not stopped: status 0x2d
[  138.730919] apple-dcp 231c00000.dcp: firmware stopped for sleep: control 0x0 status 0x2d
[  138.731484] PM: suspend devices took 10.323 seconds
[  138.732060] PM: suspend debug: Waiting for 5 second(s).
[  138.732067] apple-dcp 231c00000.dcp: display domains off: CPU 0xf040300 FE 0x2300 SYS 0x2300
... (231c00000.dcp RTKit cold boot 0x0 -> 0x20)
[  138.737466] apple-dcp 231c00000.dcp: sleep refused: firmware back after a power cycle: 0
[  138.737579] apple-dcp 231c00000.dcp: dcp_fixed_hdmi_reconnect: DP2HDMI HPD connected:1
[  138.737705] apple-dcp 231c00000.dcp: dcp_dptx_connect_raw(port=0) die=0 atc=5 dfp_port=0 tunnel=0 typec=0 route=fixed conn_type=11 connected=0
[  138.738151] apple-dcp 231c00000.dcp: dcp_dptx_connect: waited 712 ms for link
[  138.738234] apple-dcp 231c00000.dcp: av_service_connect: starting audio service, plugged:1
[  138.738409] apple-dcp 271c00000.dcp: display domains off: CPU 0xf040300 FE 0x2300 SYS 0x2300
... (271c00000.dcp RTKit cold boot 0x0 -> 0x20)
[  138.741393] apple-dcp 271c00000.dcp: sleep refused: firmware back after a power cycle: 0
[  138.741553] PM: resume devices took 2.759 seconds
[  148.852739] apple-dcp 231c00000.dcp: dcp_hotplug() connected:1 valid_mode:0 nr_modes:31

pm_test=core delta (around CPU offline/online)

[  181.360409] PM: suspend devices took 0.474 seconds
[  181.360431] Disabling non-boot CPUs ...
[  181.360454] PM: suspend debug: Waiting for 5 second(s).
[  181.360471] Enabling non-boot CPUs ...
... (CPU1..CPU7 up)
[  181.362298] apple_pmp 23b500000.pmp: sleep refused before the commit: firmware never stopped
[  181.362472] apple-sio 236400000.sio: sleep refused: firmware not back after a reset (-19), stopped until a real sleep
[  181.362624] apple-dcp 231c00000.dcp: display domains off: CPU 0xf040300 FE 0x2300 SYS 0x2300
... (both DCPs cold-boot back cleanly; HDMI connected:1 at +10.1 s)

Active J473 PMGR domains before suspend (pm_genpd_summary)

Confirmed dptx_ext_phy (0x3d8) is on before suspend, along with apcie_gp, apcie_st, apcie, pcie_ref, disp0_sys/fe/cpu0, dispext_sys/fe/cpu0, pmp-disp0, pmp-dispext, ane_sys, scodec, atc0_*, atc1_pcie/common/usb.

So #3822 itself works cleanly on J473 through pm_test=core, and the remaining J473 real-deep reset is in apple_sleep_enter() (sleep-t8112.h / J473 board domains such as ps_dptx_ext_phy or PCIe port01/port02).

@RyanTheTide

Copy link
Copy Markdown
Contributor

Follow-up bisection inside apple_sleep_enter() on the same J473 kernel (7.3.0-aurora-b7dcp2, #3822 875c1cec + #3786, apple_sleep.refuse_late=1):

Result: cleanly reached refuse_late and unwound with -16 (-EBUSY), 0 resets, HDMI reconnected.

[  134.262998] apple-sleep 23b700000.sleep: 6 coprocessors up and stopped
[  134.263100] apple-sleep 23b700000.sleep: test: refused at the last check (refuse_late)
[  134.263176] apple-sleep 23b700000.sleep: refused before any commit coprocessor stop: -16
[  134.266579] apple-dcp 231c00000.dcp: DISPEXT0 lowered by the refused sleep: raised for the cycle
... (both DCPs cold-booted back; 231c00000.dcp dcp_hotplug() connected:1 at +10.1 s)

That clears apple_sleep_refuse(), apple_sleep_cpus_hold(), t8112_sleep_display_off(), apple_sleep_coprocs_check(), and apple_sleep_smc_late_notice() on J473, narrowing the J473 Cycle-1 reset strictly to the commit path after refuse_late (apple_sleep_enclave_stop() → t8112_sleep_commit_regs() → WFI/wake, where dptx_ext_phy 0x3d8 is still on and not in t8112_commit_off[]).

@satchlj
satchlj marked this pull request as ready for review December 2, 2026 16:12
@satchlj

satchlj commented Dec 2, 2026

Copy link
Copy Markdown
Member Author

Thank you for running the pm_test=devices/platform/core and apple_sleep.refuse_late=1 bisection on J473! That cleanly separates the two issues:

  • This PR (#3822) is now proven on both J473 (pm_test=devices, platform, core, and apple_sleep.refuse_late=1 all PASS with both DCPs stopping cleanly, recovering after power cycle, and HDMI reconnecting with 0 resets) and J413 (2/2 s2idle + 3/3 committed deep sleep 0 -> 3 PASS).
  • Marked #3822 ready for review; host-tests is re-running on 93455540e786 against current main (which now includes #3939's stub fix for #3815). Note 93455540e786 is test-only (tools/asahi/dcp-s2r-ext-idle-tests.py only; identical kernel binary to 875c1cec941a).
  • Investigating the separate J473 post-refuse_late commit reset (sleep-t8112.h, including dptx_ext_phy 0x3d8, atc0_* USB4/CIO domains, and J473 PCIe port01/port02) as a follow-up for #3786.

@satchlj
satchlj requested review from a team and DjDeveloperr as code owners December 2, 2026 16:12
@github-actions github-actions Bot added area:display Area from CODEOWNERS (bot) area:gpu Area from CODEOWNERS (bot) labels Dec 2, 2026
@github-actions github-actions Bot removed the ci-failing A check failed at the PR head (bot) label Dec 2, 2026
@satchlj
satchlj marked this pull request as draft December 2, 2026 17:16
@satchlj
satchlj marked this pull request as ready for review December 2, 2026 17:16

@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: MERGE at 1a92c3c

Checked: Ran the three existing host suites at this head. They passed retained-external routing, split-port withdrawal and error handling, the secure-port guard and PM registration order, and the live-firmware recovery path after idle refusal. The internal panel keeps its original path. The reported J473 reset also occurred on the control without this PR and was isolated to the later platform-sleep stage.

RyanTheTide
RyanTheTide previously approved these changes Dec 2, 2026

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

The production diff matches the previously reviewed head. The harness change permits intentionally unused helpers only in mutation mode and keeps each nonzero outcome failing. The J413 committed-sleep and J473 control receipts still cover this change. The J473 late platform reset reproduced without the PR.

@github-actions github-actions Bot removed the needs-review No approving review from Core or Omarchy Mac yet (bot) label Dec 2, 2026
@DjDeveloperr

Copy link
Copy Markdown
Contributor

Both reviews at 1a92c3c00d40 are in, and I have no code question left. One thing before the merge: the J413 and J473 rows are both T8112, and the endpoint quiesce, the idle retry and the refused-idle undo run on every s2r_ext pipe, so on T8132 and T8140 external DCPs too. We run those two no-regression rows ourselves at this head (J773g deep sleep or pm_test with DP-3 attached, J700 deep sleep), and I merge when they pass. Nothing is needed from you.

@github-actions github-actions Bot added ready-to-merge Meets the merge policy: merge it (bot) and removed needs-hw-row No hardware row at the PR head (bot) labels Dec 2, 2026
Signed-off-by: DjDeveloperr <hey@djdev.me>
…ct()

Commit 2a8d808 ("drm/apple: dcp: rearm Type-C IOMFB HPD completion on
deep-sleep DPTX release") rearms typec_iomfb_hpd_ready in
dcp_external_stop_locked(), before the HPD low that releases a Type-C link
for deep sleep. dcp_s2r_ext_disconnect() takes the same non-retained pipes
past dcp_external_stop_locked() and sets typec_crtc_off without that
rearm. The merge of the two is textually clean and drops the fix:
dcp_poweron() then finds the completion from before the sleep, does not
wait for the hotplug after the wake, and sets the mode before the firmware
has described the display again.

Rearm the completion where typec_crtc_off is set, before either port's HPD
goes low. Check it in dcp-s2r-ext-disconnect-tests.py, with a mutation
that drops it: the KUnit case of that commit calls
dcp_external_stop_locked(), so it passes either way.

Fixes: 5e7dcf8 ("drm/apple: dcp: fix non-retained firmware-27 s2r_ext link withdrawal")
Signed-off-by: DjDeveloperr <hey@djdev.me>
dcp_s2r_ext_suspend() on main calls dcp_ext_idle_suspend() first, so the
extracted function no longer compiles in the harness. Stub it.

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

Copy link
Copy Markdown
Contributor

Please hold the merge at 1a92c3c00d40. Since #4013 landed, merging this head drops the Type-C HPD rearm that #4013 added (git reports no conflict). We are pushing a fix with a test to this branch; the J773g and J700 rows follow at the new head.

@github-actions github-actions Bot added needs-hw-row No hardware row at the PR head (bot) needs-review No approving review from Core or Omarchy Mac yet (bot) and removed ready-to-merge Meets the merge policy: merge it (bot) labels Dec 3, 2026
@DjDeveloperr

Copy link
Copy Markdown
Contributor

Pushed three commits on top of 1a92c3c00d40: a merge of main cebaa8a69fea, the fix, and a test stub. New head b3b1fc5c06af. Your commits are unchanged. This replaces our merge hold above.

What was wrong. #4013 landed after your last push. It clears typec_iomfb_hpd_ready before the link goes down for deep sleep, so that dcp_poweron() waits for the new hotplug after the wake. It does that in dcp_external_stop_locked(). dcp_s2r_ext_disconnect() takes the non-retained pipes past that function, so the merge was clean but dropped #4013's fix. Also, dcp-s2r-ext-idle-tests.py did not compile against main, because dcp_s2r_ext_suspend() now starts with dcp_ext_idle_suspend().

What changed.

  • dcp.c: one reinit_completion() where you set typec_crtc_off, before either port's HPD goes low. I did not reuse dcp_external_withdraw_dptx_locked(): it handles port 0 only and skips the release when HPD low fails, so it would not have removed code.
  • dcp-s2r-ext-disconnect-tests.py: checks the completion at HPD low, plus a no-hpd-rearm mutation.
  • dcp-s2r-ext-idle-tests.py: a stub for dcp_ext_idle_suspend().

#4013's KUnit case still passes either way. It calls dcp_external_stop_locked(), and after this PR only retained pipes get there. The host test is the guard for your path.

Ran locally (hosted runs fail at startup right now), on the pushed tree:

  • New disconnect test: fails on the plain merge (!hpd_saw_ready[0]), passes with the fix. The idle test does not compile on the plain merge and passes now.
  • run-host-tests.py --only dcp in the CI host-tests image: 125/125. That includes apple-dcp, your three tests and all 19 of their mutations. One run needs an old commit from git history; it failed in my plain export and passed once I fetched that commit.
  • W=1 on drivers/gpu/drm/apple/: 0 warnings with KUnit off and on. The KUnit cases were built, not run.
  • checkpatch --strict: 0 errors, 0 checks, and 2 "unknown commit id" warnings because the export has no history.
  • drm/apple: let go of the CRTC when a Type-C cable is unplugged (Andy Wei's fix, ported) #2097 at 2236e99fa56c merges cleanly. drm/apple: wire firmware-27 T6050 external DCPs into runtime idle off #3398 at c2f5f486bcd4 conflicts with this PR in one place in dcp.c, with or without this fix: both add functions just above dcp_s2r_ext_suspend(). Keep both. Whichever lands second also needs a dcp_ext_idle_failed_dark() stub in the idle test.

Rows owed at b3b1fc5c06af, by us:

  • J773g: display on a USB-C port, because the changed line runs only with one attached. Deep sleep or pm_test. The display must come back with no "Type-C IOMFB hotplug not ready on wake".
  • J700: deep sleep. Its external pipe is a retained one, so this is a no-regression check.

T8112. The J413 and J473 rows ran at 875c1cec941a with no USB-C display attached, so the changed line did not run in them. The J413 does not need a rerun. One short J473 run with a USB-C monitor is worth having (pm_test=core, one cycle, the monitor comes back), since no T8112 row since 5e7dcf85729e has had one.

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

Exact-head review at b3b1fc5c06af (including dual-order compatibility check with #4037 at 73eddd32ebd7):

Merge, build, and host tests

  • Trial-merged on main (5f32aa72fa7e) in both land orders (#3822 then #4037, and #4037 then #3822): both merge cleanly with zero conflicts and zero diff between the two merge results across drivers/gpu/drm/apple/.
  • make ARCH=arm64 LLVM=1 W=1 drivers/gpu/drm/apple/dcp.o: 0 warnings on the merged tree.
  • scripts/checkpatch.pl --strict on #3822's drivers/ diff: 0 errors, 0 warnings, 0 checks.
  • Host tests on both merge orders: run-host-tests.py --only dcp-s2r 22/22 PASS (dcp-s2r-ext-disconnect-tests, dcp-s2r-primary-ext-tests, dcp-s2r-ext-idle-tests, plus mutations) and --only dcpext 24/24 PASS.

Semantic check with #4037's firmware-27 gate

  • T8122 27.2 (J613/J615): Internal apple,t8122-dcp (v27_early_stop = true, s2r = s2r_ext = false) keeps dcp_s2r_t8122 on V_27_0 and stays on dcp_v27_early_suspend()/resume(), unaffected by dcp_s2r_primary_external(). External apple,t8122-dcpext enables hw.s2r_ext = true under V_27_0 with dcp_s2r_t8122_ext and apple,display-power, so dcp_s2r_ext_capable() is true at both dcp_s2r_pm_register() and suspend/resume; dcp_is_retained_external() is false, so deep sleep runs #3822's non-retained 15 s DCP_V27_EXT_WITHDRAW_MS withdrawal, unconditional dcp_dptx_disconnect(), endpoint quiesce, and idle retry/leave-running fallback.
  • T8122 14.7 / 26.6: Internal apple,t8122-dcp clears hw.s2r_layout = NULL when fw_compat != V_27_0 (preserving dcp_v26_find_darts()'s own s2r_dt_layout discovery). External apple,t8122-dcpext keeps s2r = false and s2r_ext = false on both 14.7 and 26.6 (H17P/ext26), so dcp_s2r_ext_capable() stays false and neither path touches dcp_s2r_layout().
  • T8112 27 (J473 HDMI): Primary &dcp (HDMI-A, phys = <&dptxphy>, hw.s2r = true, hw.s2r_no_secure_port = true, dcp_s2r_t8112, apple,display-power) matches dcp_s2r_primary_external() once dcp_s2r_pm_register() runs after fixed-PHY/connector/Type-C route setup, suppressing internal set_power_state(0)/D572, dcp_s2r_display_on(), and internal DPMS cycling, and routing suspend/resume through dcp_s2r_ext_capable() (dcp_s2r_ext_by_layout() == true, dcp_s2r_domains_off/on() with dcp_s2r_t8112, fixed-HDMI reinit/reconnect, and HDMI HPD IRQ re-enable). Secondary &dcpext (apple,t8112-dcpext) enters #3822's non-retained disconnect/quiesce/idle-retry path cleanly.
  • T8132: M4 firmware (DCP_FIRMWARE_M4) keeps s2r = s2r_ext = false and is untouched. On firmware 27, J713 internal dcp (apple_dcp_hw_t8132_v27) has no external output/connector and stays on internal dcp_s2r_capable(); J713 dcpext0/dcpext1 (apple_dcp_hw_t8132_dcpext_v27 + apple,display-power) enter #3822's non-retained disconnect/quiesce/idle-retry path; J773g lacks apple,display-power on dcpext0/dcpext1 so dcp_s2r_ext_capable() remains false.
  • T6030: Internal apple,t6030-dcp (v27_early_stop = true, s2r = s2r_ext = false) keeps dcp_s2r_t6030 on 27.2 and clears it to NULL on 14.7/26.6; apple,t6030-dcpext has s2r = s2r_ext = false. Both are unaffected.

One minor pre-existing observation (not introduced by #3822 or #4037): for DT-layout-only V_27_0 external DCPs (such as J713 dcpext0/dcpext1), dcp_s2r_check_dt() sets s2r_dt_layout_ok during bind after dcp_s2r_pm_register() runs in probe, so s2r_pm_nb is not registered for those nodes; all static-layout targets (T8112, T8122, T8103, T8140) have hw.s2r_layout populated at probe and register normally.

No fix-up is needed in either #3822 or #4037; both land orders are clean and semantically consistent.

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

Reviewed b3b1fc5. The non-retained Type-C path now rearms the HPD completion before withdrawing either port, retaining the fix already on main. The retained path still uses its existing helper. The reported exact host run passes 125/125 and the new case fails on the plain merge. Attached-display hardware coverage at this head is pending.

@github-actions github-actions Bot removed the needs-review No approving review from Core or Omarchy Mac yet (bot) label Dec 3, 2026
@github-actions github-actions Bot removed the ci-failing A check failed at the PR head (bot) label Dec 3, 2026

This branch has not been deployed

No deployments
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) kunit-full needs-hw-row No hardware row at the PR head (bot)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

T8112 J473: deep sleep refused, dcpext suspend -110 (DPTXRemotePort cmd 0xc0 timeout) with a USB-C display

3 participants