Repository navigation
soc: apple: sleep, rtkit-helper: keep WAKE_SLP_DDR up for adopted DRAM buffers on T8112 - #3774
Conversation
When #3647 merged main (cdbecbe), apple,t8112-sleep remained in the if-condition that main had narrowed to derived profiles (T8142 and T8122), causing apple_sleep_test_known_profiles to expect soc->derived == true and soc->untested == false for T8112. Check apple,t8112-sleep in its own branch with soc->untested == true while leaving the derived-profile checks for T8142 and T8122 intact. Signed-off-by: Satya Benson <[email protected]>
Add a refcounted apple_sleep_coproc_slp_ddr() voter alongside the existing USB voter so an always-on coprocessor that retains DRAM buffers across system sleep can vote for WAKE_SLP_DDR bit 0. Gate coprocessor votes on a per-SoC capability flag (coproc_slp_ddr) set when sleep_slp_ddr_bind() maps WAKE_SLP_DDR, so SoCs whose live coprocessors already survive full DRAM-off deep sleep (T8132, T8140, T8142) keep their existing behavior unchanged. Votes recorded before apple-sleep probes are applied when sleep_slp_ddr_bind() runs, and both deep_once and crashed-coprocessor overrides continue to clear bit 0. Add a KUnit test covering deferred binding, per-SoC gating, refcounting, USB OR-ing, deep_once and crash overrides. Signed-off-by: Satya Benson <[email protected]>
When a boot stage hands over a running RTKit session via apple,rtkit-handoff whose retained buffers live in reserved DRAM outside on-chip SRAM, the coprocessor remains running across system sleep and requires DRAM retention on SoCs whose sleep engine drops DRAM power. Record whether the inherited buffer inventory placed any buffer in reserved DRAM (only after the full inventory validates) and register a devm-managed apple_sleep_coproc_slp_ddr() vote when adopting the session. Sessions whose buffers all sit in SRAM, or cold-started helpers without a live handoff, do not vote. Add KUnit coverage for SRAM-only, DRAM-only, mixed and failed-inventory rollback tracking of dram_buffers. Signed-off-by: Satya Benson <[email protected]>
T8112 uses its own map_regs callback and never bound sleep_slp_ddr_word to wake + WAKE_SLP_DDR (0x00). On a T8112 laptop with an adopted live MTP session retaining DRAM buffers behind its bypass DART, committing deep sleep with WAKE_SLP_DDR clear drops DRAM power out from under the running MTP and hangs the commit until the watchdog resets. Bind sleep_slp_ddr_word in t8112_sleep_map_regs() and enable coproc_slp_ddr on t8112_sleep_soc so an adopted helper with DRAM buffers sets WAKE_SLP_DDR bit 0 while boards without one (such as T8112 desktops or boots without a live DRAM handoff) leave bit 0 clear for full DRAM-off deep sleep. Signed-off-by: Satya Benson <[email protected]>
|
Exact-head J413 hardware verification row at
|
RyanTheTide
left a comment
There was a problem hiding this comment.
The vote is taken after the retained-buffer inventory is validated, released with the device, and applied only where the sleep profile supports it. The exact-head J413 row preserved MTP across five deep sleeps. The sleep and RTKit helper KUnit results cover the voter and the corrected T8112 profile.
|
Merge readiness at
Areas: Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels. |
|
Additional 50-cycle J413 reliability row at exact head
|
|
J473 row at
|
|
Merging at |
What: Keep
WAKE_SLP_DDRbit 0 asserted across deep sleep on T8112 when an adoptedapple,rtkit-handoffsession retains DRAM buffers (such as live MTP on J413 under firmware 27.2), without changing full DRAM-off deep sleep on boards without a live DRAM handoff or on newer SoCs (T8132, T8140, T8142).soc: apple: sleep: fix T8112 expectation in known_profiles KUnit test— restoresapple_sleep_test_known_profilesforapple,t8112-sleepafter#3647mergedmain(cdbecbe2e04a).soc: apple: sleep: support coprocessor SLP_DDR voters— adds refcountedapple_sleep_coproc_slp_ddr(bool up)alongside the USB voter, gated on a per-SoCcoproc_slp_ddrcapability flag applied insleep_slp_ddr_bind(), with KUnit coverage (apple_sleep_test_slp_ddr_voters).soc: apple: rtkit-helper: vote SLP_DDR for adopted DRAM buffers— tracks whether an adoptedapple,rtkit-handoffinventory places any buffer in reserved DRAM (set atomically only after full inventory validation) and registers adevm-managedapple_sleep_coproc_slp_ddr()vote, with KUnit coverage (rtkh_inherit_dram_buffers).soc: apple: sleep: wire SLP_DDR vote word on T8112— callssleep_slp_ddr_bind(s)int8112_sleep_map_regs()and sets.coproc_slp_ddr = trueont8112_sleep_soc.Tested: arm64 QEMU KUnit at
f27ce29f2ecad: combined sleep + rtkit-helper config 56 passed, 1 skipped (apple-sleep-soc-data16/16 includingapple_sleep_test_known_profilesandapple_sleep_test_slp_ddr_voters,apple-rtkit-helper37/37 includingrtkh_inherit_dram_buffers,apple_mbox_g17_stall3/3); standalonertkit-helper.kunitconfig(CONFIG_APPLE_SOC_SLEEP=n) 40 passed, 1 skipped. Exact-headf27ce29f2ecadJ413 M2 Air hardware row (macOS 27.2 stub, live MTP with 4 retained DRAM buffers, normal wake mask,apple_sleep.deep=1): PASS 5/5 consecutive 10 s deep sleeps (boot object resumes 0 -> 5,wake source: NUB.SPMI0.SW3, keyboard/trackpadkb=2every cycle, GPU Borealis render pass before and after, Wi-Fi intact, 0 failed units). Prior 180 s live-MTPWAKE_SLP_DDRdrain measurement on the same voter: 0.451 W battery drain.Risk: two-way · T8112 (shared
sleep.candrtkit-helper.cvoter paths are gated oncoproc_slp_ddr, so T8132, T8140 and T8142 keep full DRAM-off deep sleep unchanged, and T8112 boards without live DRAM handoff leaveWAKE_SLP_DDRbit 0 clear).Not yet: J473 desktop row at this head (expected
WAKE_SLP_DDR=0unchanged); ~50-cycle deep-sleep reliability row before lifting T8112 out ofuntested.