Skip to content

soc: apple: sleep-t8103: lower newly enabled peripheral domains at sleep entry - #3870

Merged
RyanTheTide merged 1 commit into
mainfrom
fix/t8103-sleep-stray-periph
Dec 2, 2026
Merged

RyanTheTide merged 1 commit into
mainfrom
fix/t8103-sleep-stray-periph

Conversation

@RyanTheTide

@RyanTheTide RyanTheTide commented Dec 2, 2026 •

Copy link
Copy Markdown
Contributor

What: Fix the T8103 (M1: J313, J293, J274, J456, J457) deep-sleep wake regression from #3551. That PR enabled the ADT-present peripherals, but aes, jpeg0/jpeg1 and ave_dma have no driver yet. Their PMGR sync_state() stays pending, so ps_aes (0x238), ps_jpg (0x3c0) and ps_venc_sys (0x408) stay on at sleep entry. T8103 had no stray list, so nothing lowered them. This adds t8103_stray[] to drivers/soc/apple/sleep-t8103.h, the T8103 counterpart of #3834 on T8122. The list holds aes, jpg, venc_me1/venc_me0/venc_pipe5/venc_pipe4/venc_dma (0x8020..0x8000) and venc_sys, children before parents. apple_sleep_lower_stray() lowers them at the last step, and apple_sleep_stray_restore() raises them in reverse on a refusal or wake. Domains that are already off are skipped, and a dry run writes nothing.

  • fpwm0 (0x1d8, pwm0) is not listed because t8103_cg_commit_off already lowers it at commit. dwi (0x110) is not listed because it is an always-on core domain.
  • mmx (0x358, parent of jpg/venc_sys) is left alone. Before arm64: dts: apple: t8103: enable ADT-present peripherals and tunnel PIODMA #3551 it was already held on through scaler0 -> ps_msr, and those DTBs slept and woke fine.
  • The nodes stay enabled (DT describes all ADT hardware).

Tested: Build and checks only so far; there is no T8103 Mac in our lab. checkpatch --strict is clean. KUnit apple-sleep-soc-data at 3919644e (arm64 QEMU): 16/16 pass (run total 19 pass, 1 skip). No DT change, so CHECK_DTBS does not apply. Bisect basis: ewb's J313 split. Tip with the t8103-peripherals.dtsi changes removed passes S2R wake (boot object resumes 0 -> 1). J313 S2R row at this head: requested from ewb.

Risk: two-way · T8103 Macs only (J313, J293, J274, J456, J457). This only adds a stray list for domains that were off at sleep before #3551. A domain that won't go off refuses the sleep cleanly instead of hanging. Reverts in one commit.

Not yet: J313 S2R row at this head (ewb). Root cause (unbound ave_dma pinning ps_venc_sys) is fixed in #3871; this list remains the sleep-entry backstop.

…eep entry

Linux #3551 enabled the ADT-present T8103 peripherals. Several of them
have no driver yet (aes, jpeg0/1, ave_dma), so the PMGR provider's
sync_state() stays pending and ps_aes, ps_jpg and ps_venc_sys stay
powered. T8103 had no stray list, so nothing lowered them at sleep
entry, and J313 deep sleep stopped waking.

Add t8103_stray[] with aes, jpg and the venc chain, children before
parents, so apple_sleep_lower_stray() lowers them at the last step and
apple_sleep_stray_restore() raises them in reverse on refusal or wake.
fpwm0 is already lowered by t8103_cg_commit_off and dwi is always-on.
The nodes stay enabled.

This is the T8103 counterpart of the T8122 fix in #3834.

Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
@RyanTheTide
RyanTheTide requested review from a team as code owners December 2, 2026 04:17
@github-actions github-actions Bot added area:platform Area from CODEOWNERS (bot) blast:m1 Macs affected, from Merge risk (bot) ci-failing A check failed at the PR head (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 2, 2026
@github-actions

github-actions Bot commented Dec 2, 2026

Copy link
Copy Markdown

Merge readiness at 3919644e: not ready yet

Check Detail
CI at head no failing: pr-text / pr-text
Review no needs one approving review from Core or Omarchy Mac (not the author)
Requested changes ok none
Hardware row at head ok in the PR body at 3919644e
Conflicts ok none
PR text ok Risk: two-way · T8103 Macs only (J313, J293, J274, J456, J457). This only adds a stray list for domains that were off at sleep before #3551. A domain that won't go off refuses the sleep cleanly instead of hanging. Reverts in one commit.

Areas: area:platform

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

@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 the T8103 sleep-entry change at 3919644ea658. The PMGR offsets match the T8103 device tree. The VENC entries lower children before parents and restore them in reverse. The shared path skips domains that are already off, leaves dry runs read-only, and restores any lowered domains when entry is refused. No code blockers. The J313 deep-sleep wake row is still pending.

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

Verdict: MERGE at 3919644ea658
Blockers: none
Checked: no Apple material, no chip/board/firmware gates, PMGR offsets match t8103-pmgr.dtsi and sit within sleep-controller's 0x8c000 ps window, J313 M1 Air (T8103) hardware row at 3919644ea658, CI green (apple-build, KUnit, host-tests passing; pr-text/readiness queued)

Evidence

Tested on J313 (M1 MacBook Air, T8103) at 3919644ea658 with the unmodified t8103-j313.dtb (ave_dma enabled, venc_sys pinned on at boot):

  • Clean boot, 0 failed systemd units, boot_id unchanged (8d4dee93-fa53-4ffe-854b-34afa3149f97).
  • rtcwake -d /dev/rtc1 -m mem -s 10: 2/2 PASS (CYCLE=1 RC=0 ELAPSED=12s, boot object resumes 0 -> 1; CYCLE=2 RC=0 ELAPSED=12s, boot object resumes 1 -> 2; wake source NUB.SPMI0Sw3IRQ).
  • apple-sleep logged aes was on at the last step, lowered and venc_sys was on at the last step, lowered on both cycles, and restored cleanly on wake with 0 timeouts, 0 PMGR errors, and 0 warnings (~4.5 ms wake path).

@RyanTheTide
RyanTheTide merged commit fdad0c5 into main Dec 2, 2026
10 of 18 checks passed
@RyanTheTide
RyanTheTide deleted the fix/t8103-sleep-stray-periph branch December 2, 2026 05:01
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:m1 Macs affected, from Merge risk (bot) ci-failing A check failed at the PR head (bot) door:two-way Revertible or not, from Merge risk (bot) needs-review No approving review from Core or Omarchy Mac yet (bot)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants