Skip to content

soc: apple: sleep-t8122: cover ANE, ISP, and fpwm1 domains at sleep entry - #3971

Merged
DjDeveloperr merged 1 commit into
mainfrom
m3uport/t8122-stray-j615-domains
Dec 2, 2026
Merged

DjDeveloperr merged 1 commit into
mainfrom
m3uport/t8122-stray-j615-domains

Conversation

@RyanTheTide

Copy link
Copy Markdown
Contributor

Problem

t8122_ps_all[] in drivers/soc/apple/sleep-t8122.h omitted the four ANE subdomain power states defined in t8122-pmgr.dtsi (ps_ane_mpm 0xc000, ps_ane_cpu 0xc008, ps_ane_td 0xc010, ps_ane_base 0xc018), and t8122_stray[] did not cover the ISP sensor/set domains (0x180..0x198, 0x4000..0x4060), ANE domains (0xc000..0xc018, 0x438), or fpwm1 (0x220) that can remain powered at deep-sleep entry on J615.

Change

  • Add 0xc000, 0xc008, 0xc010, and 0xc018 to t8122_ps_all[].
  • Add ispsens0..3, isp_set12..0, isp_fe (before existing isp_sys), ane_base, ane_td, ane_cpu, ane_mpm, ane_sys, and fpwm1 to t8122_stray[] in child-before-parent order (44 entries total, within BITS_PER_LONG).

Domains already powered off at sleep entry are untouched, and dry runs continue to perform no power writes.

Testing

  • checkpatch: 0 errors, 0 warnings on ae94c46cb333.
  • arm64 KUnit (apple-sleep-soc-data): 16/16 PASSED in qemu-system-aarch64 (including apple_sleep_test_words and apple_sleep_test_books).
  • Hardware row: ae94c46cb333 + J615 (Apple MacBook Air 15" M3, T8122, macOS 27.2 firmware) + default cmdline (7.3.0-m3uportl2, one-shot non-default BLS entry, Stage 2 unchanged, silent) + PASS:
    • Default boot: /sys/power/mem_sleep = [s2idle], apple_pmp started (c6ccb960), aurora-g16 bound (Apple M3 (G15G C0)), 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.
    • Restored to saved aurora-edge-933f8226 (boot_success=1, Enforcing, 0 failed).

Risk

Low. Scoped strictly to T8122 (sleep-t8122.h). Follows the same pattern as #3834; domains already off at entry are untouched and default behavior on J615 remains s2idle.

Still to run

…ntry

t8122_ps_all[] omitted the four ANE subdomain power states present in
t8122-pmgr.dtsi (ps_ane_mpm 0xc000, ps_ane_cpu 0xc008, ps_ane_td 0xc010,
ps_ane_base 0xc018), and t8122_stray[] did not include the ISP sensor
and set domains (0x180..0x198, 0x4000..0x4060), ANE domains
(0xc000..0xc018, 0x438), or fpwm1 (0x220) that can remain powered at
deep-sleep entry on J615.

Add the four ANE power states to t8122_ps_all[] and list the ISP, ANE,
and fpwm1 domains in child-before-parent order in t8122_stray[] so
apple_sleep_lower_stray() turns them off before commit and restores them
in reverse order on refusal or wake. Domains already off are untouched,
and dry runs perform no power writes.

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

@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 ae94c46cb333 against arch/arm64/boot/dts/apple/t8122-pmgr.dtsi and drivers/soc/apple/sleep-t8122.h:

  • All four ANE subdomain power states (0xc000..0xc018) match t8122-pmgr.dtsi and keep t8122_ps_all[] strictly ascending with no duplicates.
  • Every added t8122_stray[] entry (ispsens0..3, isp_set12..0, isp_fe, ane_base/td/cpu/mpm/sys, fpwm1) matches its DTSI reg and label, appears in t8122_ps_all[], has no overlap with t8122_ps_macos_on[]/macos_off[]/wake_order[], and preserves child-before-parent lowering order (ane_base before ane_td/ane_cpu before ane_sys, ISP children before isp_sys).
  • Total t8122_stray[] count is 44 (within BITS_PER_LONG).
  • DCO, ## Risk, KUnit 16/16, and exact-head J615 27.2 default-cmdline + 3/3 s2idle + deep dry-run row all look clean.

LGTM.

@DjDeveloperr

Copy link
Copy Markdown
Contributor

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

Tree: ae94c46cb333 merged onto main 35a4f0c6f9a6, which now includes #3967. The merge base is 0bc45c54fbe6. The merge is clean: this PR's hunks in sleep-t8122.h (lines 103 and 138) don't overlap #3967's. The merge tree is dc4348b3afd5. Only drivers/soc/apple/sleep.c includes sleep-t8122.h. 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.
  • Stray list, checked statically against t8122-pmgr.dtsi (the &pmgr block):
    • t8122_stray[] has 44 entries, within BITS_PER_LONG (64).
    • All 18 child/parent pairs inside the list (following power-domains up the chain) put the child first, e.g. ane_base before ane_td/ane_cpu, and those before ane_sys.
    • Every entry is in t8122_ps_all[] and its name matches the DT label.
    • There are no duplicate offsets or names. t8122_ps_all[] now has 132 words, one for each &pmgr node.
  • checkpatch: scripts/checkpatch.pl -g ae94c46cb333 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 (including apple_sleep_test_words and apple_sleep_test_books).
  • host-tests: not run. No host test or CI script reads sleep-t8122.h.

The J615 row in the body is at the exact head and passes (default boot, s2idle 3/3, deep dry run). The combined committed deep-sleep run listed under "Still to run" is a follow-up. Merging at ae94c46cb333 with a merge commit.

@DjDeveloperr
DjDeveloperr merged commit 30ecf4c into main Dec 2, 2026
@DjDeveloperr
DjDeveloperr deleted the m3uport/t8122-stray-j615-domains branch December 2, 2026 17:52
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.

3 participants