Skip to content

drm/apple: dcp: refuse a deep sleep for a firmware-27 external display processor without a stop - #2710

Open
RyanTheTide wants to merge 2 commits into
j713-dcpext/air-dcpext-272from
airs-promote/dcpext-deep-refusal
Open

RyanTheTide wants to merge 2 commits into
j713-dcpext/air-dcpext-272from
airs-promote/dcpext-deep-refusal

Conversation

@RyanTheTide

@RyanTheTide RyanTheTide commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

Problem. On the M4 MacBook Air (J713) running the macOS 27.2 firmware, a deep sleep with the 27.2 DCPEXTs bound (an external monitor on USB-C) wakes up and then stalls in device resume. After about 30 s the hardware watchdog resets the machine. The sleep engine stops the DCPEXT firmware cold, and the DCPEXT has no firmware stop or restart of its own on 27.2, so its resume ends up waiting on firmware that isn't running anymore. The same holds for any external display processor on firmware 27 that no stop path takes (for example the T8122 DCPEXT on 27.2, or a T8142 DCPEXT whose s2r_ext stop is not enabled).

Change. Every dcpext block's match data is marked external_processor. dcp_platform_suspend() refuses a deep (firmware) sleep with -EBUSY for any firmware-27 external processor once none of the stops before it returned: the T6050 firmware-27 sleep, the internal s2r stop and the external s2r_ext stop keep their deep sleep because they return first, not because they are on a list. Suspend-to-idle is unchanged. When a DCPEXT gets a working firmware stop (for the J713, the 27.2 DCPEXT stop in #2721, which passed deep 3/3 with a monitor), it takes that path and this refusal no longer fires for it.

Testing. J713, kernel 7.3.0-bj713b10+ (the J713 deep-sleep and s2idle series on top), stock command line, MSI monitor on DP-2:

  • Without any refusal, the first deep sleep hung twice, once on each Stage 2 aura head (watchdog reset each time). A refusal testing only dcp->external hung a third time, because the J713 DCPEXT never sets it.
  • The second commit (selection by the block's match data instead of two compatibles) compiles clean with W=1 on this base, and checkpatch is clean.

Still to run.

Details for reviewers
  • Where the stall happens: PMU scratch after the watchdog reset shows sleep-engine step 0x7e (.wake: back in Linux, before any device resumes), and per-display marker 0xc0 shows display 0 lowered fine. So the machine really did sleep and wake; the stall is in device resume.
  • Selection: external_processor is set in the hw data of every *-dcpext entry (t6020, t6030, t6041, t6050, t8122, t8132 incl. its 27.2 variant, t8140, t8142, and the generic apple,dcpext). The firmware-27 condition is the firmware ABI that has no stop of its own. No board, SoC or firmware-version gate is added.
  • Head 804dadd tested !hw.s2r_ext, which would have let a DCPEXT with s2r_ext set but its stop not enabled hang again; the second commit tests whether a stop actually ran.
  • The J713 dcpext is only bound when the boot loader hands it over on 27.2; without that handover there is no driver to refuse and deep sleep is unchanged.

Assisted-by: LLM (Claude:Opus 5.5)

…thout a stop

A deep sleep of an M4 MacBook Air with its 27.2 DCPEXTs bound woke and
then stalled in device resume until the watchdog reset the machine: the
sleep had stopped the DCPEXT firmware cold, and the DCPEXT, which has no
firmware stop or restart of its own on 27.2, resumed by talking to it.

Until it has one, refuse the deep sleep for such a DCP, as the other
paths here refuse what they cannot bring back. That is a firmware-27
external DCP without hw.s2r_ext: the T6030 dcpext (dcp->external) and
the T8132 DCPEXT that apple_t8132_dcpext_v27_2() admits, which runs the
firmware-27 external processor path but is not marked dcp->external.
DCPEXTs with their own sleep path (T6050's firmware-27 sleep, T8142's
s2r_ext) return before this. Suspend-to-idle keeps the firmware running
and is not affected.

Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
…processor without a stop

The refusal for a firmware-27 external display processor that has no
firmware stop picked its processors by two compatibles: the T6030 dcpext
(dcp->external) and the T8132 DCPEXT on 27.2. Every other external
processor on firmware 27 that no stop path takes, such as the T8122
DCPEXT on 27.2, a T6041 one with no stop of its own, or a T8142 DCPEXT
whose untested s2r_ext stop is not enabled, still let a deep sleep stop
its firmware cold and then hung in its resume.

Mark every dcpext block's match data as an external processor and
refuse the deep sleep for any of them on firmware 27 once none of the
stops above returned: the T6050 firmware-27 sleep, the internal s2r
stop and the external s2r_ext stop keep their machines' deep sleep
because they return first, not because they are left off a list.
Suspend-to-idle keeps the firmware running and is not affected.

Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
@RyanTheTide RyanTheTide changed the title drm/apple: dcp: refuse a deep sleep for a firmware-27 external DCP without a stop drm/apple: dcp: refuse a deep sleep for a firmware-27 external display processor without a stop Nov 21, 2026
@RyanTheTide

Copy link
Copy Markdown
Contributor Author

Host-test result at bdb97ea: tools/asahi/run-host-tests.py --only apple-dcp fails on this head (88/89): resource-profile no longer compiles, host.c:933: field designator 'external_processor' does not refer to any field in type 'const struct apple_dcp_hw_data'. The unit's copy of struct apple_dcp_hw_data (or its extraction) needs the new field from this commit.

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

Adversarial review at bdb97ea67283f71a1f850d1653e7800cb5e9197f.

Block-selection check: Clean. All 10 *-dcpext apple_dcp_hw_data definitions set .external_processor = true, no internal DCP sets it, and dcp_platform_suspend() (drivers/gpu/drm/apple/dcp.c:9655-9659) refuses deep sleep (pm_suspend_via_firmware()) for any dcp->hw.external_processor && dcp->fw_compat == DCP_FIRMWARE_V_27_0 that fell through past every working stop (dcp_v27_sleep_selected, dcp_s2r_capable, dcp_s2r_ext_capable). No chip, board, or firmware-version gates are added, and s2idle is unaffected. Commits/DCO and clean-room rules are clean.

Blocker

  1. Breaks apple-dcp resource-profile host test (tools/testing/selftests/drivers/gpu/apple-dcp/lifecycle.py:1226-1233):
    Adding .external_processor = true to apple_dcp_hw_t8140_external (drivers/gpu/drm/apple/dcp.c:9875) breaks compilation of the resource-profile host test, which extracts apple_dcp_hw_t8140_external verbatim from dcp.c (lifecycle.py:1178-1181) against its own stub struct apple_dcp_hw_data (lifecycle.py:1226-1233) that does not declare bool external_processor;. Add external_processor to the stub and confirm tools/asahi/run-host-tests.py --only apple-dcp passes cleanly.

Cleanup & merge gates

  • Squash commits: Commit 1 (804dadd2) temporarily introduces the compatible-list check and !hw.s2r_ext condition that commit 2 (bdb97ea6) immediately replaces. Please squash into one clean commit so the history doesn't carry the rejected compatible-gated intermediate state.
  • CI & hardware evidence: No CI has run because the base branch is j713-dcpext/air-dcpext-272 rather than integration/aurora. Retarget to integration/aurora (once base lands) for full CI, and post the open tip-based rows (J713 deep refusal x3 + s2idle x3, J615 + #2704, M2/M5 regression with 0 AVC, 0 failed units, 0 new kernel errors).

Assisted-by: LLM (Google:Gemini 4 Neon)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants