Skip to content

soc: apple: sleep: wire SLP_DDR vote word on T8122 - #3967

Merged
DjDeveloperr merged 1 commit into
mainfrom
m3uport/t8122-slp-ddr
Dec 2, 2026
Merged

DjDeveloperr merged 1 commit into
mainfrom
m3uport/t8122-slp-ddr

Conversation

@RyanTheTide

Copy link
Copy Markdown
Contributor

Problem

t8122_sleep_map_regs() maps the PMGR "wake" register block (0x2e4004000) but never calls sleep_slp_ddr_bind(s), and t8122_sleep_soc does not set .coproc_slp_ddr = true. As a result, WAKE_SLP_DDR (word 0 bit 0) votes from dwc3 and from an adopted live coprocessor retaining DRAM carve-out buffers (such as the retained MTP session on macOS 27.2 firmware, where rtkit-helper votes apple_sleep_coproc_slp_ddr(true) after #3774) are silently dropped on T8122.

Change

Mirror the T8112 wiring from #3774 for T8122:

  • Call sleep_slp_ddr_bind(s) at the end of t8122_sleep_map_regs() in drivers/soc/apple/sleep-t8122.h.
  • Set .coproc_slp_ddr = true on t8122_sleep_soc.
  • Update apple_sleep_test_slp_ddr_voters() in drivers/soc/apple/sleep-test.c to expect coproc_slp_ddr on both apple,t8112-sleep and apple,t8122-sleep.

Boards without an adopted live DRAM coprocessor session (such as 25G83 boots where MTP is quiesced) remain unaffected and leave bit 0 clear for DRAM-off deep sleep.

Testing

  • checkpatch: 0 errors, 0 warnings on fd6beaafbf59.
  • arm64 KUnit (apple-sleep-soc-data): 16/16 PASSED in qemu-system-aarch64 (including apple_sleep_test_slp_ddr_voters).
  • Hardware row: fd6beaafbf59 + J615 (Apple MacBook Air 15" M3, T8122, macOS 27.2 firmware) + default cmdline (7.3.0-m3uportl1, one-shot non-default BLS entry, Stage 2 unchanged, silent) + PASS:
    • Default boot: /sys/power/mem_sleep = [s2idle], rtkit-helper 2fa400000.mtp: adopted the running RTKit session (4 retained buffers), apple_pmp started (c6ccb960), aurora-g16 bound with thermal-zone cooling S1->S8 (Apple M3 (G15G C0) Vulkan OK), Wi-Fi OK, eDP connected, Enforcing, 0 Oops/WARN/fault, 0 AVC.
    • s2idle: 3/3 PASS (rtcwake -d rtc0 -m freeze -s 15, suspend_stats/success=3, fail=0).
    • Deep dry run (apple_sleep.deep=1 in non-default trial entry only, GPU + 31ac00000.dcp unbound): dry run: every check passed; refusing before the first stop and the commit.
    • Guarded committed deep sleep (untested_commit=Y, rtcwake -d rtc0 -m mem -s 20): did not trigger the prior ~60 s PMGR recovery reset (stayed dark past +180 s until VDM recovery), confirming WAKE_SLP_DDR behavior changed while full J615 27.2 wake still needs follow-up fixes (stray domains + PMP 27.2 SRAM/commit stop).

Risk

Low. Scoped strictly to T8122 (sleep-t8122.h and the T8122 expectation in sleep-test.c), matching the merged T8112 path from #3774. Default behavior on J615 remains s2idle (apple,sleep-tested absent).

Still to run

  • J613 27.2 deep-sleep qualification once migrated.
  • Separate follow-up PRs for T8122 J615 stray domains (t8122_ps_all[] ANE + t8122_stray[]) and T8122 27.2 PMP SRAM/commit stop.

T8122 maps the PMGR wake block in t8122_sleep_map_regs() but never bound
sleep_slp_ddr_word or enabled coproc_slp_ddr, so WAKE_SLP_DDR votes from
a live adopted coprocessor with DRAM buffers (the retained MTP on macOS
27.2 firmware, where rtkit-helper votes SLP_DDR) and from the always-on
USB host were silently dropped.

Bind word 0 of the wake block at the end of t8122_sleep_map_regs(), set
.coproc_slp_ddr = true on t8122_sleep_soc (matching T8112), and update
the profile check in apple_sleep_test_slp_ddr_voters().

Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
@RyanTheTide
RyanTheTide requested review from a team as code owners December 2, 2026 17:22

@satchlj satchlj left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed fd6beaafbf59 against drivers/soc/apple/sleep-t8122.h, sleep-t8112.h, and sleep.c:

  • t8122_sleep_map_regs() maps s->wake via the regs[] offset table (failing out on error) before calling sleep_slp_ddr_bind(s) at the end after apple_sleep_alloc_books(s), so sleep_slp_ddr_word is never bound on an early probe failure.
  • .coproc_slp_ddr = true on t8122_sleep_soc and the updated apple_sleep_test_slp_ddr_voters() check match the merged T8112 wiring from #3774, with zero impact on boards without a retained live DRAM coprocessor session.
  • DCO, ## Risk, KUnit (16/16), and exact-head J615 27.2 hardware row (3/3 s2idle, deep dry run, and guarded commit showing WAKE_SLP_DDR behavior change) look clean. Good to merge once CI completes.

@github-actions github-actions Bot added area:platform Area from CODEOWNERS (bot) blast:m2 Macs affected, from Merge risk (bot) blast:m3 Macs affected, from Merge risk (bot) needs-template PR body lacks Tested or Risk (bot) labels Dec 2, 2026
@github-actions

github-actions Bot commented Dec 2, 2026

Copy link
Copy Markdown

Merge readiness at fd6beaaf: not ready yet

Check Detail
CI at head ok no CI for this change (the hardware row is the gate)
Review ok approved by satchlj
Requested changes ok none
Hardware row at head ok in the PR body at fd6beaaf
Conflicts ok none
PR text no add a 'Tested:' line; 'one-way' or 'two-way' in Risk (guide)

Areas: area:platform

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

@DjDeveloperr

Copy link
Copy Markdown
Contributor

Local CI receipt for head fd6beaafbf59. GitHub has no hosted workflow runs for this head, so I ran the matching checks locally under the maintainer hosted-CI override.

Tree: fd6beaafbf59 merged onto main 50addca5fc3f, with merge base 0bc45c54fbe6. The merge is clean. sleep-test.c also changed on main after the base, and it merges without conflict. The merge tree is 42e30f0dfb6b. Only drivers/soc/apple/sleep.c includes the two changed files. Toolchain: clang 23.1.3, arm64 cross, LLVM=1.

  • Apple build config (defconfig + asahi.config, as in apple-build-kunit.yml; CONFIG_APPLE_SOC_SLEEP=y; Rust off because the change is C only): make ARCH=arm64 LLVM=1 W=1 drivers/soc/apple/sleep.o drivers/soc/apple/sleep-perf-step.o drivers/soc/apple/t6041-sleep.o drivers/soc/apple/t6050-aop.o. It builds with 0 warnings and 0 errors, the same as main.
  • KUnit config (the same plus CONFIG_KUNIT=y and CONFIG_APPLE_SOC_SLEEP_KUNIT_TEST=y, so sleep.c pulls in sleep-test.c): the same W=1 command builds with 0 warnings and 0 errors, the same as main. sleep.o contains apple_sleep_test_slp_ddr_voters.
  • checkpatch: scripts/checkpatch.pl -g fd6beaafbf59 and --strict both report 0 errors, 0 warnings and 0 checks.
  • KUnit run: compile only here, because this host has no QEMU. The run result is the 16/16 apple-sleep-soc-data pass in the PR body.
  • host-tests: not run. No host test or CI script reads sleep-t8122.h or sleep-test.c (I grepped tools/, scripts/ and .github/).

Everything is clean, so I'm merging at fd6beaafbf59 with a merge commit.

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

Labels

area:platform Area from CODEOWNERS (bot) blast:m2 Macs affected, from Merge risk (bot) blast:m3 Macs affected, from Merge risk (bot) needs-template PR body lacks Tested or Risk (bot)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants