Skip to content

drm/apple, soc: apple: support T8122 firmware 27.2 DCP/DCPext and committed deep sleep - #4037

Merged
DjDeveloperr merged 10 commits into
mainfrom
feat/dcp-t8122-v27-s2r
Dec 3, 2026
Merged

DjDeveloperr merged 10 commits into
mainfrom
feat/dcp-t8122-v27-s2r

Conversation

@satchlj

@satchlj satchlj commented Dec 3, 2026 •

Copy link
Copy Markdown
Member

What: Wire T8122 (M3) internal and external DCP firmware 27.2 suspend-to-RAM (reusing v27_early_stop and s2r_ext, gated to firmware 27 so 14.7/26.6 keep their existing display paths; on firmware 27 s2r_ext also enables external DCP runtime idle power-off 5 s after boot/unplug and restart on plug-in), fix T8122 pmp-report apple,soc-device-record lookups and no-ack wake polling, keep ready second-pass commit coprocessor domains (apple-sio / sio_cpu) powered across apple_sleep_lower_stray(), and drop .coproc_slp_ddr on T8122 so adopted firmware 27.2 MTP takes full DRAM-off deep sleep instead of cold-booting on wake.
Tested: J613 M3 MacBook Air 13" (T8122, 10-core G15G C0, firmware 27.2 / 26B123) at 9ccc8a20bfed: 2 consecutive committed deep-sleep cycles (rtcwake -d rtc1 -m mem -s 15, apple_sleep.deep=1, untested_commit=1) PASS — suspend_stats success=2 fail=0, boot object resumes 0 -> 1 -> 2, wake source NUB.SPMI0.SW3, internal DCP result 0 / plain-on 0@24 (C1) & 0@23 (C2) with backlight restored, external DCP (31ac00000.dcp) warm-restarted, apple-sio, apple_pmp + pmp_report, apple_sep (xART diff = 0), aurora-g16 (850 us C1 / 2101 us C2, Borealis 1.4.363 active), Wi-Fi, Bluetooth, audio, and adopted MTP all clean, 0 failed units, 0 Oops/WARN/BUG/SError/fault. J615 M3 MacBook Air 15" (T8122, firmware 27.2 / 26B123) at 9ccc8a20bfed (thanks @RyanTheTide): 2/2 committed deep sleep PASS (internal panel). Head 73eddd32ebd7 adds DjDeveloperr's test fixture fix (90897fed439e) and firmware-27 gating fold (2d2d619a28c6, 73eddd32ebd7; W=1 0 new warnings, PMP host tests 24/24 PASS; firmware 27.2 values unchanged). Host tests (32/32 PMP mutations, 4/4 M3 sleep steps, early-HPD, DCPext repower) and arm64 QEMU KUnit (apple-sleep-soc-data 19/19) PASS.
Risk: two-way door · M3 (T8122) Macs; shared pmp-report record lookup and sleep.c second-pass coprocessor domain check affect shared Apple Silicon sleep/PMP paths (verified with host mutation tests and KUnit; plain revert restores prior behavior).
Not yet: External DisplayPort plug/unplug/replug row on 31ac00000.dcp (dcpext) at 73eddd32ebd7 (only unplugged dcpext warm-restart was exercised on J613). Default-cmdline deep sleep (apple,sleep-tested) remains gated until follow-up PR #3760.

Thanks to @DjDeveloperr for the thorough review, t6030-pmp-graph-tests.c fixture fix, and firmware-27 gating fold (90897fed439e..73eddd32ebd7), and to @RyanTheTide for the J615 27.2 committed deep-sleep verification row.

Details

