Repository navigation
soc: apple: sleep: Skip T6020 SEP PS_ACTUAL poll when AUTO_ENABLE is set - #4218
Conversation
On T6020 deep-sleep wake, t6020_sleep_wake() restores T6020_PSE_SEP with its saved PS_AUTO_ENABLE bit (0x1000030f on J414s/J414c). Under PS_AUTO_ENABLE, PMGR power-gates SEP while the enclave idles so PS_ACTUAL stays 0 until SEP wakes, causing the 500 ms interrupts-off poll for PS_ACTUAL == 0xf to time out with -ETIMEDOUT (-110) on every wake. Skip the PS_ACTUAL poll when PS_AUTO_ENABLE is set in the restored word, and keep the existing poll when PS_AUTO_ENABLE is clear. Signed-off-by: DjDeveloperr <hey@djdev.me>
|
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.
No blocking findings at b9bff74. The branch checks the word written to SEP, so it skips the poll only when automatic gating is enabled. The existing bounded poll still runs with that bit clear. Both paths record the register readback for diagnostics.
The J414s row covers this change. The tested image and the merge with main 24970e1 have identical sleep.c and sleep-t6020.h. #4200 changes only the NCO clock driver. Both committed wakes completed without the SEP timeout, and the trusted-key round trip confirmed the enclave was responsive.
Clang W=1 built sleep.o without warnings, and strict checkpatch passed.
What
Follow-up #1 from #3999 review (
6175485736).On T6020 deep-sleep wake,
t6020_sleep_wake()restoresT6020_PSE_SEPwith its savedPS_AUTO_ENABLEbit (0x1000030fon J414s). BecausePS_AUTO_ENABLElets PMGR power-gate SEP while the enclave idles,PS_ACTUALreads0until SEP wakes, so the 500 ms interrupts-offreadl_poll_timeout_atomic()waiting forPS_ACTUAL == 0xftimed out with-ETIMEDOUT(-110) on every wake.Skip the
PS_ACTUALpoll whenPS_AUTO_ENABLEis set in the restoredT6020_PSE_SEPword (recordingsep_ret = 0and reading backsep_woke), and preserve the existing poll whenPS_AUTO_ENABLEis clear.Tested
Tested: J414s (T6020) PASS at
b9bff7416310in a combined kernel with #4200. Two committed deep sleeps, zero SEP wake timeouts, and a successful SEP trusted-key round trip.scripts/checkpatch.pl --strict: 0 errors, 0 warnings, 0 checks.ARCH=arm64 LLVM=1 W=1 drivers/soc/apple/sleep.o: 0 warnings.Mac14,9, T6020, OS firmware 27.2,m1n1/boot.binsha256196da4c690882ac64a70932e2dbb5affa0828e533117c975633e1b6705a9bd38):7.3.0-j414s-sepwake+(90292a6e3345=b9bff7416310onmain 2eceb1f24262+#4200 ae343b883fba, Image sha256f6fc5123ed564817f15264ffc15fd4374cfcde6ac3292b33a15b5a9f18038e6c)c4ceb0f5-34b0-45db-8d31-b4320fdd20aes2idle(15 s, defaultappledrm.s2r_untested=Y) + 2× committed deep sleeps (100 s+30 s,suspend_stats/success=3 fail=0,boot object resumes 0 -> 1 -> 2):100 s):T6020: halted 0x19, held stuck 0, macOS-off stuck 0, clusters stuck 0x0, sep 0x1000030f at the commit; clusters E 0xf P0 0xf P1 0xf, 26 words back (5 left), sep 0x1000030f (0)30 s):T6020: halted 0x19, held stuck 0, macOS-off stuck 0, clusters stuck 0x0, sep 0x1000030f at the commit; clusters E 0xf P0 0x2f P1 0x2f, 28 words back (5 left), sep 0x1000030f (0)-110timeouts across both wakes (previouslysep 0x1000030f (-110)on every wake).apple_sep 396400000.sep: the enclave is back from its sleep requeston both wakes;diag/{xart=enabled,keystore=open,trusted=ready,xart_guard_refusals=0,xarm_failures=0};keyctltrusted-key seal/unseal round-tripSEAL_UNSEAL_OK bytes=226.apple-panel-bl actual=117/500,card1-eDP-1 connected/enabled/On,kwin_waylandactive3024x1964framebuffer.plughw:AppleJ414,0, 2.0 s digital silence):48 kHz2.193 -> 2.195 -> 2.204 s,44.1 kHz2.070 -> 2.097 -> 2.084 s(rc=0).4442 us/3018 us,pending=0, 0 GPU/MMU/RTKit faults.00 -> 02 -> 00; Wi-Fi ping 3/3 (0%loss) after every cycle.work/j414s-sepwake-20261203/(SHA256SUMS).Risk
Two-way · T6020 Macs. Scoped strictly to
t6020_sleep_wake()indrivers/soc/apple/sleep-t6020.h; ifPS_AUTO_ENABLEis clear in the restored word, the existingreadl_poll_timeout_atomic()path runs unchanged.Not yet