Repository navigation
drm/apple: stop the M4 MacBook Air's internal DCP firmware on macOS 27.2 (DPMS off, deep sleep; replaces #2660) - #2819
Open
RyanTheTide wants to merge 7 commits into
Open
RyanTheTide wants to merge 7 commits into
RyanTheTide wants to merge 7 commits into
Conversation
A DCP whose device tree names its display power words but not its DART streams stops the streams its DARTs have enabled before its first power-down and enables them again at power-up. Let it read them: the first 32 streams of a T8110 DART, read while its domain is up. Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
…ry hw.s2r SoC The system-sleep stop ran with an active panel only where the power words are measured, or on the J813, so another SoC's internal DCP stayed running into a deep sleep unless DPMS had turned its panel off first, and the sleep was refused. A derived layout only survives probe with appledrm.s2r_untested set, which already decides it: drop the board check. Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
… power words from the device tree The M4 MacBook Air's internal DCP runs the firmware-27 backend on macOS 27.2 but has no firmware stop, so a deep sleep is refused with the processor still running, and DPMS off only darkens the backlight. Give it the hw.s2r stop the T8142 runs on 27.2: set_power_state(0), D572, the AP link's release (A550 in the 27.2 table), RTKit idle and the CPU stop, then the DCP DART's streams. It has no secure mailbox. Its power words are not a per-SoC table: a hw.s2r DCP without a layout in its hw data takes them from its device tree, the ones its deep sleep lowers. DISP_CPU is the first state of its power-domains, DISP_FE that state's parent and DISP_SYS theirs; the retention words are DISP_CPU's apple,retention-workaround, of which only the masked bits are written, the off value at power-off and the value read at probe at power-on; pmc-dcp counts it where the display-power node has that word; and the DART streams are the ones its DARTs have enabled before the first stop. Without those properties the firmware keeps running, as before. Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
The T8132's words are T8140's: pmc-dcp, the power manager's power states and its power gate block. Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
Name the power manager blocks the internal DCP's firmware-27 stop writes, the ones the deep sleep lowers (pmc-dcp, the power states and the power gate block), and the DCP DART's clock-protection slice (42 in the ADT's dart-dcp) as its gapf word: the stop clears it after the DART's power-down flush so that DISP_CPU's power state can be written. Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
… probe, and only all of them Review points on the device-tree power layout: - Its DART streams were read at the first stop, with dcp_streams == 0 standing for "not read yet". A first read of 0 would have had later stops and power-ons read the DART again, maybe with DISP_CPU still lowered, and the restart would enable no streams. Now the streams are read once at probe, with the firmware running. A DCP DART that reads none refuses the layout, and the firmware keeps running as with no power words. - apple_dart_enabled_streams() read only the first enable word. If a stream above 31 is enabled, the 32-bit mask can't describe the DART, so it now reads every word up to num_streams, warns once, and reports 0 in that case. - Comments still described the stop as behind appledrm.s2r_untested or J813-only. The device tree's words stop the firmware by default; only a SoC whose static words are merely derived (T8142) needs the parameter. The same holds for the layout added in "drm/apple: dcp: stop a DCP for a deep sleep with its panel lit on every hw.s2r SoC", whose message says otherwise. Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
…and check power word alignment A DCP with a piodma child restores the display DART's streams at power-on from the layout. If that DART is not found, or reads no streams (none enabled, or streams above 31 that the 32-bit mask cannot describe), the layout kept disp_streams = 0 and power-on would have enabled none. Refuse the layout then, like a DCP DART that reads none: the firmware keeps running. The DISP_CPU/FE/SYS offsets are checked against the "ps" block without underflowing on a block shorter than a word, and must be word aligned like the retention offsets. The overview comment named the old first-stop stream read; point it at dcp_s2r_layout_streams(). Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
DjDeveloperr
left a comment
Contributor
There was a problem hiding this comment.
Adversarial pre-PR checklist review (§1–§6) at verified live head 888805b87936b04d41f3fcea35beade5f84f6f26: 0 code blockers in these 7 commits, but not ready for APPROVE / MERGETRAIN-LINUX4 yet due to base stack state, 0 CI runs, and pending rebased-head hardware rows.
Verification Against #2660
- Confirmed patch-identical replay of
#2660(dde724cb..48789bf2vsa912b89b..888805b8: 0 code/text diffs, hunk line offsets only). Both priorCHANGES_REQUESTEDfixes from#2660(dcp_s2r_layout_streams()fail-closedpiodmaDART handling anddcp_s2r_layout_from_dt()non-underflowing bounds + 4-byte alignment checks) are preserved.
Checklist Audit (§1–§6)
- §1 (No model gating): Pass. Power words (
DISP_CPU/DISP_FE/DISP_SYSviapower-domainschain, retention registers/masks/off-values viaps_disp_cpu'sapple,retention-workaround, optionalpmc-dcp) and enabled DART streams (apple_dart_enabled_streams()) are derived from DT and hardware state rather than a per-SoC table. Drops theof_machine_is_compatible("apple,j813")board check indcp_platform_suspend(). J715 stays fail-safe without the new DT nodes until qualified. - §2 (Production-ready, no hacks): Pass. Default kernel command line; no new cmdline or module parameters.
- §3 (Safety / DCP stop, handoff, suspend & non-M4-Air impact): Pass.
- DT register math checks out against
t8132.dtsi,t8132-pmgr.dtsi, andt8132-j713-pmgr.dtsi(dcp_powerps/pwrgate/pmc-dcpcover0x240,0x248,0x10000, retention0x2504c/0x25070, anddcp_dartgapf0x38079cb80=ps_prot+0x100+42 * 0x40, matchingapple,dart.yaml). dcp_s2r_layout_from_dt()puts alldevice_noderefs on every path, validatesat > gate_res.start(guaranteeingret_ff != 0), bounds, alignment, and mask containment, and fails closed cleanly.dcp_s2r_layout_streams()runs insidedcp_comp_bind()afterdcp_create_piodma_iommu_dev(), so bothdcp_dartanddisp0_dartare bound and powered when read; any missing DART,0stream mask, or enabled stream >= 32 fails closed (-ENODEV/-ENODATA) and leaves the firmware running.dcp_s2r_ret_write()preserves exact whole-word writes (3/0off,0/1on) whenmask == 0(T8140/T8142 static layouts) and masked RMW for DT-derived layouts, so non-M4-Air SoCs are unaffected.- (Minor non-blocking note)
apple_dart_enabled_streams()readsdart->regswithoutpm_runtime_resume_and_get(dev)(safe here becauseps_disp_cpuis firmware-owned and active at bind, matchingapple_dart_display_streams(), but worth noting if ever reused on a runtime-suspended DART).
- DT register math checks out against
- §4 (Clean-room & attribution): Pass. All 7 commits carry human author/committer (
Ryan Murray) and humanSigned-off-by:with zero AI trailers; PR body includesAssisted-by:. - §5 (Hardware evidence): Prior
#2660(48789bf2) rows are strong: J713 A/B 10/10 DPMS off/on + 10/10 lit-panel RTC deep sleeps (0 DART faults, 0 oops, 0 failed units, 0 AVC), plus Neo (T8140) DPMS smoke 10/10 + 1/1 RTC deep sleep (0 errors, 0 failed units, 0 AVC — note the PR body's "Still to run" still lists the Neo smoke even though it already passed on#2660). Still pending on this rebased PR: the queued J713 one-shot row on888805b8over currentintegration/aurora, and J713 lid wake. - §6 (Naming): Pass.
Remaining Before APPROVE / Merge
- Base stack & CI: Currently stacked on unmerged Draft
#2818(j713-disp3/dcp272-internal, which is itself stacked on Draft#2541) with 0 CI checks executed on888805b8. Needs#2541->#2818landed, retargeted ontointegration/aurora, and green CI (dt-checks,host-tests). - Remaining §5 rows: Post the queued J713 one-shot row for this rebased head on
integration/aurora(with full regression counts) and the J713 lid-wake row.
Assisted-by: LLM (Gemini 4 Neon)
Contributor
Author
|
Review at 888805b.
|
Contributor
Author
|
J713 row (M4 MacBook Air, macOS 27.2 stub), one-shot boot of integration/aurora f1d5b24 merged with this stack (#2819 head 888805b on #2818 a912b89). Default kernel command line, unchanged Stage 2:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
#2660 (stop the M4 MacBook Air's internal DCP firmware on macOS 27.2, for DPMS off and deep sleep) is stacked on #2590, which can no longer be merged (its base #2541 was rebased onto integration). #2590 is replaced by #2818.
Change
The same 7 commits as #2660 at 48789bf, replayed without conflicts onto 2818 (
git range-diffshows all 7=). This replaces #2660. Nothing changes in what they do:apple,retention-workaround, pmc-dcp, the DART streams its DARTs have enabled), not a per-SoC table. Without those properties the firmware keeps running, as before.apple_dart_enabled_streams().hw.s2ralone (no J813 check).apple,t8132-display-power; J713 DT: the display-power node,apple,display-poweron the DCP, and the DCP DART's clock-protection slice.No kernel or module parameter is involved.
Testing
Earlier rows on #2660's commits (unchanged here) are on #2660: DPMS off/on 10/10 with the power words read back, and 10/10 lit-panel deep sleeps with RTC wake on the fleet80c cut, A/B against the same cut without 48789bf.
Still to run
Reviewer / agent detail
git range-diff dde724cb..48789bf2 a912b89b..888805b8: 7 of 7=).traces/display/20261123-j713-disp3/in the lab store.Assisted-by: LLM (Claude:Opus 5.5)