Repository navigation
soc: apple: sleep-t8103: lower newly enabled peripheral domains at sleep entry - #3870
Conversation
…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>
|
Merge readiness at
Areas: Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels. |
DjDeveloperr
left a comment
There was a problem hiding this comment.
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
left a comment
There was a problem hiding this comment.
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_idunchanged (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 sourceNUB.SPMI0Sw3IRQ).apple-sleeploggedaes was on at the last step, loweredandvenc_sys was on at the last step, loweredon both cycles, and restored cleanly on wake with 0 timeouts, 0 PMGR errors, and 0 warnings (~4.5 ms wake path).
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/jpeg1andave_dmahave no driver yet. Their PMGRsync_state()stays pending, sops_aes(0x238),ps_jpg(0x3c0) andps_venc_sys(0x408) stay on at sleep entry. T8103 had no stray list, so nothing lowered them. This addst8103_stray[]todrivers/soc/apple/sleep-t8103.h, the T8103 counterpart of #3834 on T8122. The list holdsaes,jpg,venc_me1/venc_me0/venc_pipe5/venc_pipe4/venc_dma(0x8020..0x8000) andvenc_sys, children before parents.apple_sleep_lower_stray()lowers them at the last step, andapple_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 becauset8103_cg_commit_offalready lowers it at commit.dwi(0x110) is not listed because it is an always-on core domain.mmx(0x358, parent ofjpg/venc_sys) is left alone. Before arm64: dts: apple: t8103: enable ADT-present peripherals and tunnel PIODMA #3551 it was already held on throughscaler0->ps_msr, and those DTBs slept and woke fine.Tested: Build and checks only so far; there is no T8103 Mac in our lab.
checkpatch --strictis clean. KUnitapple-sleep-soc-dataat3919644e(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 thet8103-peripherals.dtsichanges 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_dmapinningps_venc_sys) is fixed in #3871; this list remains the sleep-entry backstop.