Commit breakdown (9 commits on main 5d5060423c0e)

  1. 7a03a20d5c5f dt-bindings: display: describe T8122 DCP power registers and sleep args — Describes apple,t8122-display-power (matching T6030 pwrgate/ps register windows) and allows the firmware 27.2 display sleep arguments and panel wake properties on apple,t8122-dcp.
  2. 763aeebb0581 pmdomain/iommu: apple: support T8122 display wake ACK and DART save/restore — Accepts apple_pmp_offsets_t8122 in apple_pmp_report_check_t6030_ack() and routes apple,t8122-dart through apple_dart_t8112_display_streams() (entering display_dark before checking display_saved, matching T8020).
  3. 70ce55ff7743 drm/apple, arm64: dts: apple: support T8122 firmware 27.2 DCP/DCPext S2R — Wires dcp_s2r_t8122 (DISP_CPU 0x10000, DISP_FE 0x208, DISP_SYS 0x1d8, retention 0xcac/0xcd0) for 28ec00000.dcp and dcp_s2r_t8122_ext (DISPEXT_CPU 0x488, DISPEXT_FE 0x480, DISPEXT_SYS 0x410, dcpext_dart stream 5, dispext0_dart streams 0 and 4) for 31ac00000.dcp, plus the corresponding DT nodes in t8122-dcp.dtsi and t8122-j613-j615.dtsi.
  4. 1eb248cd05cf pmdomain: apple: resolve soc-device-record in pmp-report entry lookups — Resolves apple,soc-device-record in apple_pmp_report_entry_request() and apple_pmp_report_of_entry() instead of using raw reg indices (on T8122, DISP maps to record 11 rather than bit 7), and tracks apple,no-ack bits so apple_pmp_report_wake() excludes unacknowledged entries from the wake poll.
  5. 9812715f0854 soc: apple: sleep: keep ready second-pass coprocessor domains powered — Records the power-domains offset in apple_sleep_coproc_register() (not just first-pass devices) and exempts ready commit-stopped coprocessors from apple_sleep_lower_stray(). Without this, apple_sleep_lower_stray() powered off sio_cpu (0x210) before apple-sio's second-pass commit callback touched its ASC and mailbox.
  6. 9ccc8a20bfed soc: apple: sleep: T8122: drop coproc_slp_ddr so 27.2 MTP takes DRAM-off sleep — Removes .coproc_slp_ddr = true from t8122_sleep_soc (keeping sleep_slp_ddr_bind() for USB) and updates apple_sleep_test_slp_ddr_voters. Under firmware 27.2, rtkit-helper adopts 2fa400000.mtp with 4 retained buffers and votes WAKE_SLP_DDR bit 0, which caused T8122 to enter sleep for the full RTC interval and cold-boot immediately at wake while t8122_mcc_channel_stop() ran unconditionally. Matching T8132/T8140/T8142 lets 27.2 MTP survive full DRAM-off sleep across consecutive cycles.
  7. 90897fed439e tools: asahi: t6030-pmp-graph-tests: add no_ack to the report fixture — Adds no_ack to the struct apple_pmp_report test fixture.
  8. 2d2d619a28c6 drm/apple: dcp: keep T8122's firmware 27 stop off older firmware — Sets s2r_ext in the firmware 27 probe branch and clears s2r_layout on non-27 firmware so 14.7 and 26.6 keep their existing display paths while firmware 27.2 receives identical values.
  9. 73eddd32ebd7 soc: apple, pmdomain: apple: update two comments for T8122's sleep — Updates two stale comments in pmp-report.c and sleep-test.c.
Evidence

Hardware row (J613 M3 Air 13", T8122, 10-core G15G C0, firmware 27.2 / 26B123)

  • Tested commit: 9ccc8a20bfed (zero diagnostic flags; commits 90897fed439e..73eddd32ebd7 keep firmware 27.2 values identical)
  • Command: echo deep > /sys/power/mem_sleep && echo 1 > /sys/module/apple_sleep/parameters/untested_commit && rtcwake -d rtc1 -m mem -s 15 (2 consecutive cycles in same boot)
  • Results:
    • Same boot across both cycles; rtcwake exit code 0 both cycles; suspend_stats: success=2, fail=0
    • apple-sleep 2d0700000.sleep-controller: back from sleep, boot object resumes 0 -> 1 (C1), 1 -> 2 (C2); wake source: NUB.SPMI0.SW3 both cycles
    • apple-dcp 28ec00000.dcp:
      • C1: V27 sleep: internal DCP stop: ... power-off 0@112; result 0 / V27 wake: firmware back after the sleep: ... plain-on 0@24 / IOMFB enable_backlight_gated: enabling backlight
      • C2: V27 sleep: internal DCP stop: ... power-off 0@102; result 0 / V27 wake: firmware back after the sleep: ... plain-on 0@23 / IOMFB enable_backlight_gated: enabling backlight
      • Post-wake backlight sysfs: brightness=168, actual_brightness=168
    • apple-dcp 31ac00000.dcp (dcpext, unplugged): warm-restarted cleanly both cycles (RTKit: sleep return: ASC control 0x0, setting RUN)
    • apple-sio 2a1c00000.dma-controller: warm-restarted cleanly both cycles
    • apple_pmp 2d0500000.pmp + apple-pmp-report 2d03c0000.pmp_report: warm-restarted cleanly, memory floor raise/release active post-wake
    • aurora-g16 292400000.gpu: GPU firmware back in 850 us (C1), 2101 us (C2); vulkaninfo --summary reports Apple M3 (G15G C0), Borealis 1.4.363 active post-wake
    • apple_sep 29e400000.sep: the enclave is back from its sleep request both cycles; aurora-xart list --json diff before vs after trial = 0 lines
    • hci_bcm4377: hardware reset recovery + BD_ADDR restored, controller Powered: yes
    • brcmfmac: wlan0 UP LOWER_UP
    • rtkit-helper 2fa400000.mtp: adopted 4 retained buffers, 0 crashes across both DRAM-off cycles
    • systemctl --failed: 0 failed units; dmesg: 0 Oops/WARN/BUG/SError/Call trace/GPU faults

Hardware row (J615 M3 Air 15", T8122, firmware 27.2 / 26B123, @RyanTheTide)

  • Exact head 9ccc8a20bfed: 2/2 committed deep-sleep cycles PASS (rtcwake -d rtc1 -m mem -s 20, resumes 0 -> 1 -> 2, internal panel restored, 0 failed units).

Static, host, and KUnit checks

  • scripts/checkpatch.pl --strict --no-tree -g 5d5060423c0e..9ccc8a20bfed: 0 errors, 0 warnings, 0 checks across all 6 commits; W=1 across all commits at 73eddd32ebd7: 0 new warnings
  • python3 tools/asahi/t6030-pmp-supplier-tests.py --mutations: 32/32 KILLED, 2/2 PASS; PMP host tests: 24/24 PASS
  • tools/asahi/dcp-ext-repower-tests.py: PASS; tools/asahi/m3-sleep-steps-tests.py: 4/4 PASS; tools/testing/selftests/drivers/gpu/apple-dcp-early-hpd.py: PASS
  • Arm64 QEMU KUnit apple-sleep-soc-data: 19/19 PASSED (including apple_sleep_test_slp_ddr_voters and apple_sleep_test_coproc_lowers)

Describe apple,t8122-display-power (matching T6030's pwrgate and ps
register windows) and allow the firmware 27.2 display sleep arguments
and panel wake properties on apple,t8122-dcp.

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

Accept apple_pmp_offsets_t8122 in apple_pmp_report_check_t6030_ack() so
T8122 firmware 27.2 internal DCP wake verifies live PMP READY, target,
and ACK before releasing RUN.

Route apple,t8122-dart through apple_dart_t8112_display_streams() so
T8122 DISPEXT DARTs save TTBR/TCR before power-off and restore them on
wake if state is not retained across ps_dispext_cpu power cycles. Also
enter display_dark before checking display_saved (matching the T8020
path) so callers that mark the DART dark before stopping streams still
snapshot its translation tables.

Signed-off-by: Satya Benson <satya@benson.earth>
Wire T8122 internal and external display power domains and retention
registers into dcp.c and the T8122 device trees for firmware 27.2
suspend-to-RAM:

- Internal DCP (28ec00000.dcp): enable v27_early_stop and
  afk_name_fallback on apple_dcp_hw_t8122 with dcp_s2r_t8122 (DISP_CPU
  0x10000, DISP_FE 0x208, DISP_SYS 0x1d8, retention 0xcac/0xcd0), add
  dcp_power in t8122-dcp.dtsi, and add the 27.2.0 display sleep
  arguments in t8122-j613-j615.dtsi.
- External DCP (31ac00000.dcp): enable s2r_ext, s2r_no_secure_port, and
  s2r_disp_dart_with_dcp on apple_dcp_hw_t8122_dcpext with
  dcp_s2r_t8122_ext (DISPEXT_CPU 0x488, DISPEXT_FE 0x480, DISPEXT_SYS
  0x410, dcpext_dart stream 5, dispext0_dart streams 0 and 4).

Firmware 14.7 and 26.6 paths are unaffected because v27_early_stop and
s2r_ext gate on the firmware 27.2 method table.

Signed-off-by: Satya Benson <satya@benson.earth>
apple_pmp_report_entry_request() and apple_pmp_report_of_entry() read the
raw reg property instead of resolving apple,soc-device-record through
apple_pmp_report_record(). On T8122, where PTD request and acknowledge bits
are indexed by soc-device record rather than ID order, withdrawing or
checking a display report entry targeted the wrong PTD bit (for example bit
7 instead of record 11 for DISP).

Also track apple,no-ack bits on the report and exclude them from the
acknowledgment mask polled in apple_pmp_report_wake(), so entries that the
PMP never acknowledges do not trigger a wake poll timeout.

Signed-off-by: Satya Benson <satya@benson.earth>
apple_sleep_coproc_register_first() recorded the device\x27s primary power
domain so apple_sleep_lower_stray() would leave it powered until the
commit stop ran, but apple_sleep_coproc_register() did not record the
power domain and apple_sleep_coproc_lowers() only checked first-pass
coprocessors.

On T8122, apple-sio registers for second-pass commit stop (first = false)
and keeps ps_sio_cpu powered across noirq because accessing its ASC or
mailbox while powered off raises an external abort. Because t8122_stray[]
also lists sio_cpu (0x210), apple_sleep_lower_stray() powered off sio_cpu
on a committed sleep immediately before apple_sleep_coprocs_stop(s, false)
ran sio_commit_stop().

Record the primary power domain in apple_sleep_coproc_register(), guard
against ps == 0 in apple_sleep_coproc_lowers(), and exempt all ready
commit-stopped coprocessors from stray lowering. Add a KUnit case
covering second-pass coprocessor domain protection.

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

Commit fd6beaa ("soc: apple: sleep: wire SLP_DDR vote word on T8122")
set coproc_slp_ddr on t8122_sleep_soc so an adopted 27.2 MTP session with
retained DRAM buffers sets WAKE_SLP_DDR bit 0 across sleep. On T8122,
t8122_sleep_commit_regs() unconditionally steps down the MCC channels and
enters DRAM-off sleep; leaving WAKE_SLP_DDR bit 0 set makes the SoC sleep
for the full RTC duration and immediately cold-boot at wake (verified on
J613 with 15 s vs 45 s rtcwake intervals shifting next-boot time by
exactly 30 s with zero panic delay).

With WAKE_SLP_DDR bit 0 clear, the adopted 27.2 MTP session survives full
DRAM-off deep sleep across consecutive cycles on J613 (matching T8132,
T8140, and T8142). Keep sleep_slp_ddr_bind() wired for USB voters, clear
coproc_slp_ddr on t8122_sleep_soc, and update
apple_sleep_test_slp_ddr_voters() accordingly.

Signed-off-by: Satya Benson <satya@benson.earth>
@satchlj
satchlj requested review from a team and DjDeveloperr as code owners December 3, 2026 02:13
@github-actions github-actions Bot added area:display Area from CODEOWNERS (bot) area:gpu Area from CODEOWNERS (bot) area:platform Area from CODEOWNERS (bot) area:power Area from CODEOWNERS (bot) blast:m3 Macs affected, from Merge risk (bot) door:two-way Revertible or not, from Merge risk (bot) needs-review No approving review from Core or Omarchy Mac yet (bot) labels Dec 3, 2026
@github-actions

github-actions Bot commented Dec 3, 2026 •

Copy link
Copy Markdown

Merge readiness at 8660886a: not ready yet

Check Detail
CI at head running running: apple-build, dt-checks, host-tests, source, KUnit plan, DWC3/ATC
Review ok approved by RyanTheTide
Requested changes ok none
Hardware row at head ok comment at 8660886a
Conflicts ok none
PR text ok Risk: two-way · M3 (T8122) Macs; shared pmp-report record lookup and sleep.c second-pass coprocessor domain check affect shared Apple Silicon sleep/PMP paths (verified with host mutation tests and KUnit; plain revert restores prior behavior).

Areas: area:display, area:gpu, area:platform, area:power

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

@DjDeveloperr

DjDeveloperr commented Dec 3, 2026 •

Copy link
Copy Markdown
Contributor

(Corrected in place and updated for head 73eddd32ebd7 — the earlier version misnamed the apple-dart.c functions and missed that #3818 sets apple,no-ack on T6030 ANS.)

Checked T6030 shared-path impact and mergeability with #3818 (ada93827a977) at head 73eddd32ebd7:

  • Merge with soc: apple: enable T6030 suspend-to-RAM on J516s #3818 (ada93827a977): clean, 0 conflicts (5c56ec08ad47) in either land order.
  • drivers/iommu/apple-dart.c: apple_dart_display_streams() adds "apple,t8122-dart" alongside "apple,t8112-dart" for apple_dart_t8112_display_streams(), which moves apple_dart_display_dark_enter() ahead of the !dart->display_saved state save. "apple,t6030-dart" stays on the generic apple_dart_display_streams() path (unchanged).
  • drivers/pmdomain/apple/pmp-report.c: apple_pmp_report_of_entry() resolves reg/apple,soc-device-record via apple_pmp_report_record(), and apple_pmp_report_check_t6030_ack() adds &apple_pmp_offsets_t8122. For rep->no_ack, apple_pmp_report_wake() masks want = rep->shadow & ~rep->no_ack: #3818 marks pmp_report_ans (report@10) apple,no-ack in drivers/soc/apple/t6030-j516s-pmp.dtso and t6030-pmp.dtso, so once #3818 lands the T6030 wake poll drops waiting on an ANS ACK that the PMP never sends.
  • drivers/soc/apple/sleep.c: apple_sleep_coproc_register() now records c->ps and c->domain for all coprocs and apple_sleep_coproc_lowers() drops the c->first check; apple_sleep_coproc_lowers() is only called from the .stray loop, which is empty on T6030 (t6030_sleep_soc.nstray == 0).
  • drivers/gpu/drm/apple/dcp.c (73eddd32ebd7): if (dcp->hw.v27_early_stop && fw_compat != DCP_FIRMWARE_V_27_0) dcp->hw.s2r_layout = NULL; leaves apple_dcp_hw_t6030 unchanged on firmware 27.2 (&dcp_s2r_t6030) and drops a layout T6030 does not read on older firmware (dcp_v27_early_suspend() checks dcp->hw.s2r_layout, and .s2r/.s2r_ext are false). #3818 does not touch dcp.c, so the two agree in either land order.
  • Host tests (#3818 + #3809 + #3763 + #4037 @ 73eddd32ebd7): t6030-pmp-graph-tests (with --mutations), t6030-pmp-supplier-tests (with --mutations), t6030-sleep-qblk-tests (with --mutation), t6030-display-admission-tests (with --mutations), t6030-display-linkage-tests, t6030-clock-tests, and t6030-wiring-tests all pass (13/13 runnable; t6030-pmp-dt-tests skipped only because fdtget is not installed on this host).

A J516s boot + sleep no-regression row at 73eddd32ebd7 is staged in our four-PR sleep kernel.

apple_pmp_report_entry_probe() now records an apple,no-ack entry in the
report's no_ack. The fixture has its own struct apple_pmp_report, so the
test no longer builds. Add the member.

Fixes: 1eb248c ("pmdomain: apple: resolve soc-device-record in pmp-report entry lookups")
Signed-off-by: DjDeveloperr <hey@djdev.me>
@github-actions github-actions Bot added the needs-hw-row No hardware row at the PR head (bot) label Dec 3, 2026
T8122's s2r_ext and s2r_layout are in its static hw data, so they also
apply on firmware 14.7 and 26.6:

- The external DCP on 26.6 runs as H17P, which dcp_s2r_ext_capable()
  accepts without looking at the method table. A dry-run deep sleep then
  stops that firmware through dcp_s2r_ext_suspend() in place of its own
  retained path.
- On 14.7 and 26.6 s2r_ext turns on the external DCP's OSLOG echo, which
  apple,sync-syslog-ack keeps off there.
- The internal DCP's 26.6 sleep turns the display DART off from D572 with
  dcp_s2r_layout(), now dcp_s2r_t8122, which has no streams. The streams
  it finds itself (dcp_v26_find_darts()) are no longer used there.

Set s2r_ext where the firmware 27 external DCP is set up, and drop the
v27_early_stop layout on any other firmware. Firmware 27 is unchanged.

Fixes: 70ce55f ("drm/apple, arm64: dts: apple: support T8122 firmware 27.2 DCP/DCPext S2R")
Signed-off-by: DjDeveloperr <hey@djdev.me>
T8122 no longer takes coprocessor SLP_DDR votes, and
apple_pmp_report_check_t6030_ack() now covers it.

Signed-off-by: DjDeveloperr <hey@djdev.me>
DjDeveloperr
DjDeveloperr previously approved these changes Dec 3, 2026

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

Reviewed 9ccc8a20bfed plus the test-only 90897fed439e. The firmware 27.2 path on J613/J615 is right and I approve it. Two rows are still owed before the merge, listed below.

Pushed: 90897fed439e, test only. 1eb248cd05cf adds no_ack to struct apple_pmp_report, and the fixture in tools/asahi/t6030-pmp-graph-tests.c has its own copy of that struct. Both t6030-pmp-graph-tests jobs failed to build, so host-tests would have been red here and on main. Everything outside tools/ is identical to 9ccc8a20bfed, so the J613 row and the J615 row running now still count.

Firmware 14.7 and 26.6 are not untouched yet. s2r_ext and s2r_layout are static hw data, and neither is limited to firmware 27:

  • 26.6 external DCP: it runs as H17P, and dcp_s2r_ext_capable() accepts H17P without the method table. A dry-run deep sleep now takes dcp_s2r_ext_suspend().
  • 14.7 and 26.6 external DCP: s2r_ext turns on the OSLOG echo that apple,sync-syslog-ack keeps off. This one needs no option on the command line.
  • 26.6 internal DCP: its D572 handler now gets dcp_s2r_t8122, which has no DART streams, instead of the streams dcp_v26_find_darts() found.

I have a small follow-up that limits these to firmware 27 and leaves 27.2 as it is. It should land right after this one, in the same cut. One thing stays for #3760: the new DART routing also applies to the 26.6 sleep, so a 25G83 J613 row is needed before that PR makes deep sleep the default there.

Not in the description: s2r_ext also turns on the runtime idle stop. On firmware 27 the external DCP now powers off 5 s after boot or unplug with nothing attached, and starts again at plug-in. That is default behaviour on every M3 with a USB-C display output, without any sleep. The J613 row covers it unplugged only.

Rows owed before merge

  1. J615 on 27.2 (running).
  2. J613 or J615 on 27.2 with an external display, no sleep needed: boot unplugged, wait 15 s, plug in, unplug, wait 15 s, plug in again. The picture must come up both times, with no dcpext idle error and no DART fault. Any M3 Air with a monitor will do.

Which other Macs run changed code

  • pmp-report.c record lookup: T8122 only, nothing else has apple,soc-device-record. ACK check: T8122 added, T6030 as before. Wake poll without apple,no-ack bits: T8122, and T6030 once #3818 gives it a firmware sleep (its PMP overlay marks ANS apple,no-ack). There it drops a wait for an ACK that never comes.
  • apple-dart.c: T8122 routing. The new dark-then-save order also changes T8112: an external DART that went dark before its streams stopped is now saved and restored. An M2 external-display row is useful with #3822, not a gate here.
  • sleep.c stray lowering: T8122 only. I compared the ANS, PMP and SIO power words with the stray lists: none match on T8103, T8132, T8140 or T8142, and T6040, T6050 and T8112 have no list.
  • coproc_slp_ddr: T8122 only.

So no J700, J773g, J714s or J414s row is needed. The J516s no-regression row is welcome and doesn't gate this.

Ran: W=1 of the touched objects at each of the 6 commits, 0 new warnings; the same objects with their KUnit suites built in (built, not run: the sleep suite needs arm64); dt_binding_check of both bindings; CHECK_DTBS on all 7 T8122 device trees at the base and at both DT commits, 0 new warnings; the full host-test list (1032 jobs) in the workflow's container, where the only failures from this PR are the two fixed above and the rest are controls that need history my shallow checkout lacks. The PMP host tests pass with the fix (24/24).

Order inside the PR, nothing to change now: 70ce55ff7743 uses the display request before 1eb248cd05cf resolves it to record 11, so an opt-in deep sleep on a kernel built between the two would touch the wrong request.

Land order: this PR, then the follow-up. #3818, #3822, #4030 and #3762 apply in either order; #3763 shares no file. #3760 is based on an old main and needs an update, then its own 27.2 and 25G83 rows on top of this.

@github-actions github-actions Bot removed the needs-hw-row No hardware row at the PR head (bot) label Dec 3, 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 claim that 26.6 keeps its display sleep path fails on this head. T8122 external DCP sets s2r_ext unconditionally, and dcp_s2r_ext_capable accepts the older H17P method without a firmware-27 table check. That diverts a 26.6 external DCP into the new stop path. #4038 moves the flag to the firmware-27 probe branch. Please fold that fix in before landing this parent.

@DjDeveloperr

Copy link
Copy Markdown
Contributor

Folded as RyanTheTide asked: #4038's two commits are now on this branch as a plain fast-forward, head 73eddd32ebd7. s2r_ext and the stream-less s2r_layout now follow firmware 27, so a 26.6 or 14.7 M3 keeps its own display paths. On 27.2 the same values are set, a few lines later in probe.

Rows: a J615 27.2 run already started at 9ccc8a20bfed still counts for sleep. The external-display step (boot unplugged, 15 s, plug in, unplug, 15 s, plug in; picture both times, no dcpext idle error, no DART fault) has to run at 73eddd32ebd7, since that's the path the fold moves. #4038 was built at this head with W=1 (0 new warnings); its host tests pass apart from one control that needs history.

@RyanTheTide

Copy link
Copy Markdown
Contributor

J615 (M3 Air 15", T8122, os-fw 27.2 / 26B123) row at exact head 9ccc8a2: committed deep sleep PASS 2/2, internal panel.

How: kernel built at this head, booted with this head's own t8122-j615.dtb in one aura-try trial (trial guard + 30 min dead-man, GRUB one-shot), back to production afterwards. Same switches as the J613 run: apple_sleep.deep=1 on the one-shot entry only, untested_commit=1 at runtime, echo deep > /sys/power/mem_sleep, rtcwake -d rtc1 -m mem -s 20 (rtc1 = apple-pmu-rtc) twice in one boot, about 225 s after boot.

  • Boot: deep sleep available, not the default: boot object resumes 0. mem_sleep [s2idle] deep with the param, [s2idle] without it (run 1).
  • Cycle 1: rc 0, wall 22 s, back from sleep, boot object resumes 0 -> 1, wake source: NUB.SPMI0.SW3.
  • Cycle 2: rc 0, wall 22 s, boot object resumes 1 -> 2, same wake source.
  • After each wake: eDP-1 connected + enabled, backlight restored (25). Internal DCP V27 sleep served 13 endpoints. 31ac00000.dcp warm-restarted (RTKit init at entry). aurora-g16 health: failed 0, idle at S2. Wi-Fi back with the same address. After both cycles: glmark2-es2-gbm build 4961 FPS. 0 Oops/WARN/BUG/SError, 0 GPU/DART faults.
  • Not covered here: external DP. Our J615 has no sink on its USB-C ports, so the attached-DCPext half still needs another M3 Air. Bluetooth was not checked in this run.
  • Only failed unit on the trial boot: the lab's older speakerguardd-v2-switchtest against the ASoC: apple: macaudio: refuse a grant after another file re-routes the speakers #3212 pairing. It is unrelated.

Evidence (ours, untainted): traces/gpu/20261203-m3pro-gpu-dvfs/pr4037-j615/ (trial-deep-extra.txt, trial-deep-kernel-journal.txt), trial log traces/boot/20261127-dt-parity/rows/j615/run.log 13:49-13:59 AEDT. J615 restored: saved edge, next_entry empty, no trial leftovers, Enforcing, 0 failed.

@satchlj

satchlj commented Dec 3, 2026

Copy link
Copy Markdown
Member Author

Reviewed the three folded commits (90897fed439e..73eddd32ebd7) on this branch — signed off, looks good to me:

  • 90897fed439e (t6030-pmp-graph-tests.c): adds no_ack to the local struct apple_pmp_report fixture to match 1eb248cd05cf.
  • 2d2d619a28c6 (dcp.c): sets s2r_ext = true in the firmware 27 probe branch and clears s2r_layout when v27_early_stop && fw_compat != DCP_FIRMWARE_V_27_0, keeping 14.7 and 26.6 display paths untouched while leaving firmware 27.2 values identical.
  • 73eddd32ebd7 (pmp-report.c, sleep-test.c): updates the two comments cleanly.

PR description is updated to match 73eddd32ebd7, the firmware-27 s2r_ext runtime idle stop, and credits.

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

Review at 73eddd3. No crash or lifetime bugs found. Two scope points before an approval from this side:

  1. Runtime DCPext idle-off now applies to every firmware-27 T8122 board, with or without sleep. dcp.c sets hw.s2r_ext = true for any apple,t8122-dcpext on firmware 27. With the USB-C fixed connector and no hdmi_hpd, that makes dcp_ext_idle_capable() true on J613/J615/J433/J434/J504. About 5 s after boot with nothing plugged, DCPext powers off, and the first plug-in afterwards goes through the dcp_s2r_ext_start() restart. No row has covered that plug-in yet. Our J615 rows (no sink attached) show DCPext restarting around each sleep entry and wake, but no hot-plug after an idle-off. Dj's unplug/wait/replug step on J613 is exactly this. I'd hold the merge on that row, or gate the idle-off until it passes.
  2. The DART routing has no firmware gate. apple_dart_display_streams() now sends every apple,t8122-dart to apple_dart_t8112_display_streams(). The DART can't see the firmware version, so the 26.6 (J613 25G83) internal and external DCP sleep paths change too: they now take the saved-tables check that returns -EIO on wake when the tables were lost and the DART is locked. #4038's stated scope is firmware 27 only. Is that intended? If yes, a 26.6 J613 wake row covers it; otherwise gate it in the caller. The display_saved reorder also touches T8112, which has no row here.

Checked and fine: T6030 and older-firmware layouts in dcp.c (s2r_layout cleared off firmware 27; T6030 14.7 never sets s2r/s2r_ext); pmp-report soc-device-record/no-ack only on the 25G83 J613 tree; the apple_sleep_coproc_lowers() exemption only changes T8122's sio_cpu; .coproc_slp_ddr removal is T8122 only; bindings match the DTS. Nits: rep->no_ack is never cleared on entry failure or removal (same pattern as always_on), and apple_pmp_report_entry_request() returns 0 when the record doesn't resolve.

J615 sleep receipt at 9ccc8a2 (same code outside tools/): #4037 (comment)

…idle

Keep the T8122 display DART save/restore path scoped strictly to
firmware 27 external DCP, and keep runtime DCPext idle-off disabled on
T8122 until physical hot-plug wake from idle-off is verified:

- Revert the unconditional apple,t8122-dart routing in
  apple_dart_display_streams() and the display_saved reorder in
  apple_dart_t8112_display_streams(), leaving firmware 26.6 T8122 and
  T8112 paths unchanged.
- Export apple_dart_display_streams_saved() and call it from
  dcp_s2r_stop_streams() and dcp_s2r_wake_darts() only when
  hw.s2r_dart_save_restore is set in T8122's firmware-27 probe branch.
- Add hw.no_ext_idle (checked in dcp_ext_idle_capable(), with a KUnit
  check) and set it on apple_dcp_hw_t8122_dcpext so runtime DCPext
  idle-off stays off while system-sleep s2r_ext stop and wake still run.

Signed-off-by: Satya Benson <satya@benson.earth>
@github-actions github-actions Bot added needs-hw-row No hardware row at the PR head (bot) and removed ci-failing A check failed at the PR head (bot) labels Dec 3, 2026
@satchlj

satchlj commented Dec 3, 2026

Copy link
Copy Markdown
Member Author

Both review points are addressed in 8660886a8e42:

  1. Runtime DCPext idle-off gated off on T8122 (no_ext_idle): Added hw.no_ext_idle (checked in dcp_ext_idle_capable(), with a KUnit check in dcp-firmware-test.c) and set it on apple_dcp_hw_t8122_dcpext. Runtime idle power-off stays disabled on T8122 until physical USB-C hot-plug wake from idle-off is tested, while system-sleep s2r_ext stop and wake still run.
  2. DART save/restore gated in the firmware-27 caller (s2r_dart_save_restore): Reverted both changes to apple_dart_display_streams() and apple_dart_t8112_display_streams() so firmware 26.6 T8122 and T8112 paths are completely unchanged. Exported apple_dart_display_streams_saved() and wired dcp_s2r_stop_streams() / dcp_s2r_wake_darts() to call it only when hw.s2r_dart_save_restore is set in T8122's DCP_FIRMWARE_V_27_0 probe branch.

Running an exact-head 8660886a8e42 2-cycle J613 (27.2) deep-sleep check once the current build queue clears to confirm the live-stop DCPext path with no_ext_idle active, and watching CI now.

@RyanTheTide

Copy link
Copy Markdown
Contributor

J615 (M3 Air 15", T8122, 27.2) exact-head row at 8660886: committed deep sleep PASS 2/2.
Same method as the 9ccc8a2 row: kernel at this head, this head's t8122-j615.dtb (unchanged from 9ccc8a2), one aura-try trial, apple_sleep.deep=1 on the one-shot entry, untested_commit=1, and rtcwake -d rtc1 -m mem -s 20 twice.

  • Cycle 1: rc 0, 22 s, boot object resumes 0 -> 1, wake source: NUB.SPMI0.SW3. Cycle 2: rc 0, 24 s, 1 -> 2, same wake source.
  • After each wake: eDP-1 connected + enabled, and the backlight came back to its pre-sleep level (500/500; userspace had raised it about 9 s into boot). aurora-g16 health 0 and S2 at idle. Wi-Fi back. glmark2-es2-gbm build 5270 FPS after both cycles. 0 Oops/WARN/BUG/SError, 0 GPU/DART faults.
  • With no_ext_idle, nothing idles DCPext at runtime. It is only stopped and restarted for the two sleeps. External DP is still not covered: no sink on our J615.
    Evidence: traces/gpu/20261203-m3pro-gpu-dvfs/pr4037-j615/trial-deep-8660886a-{extra,journal}.txt. J615 restored to saved edge.

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

Approving at 8660886. Both earlier points are resolved. no_ext_idle keeps T8122 DCPext out of runtime idle-off, with a KUnit check. DART save/restore is now opted into per DCP (s2r_dart_save_restore, firmware-27 t8122-dcpext only), apple_dart_display_streams() no longer routes t8122-dart, and the t8112 save/dark order matches main, so 26.6 T8122 and T8112 are unchanged. J615 committed deep sleep 2/2 at this exact head, receipt above. The external-display hot-plug half still rests on the J613 row.

@github-actions github-actions Bot removed needs-hw-row No hardware row at the PR head (bot) needs-review No approving review from Core or Omarchy Mac yet (bot) labels Dec 3, 2026
@satchlj

satchlj commented Dec 3, 2026

Copy link
Copy Markdown
Member Author

Exact-head J613 27.2 hardware row (8660886a8e42)

Target: J613 (Apple M3 MacBook Air 13", T8122, macOS 27.2 26B123 stub, aura 1.0.0b18)
Build: exact head 8660886a8e42dbb482839e0bc444b30f2940efab (Image + modules + exact-head t8122-j613.dtb, apple_sleep.deep=1 apple_sleep.untested_commit=1, mem_sleep=deep)

Check Result
Cycle 1 (rtcwake -d rtc1 -m mem -s 15) PASS — V27 sleep: internal DCP stop ... result 0, 6 coprocessors up and stopped, boot object resumes 0 -> 1 (NUB.SPMI0.SW3), V27 wake: firmware back ... plain-on 0@23, same boot_id, backlight 163/525, wlan0 UP LOWER_UP
Cycle 2 (rtcwake -d rtc1 -m mem -s 15) PASS — V27 sleep: internal DCP stop ... result 0, 6 coprocessors up and stopped, boot object resumes 1 -> 2 (NUB.SPMI0.SW3), V27 wake: firmware back ... plain-on 0@23, same boot_id, backlight 163/525, wlan0 UP LOWER_UP
hw.no_ext_idle & DART gating Confirmed no runtime dcpext idle-off; 6 coprocessors up and stopped across both committed deep cycles with apple_dart_display_streams_saved() active only on T8122 fw-27
Post-wake health & faults card1-eDP-1 connected, 6 input devices (MTP keyboard/trackpad), Bluetooth Powered: yes, 0 DART faults, 0 MTP errors, 0 GPU errors, 0 failed systemd units, 0 xART diffs

Both J613 and J615 now pass 2/2 committed deep sleep at exact head 8660886a8e42; waiting only on queued CI checks to finish green before merge.

@DjDeveloperr

DjDeveloperr commented Dec 3, 2026 •

Copy link
Copy Markdown
Contributor

Hosted CI is queued, so I ran the affected checks on the merge of 8660886a8e42 with main 13dc5a79c0ec (tree e5047e381d42), and I'm merging on those.

  • run-host-tests.py, the PMP, sleep, T6030, DART, DCP and DCPext families in the hosted job's container: 215/215, plus the apple-dcp, apple-afkv2 and display suites 13/13. All mutation runs included.
  • make LLVM=1 ARCH=arm64 W=1 of sleep.o, pmp-report.o, apple-dart.o, drm/apple/ and g17/sleep.o: 0 compiler warnings. The same objects with their KUnit suites built in: 0 compiler warnings. (Corrected: W=1 also prints kernel-doc warnings for pmp-report.c:108 and pmc.c:186 and one dtc warning for audio-no-sio-test.dtso. This PR touches none of those places; on main the kernel-doc check of pmp-report.c prints the same three members.)
  • All 141 Apple device trees build on both sides; only the seven T8122 ones change. CHECK_DTBS on those seven and one board of seven other SoCs: 0 new warnings. dt_binding_check passes on both bindings. ADT coverage and DART power domains: nothing new.
  • checkpatch.pl --strict: 10/10 commits clean.
  • Not run here: the apple-sleep and DCP KUnit suites. Both need arm64, so UML can't build them; the hosted KUnit jobs stay queued. The new checks in sleep-test.c and dcp-firmware-test.c pass on the host against the functions taken from this tree, and fail when the fix is taken out.

Other Macs: no change. Only the T8122 trees carry apple,soc-device-record, and only T8122's display gate adds it at boot, so everywhere else (A18 Pro and M5 through g17/sleep.c included) the request bit is still the entry's reg. The wake mask is non-zero only on T6030, T6031 and T8122, and of those only T8122 has a deep sleep on main. No ANS, SIO or PMP power word is in another SoC's stray list, and only T8122's external DCP on firmware 27 calls the new DART helper.

Still open after the merge: an external display on an M3 Air's USB-C port across a sleep.

@DjDeveloperr
DjDeveloperr merged commit 1dd4889 into main Dec 3, 2026
13 of 16 checks passed
@DjDeveloperr
DjDeveloperr deleted the feat/dcp-t8122-v27-s2r branch December 3, 2026 05:29
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) area:platform Area from CODEOWNERS (bot) area:power Area from CODEOWNERS (bot) blast:m3 Macs affected, from Merge risk (bot) door:two-way Revertible or not, from Merge risk (bot)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants