Repository navigation
drm/apple: dcp: refuse a deep sleep for a firmware-27 external display processor without a stop - #2710
Conversation
…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 <[email protected]>
…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 <[email protected]>
|
Host-test result at bdb97ea: |
There was a problem hiding this comment.
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
- Breaks
apple-dcpresource-profilehost test (tools/testing/selftests/drivers/gpu/apple-dcp/lifecycle.py:1226-1233):
Adding.external_processor = truetoapple_dcp_hw_t8140_external(drivers/gpu/drm/apple/dcp.c:9875) breaks compilation of theresource-profilehost test, which extractsapple_dcp_hw_t8140_externalverbatim fromdcp.c(lifecycle.py:1178-1181) against its own stubstruct apple_dcp_hw_data(lifecycle.py:1226-1233) that does not declarebool external_processor;. Addexternal_processorto the stub and confirmtools/asahi/run-host-tests.py --only apple-dcppasses cleanly.
Cleanup & merge gates
- Squash commits: Commit 1 (
804dadd2) temporarily introduces the compatible-list check and!hw.s2r_extcondition 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-272rather thanintegration/aurora. Retarget tointegration/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).
…flag The resource-profile host test compiles dcp.c's hardware tables against a cut-down struct apple_dcp_hw_data. The dcpext tables now set external_processor, so the stub needs the field or the test fails to build. No change to the driver. Signed-off-by: Ryan Murray <[email protected]>
|
b0865dc adds the Still open: squashing the first two commits (the first calls |
There was a problem hiding this comment.
Re-review at b0865dc2e72b against the pre-PR checklist (§1–§6) and live integration/aurora (70a00e583b03): selftest blocker resolved, but 3 merge blockers remain (base branch & missing CI, unsquashed intermediate commits, missing exact-head §5 evidence).
Resolved
tools/testing/selftests/drivers/gpu/apple-dcp/lifecycle.py:1232now declaresexternal_processorin the stubstruct apple_dcp_hw_data, fixing theresource-profilehost-test build failure.- Final tree diff is functionally clean: all 10
*-dcpext/*_externalapple_dcp_hw_dataentries set.external_processor = true, no internal DCP sets it, anddcp_platform_suspend()refuses deep sleep with-EBUSYfor any firmware-27 external processor that fell through past every working stop (s2idleunaffected). Not superseded onintegration/aurora. - §4 attribution: Clean — all 3 commits carry human author/committer (
Ryan Murray) + humanSigned-off-by:only, zero AI trailers in commits, disclosure in PR body.
Remaining Blockers
- §6 / Target branch & live CI (0 check runs): The PR still targets feature branch
j713-dcpext/air-dcpext-272(#2673, still OPEN) instead ofintegration/aurora, so no CI check runs have executed onb0865dc2e72b. Rebase/retarget ontointegration/aurora(dropping the#2673-onlyapple_dcp_hw_t8132_dcpext_v27hunk if landing ahead of#2673for T8122#2704, or once#2673lands) so full CI runs and passes. - §1 / Commit hygiene (unsquashed broken/gated intermediate commits): Commit 1 (
804dadd2) still carries the rejected compatible/SoC-gated intermediate check (dcp->external || apple_t8132_dcpext_v27_2(dev->of_node)) and!dcp->hw.s2r_exttest that commit 2 (bdb97ea6) immediately replaces, and commit 2 breaks theapple-dcpselftest until commit 3 (b0865dc2). Squash into a single clean, bisectable commit. - §5 (Exact-head hardware & regression evidence): No hardware run has been posted at
bdb97ea6orb0865dc2. Please post the open tip-based rows listed in the PR (J713 deep refusal x3 + s2idle x3 with monitor, J615 + merged#2704deep refusal + s2idle, and regression on a Mac without a firmware-27 dcpext / M5 showing0 SELinux denials, 0 failed units, 0 new kernel errors).
|
Merge readiness at
Areas: Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels. |
DjDeveloperr
left a comment
There was a problem hiding this comment.
Verdict: FINISH, then merge at b0865dc2e72b: the code is ready; it needs only a row at this head.
Blockers: none in the code. Missing row: one J713 run at the head with an external display on the firmware-27 dcpext: a deep sleep is refused with the log line, and without a display it sleeps as before. It's stacked on #2673, so it merges after #2673; once retargeted to main, CI runs.
Checked: no Apple material. In the final tree the refusal is keyed on the external DCP's firmware-27 state, not on a compatible, and lifecycle.py covers it. This replaces my earlier review. Commit 1's intermediate check, which commit 2 replaces, only affects bisecting. Squashing them would be tidier, but it isn't a blocker.
Evidence
Read 804dadd2, bdb97ea6 and the final diff.
Superseded by the review at b0865dc
…promote/dcpext-deep-refusal #2673 now sits on #2819 + the #2818 review fix. The only conflict was the T8132 hw data in dcp.c: the internal table keeps #2819's sleep stop, and the firmware-27 T8132 dcpext table gets this branch's external_processor flag. Signed-off-by: Ryan Murray <[email protected]>
) into j713-s2r/dcpext-s2r-ext-pr The base moves from the #2660 stack to #2819 (which replaced #2660) and the reworked #2673. For the internal DCP #2819's version wins: its stop and start, its power words and the DART stream reads at probe. From this branch the external DCP stop stays as it was: s2r_ext, the layout power sequence, the dark display DART, the CPU retain, the J713 dcpext GAPF slices and apple,display-power on dcpext0/1. Signed-off-by: Ryan Murray <[email protected]>
|
Fast-forward to 1f51a95: merges the rebuilt #2673 (now on #2819). The only conflict was the T8132 hw data in dcp.c. |
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_extstop is not enabled).Change. Every dcpext block's match data is marked
external_processor.dcp_platform_suspend()refuses a deep (firmware) sleep with-EBUSYfor any firmware-27 external processor once none of the stops before it returned: the T6050 firmware-27 sleep, the internals2rstop and the externals2r_extstop 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:
dcp->externalhung a third time, because the J713 DCPEXT never sets it.Still to run.
Details for reviewers
.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.external_processoris set in the hw data of every*-dcpextentry (t6020, t6030, t6041, t6050, t8122, t8132 incl. its 27.2 variant, t8140, t8142, and the genericapple,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.!hw.s2r_ext, which would have let a DCPEXT withs2r_extset but its stop not enabled hang again; the second commit tests whether a stop actually ran.