Repository navigation
t8140-sleep: take the deep path when an SLP_DDR wake would stall (camera ran, AOP crashed) - #1358
Closed
DjDeveloperr wants to merge 7 commits into
Closed
DjDeveloperr wants to merge 7 commits into
DjDeveloperr wants to merge 7 commits into
Conversation
…ugh sleep crashed The AOP keeps running through a sleep, and SLP_DDR is the state that keeps DRAM up for it. After its firmware crashed during a deep sleep, the next sleep, which kept DRAM up, never came back: the SoC reset 5 s after the alarm, inside the sleep engine's own wake, before any core ran. The deep path doesn't need the AOP and returns. Nothing restarts a crashed AOP short of a reboot, so from its crash on the sleep DDR word stays clear and every sleep takes the deep path. RTKit now reports every firmware crash to the sleep controller. One it stops and restarts around each sleep doesn't run through it and is left alone. Signed-off-by: Diljit Singh <hey@djdev.me>
… the camera ran After a camera capture, the next sleep that kept DRAM up (SLP_DDR) never came back: the SoC reset 5 s after the alarm, inside the sleep engine's own wake, before any core ran. It did so 6 of 6 times, with the capture seconds or about 50 s before the sleep, and whether the ISP firmware was stopped at the sleep or long before it. Without a capture, SLP_DDR wakes returned 70 of 70 on the same kits. A deep sleep rebuilds whatever the ISP leaves, as it does the state a boot leaves, and every SLP_DDR sleep after it returns. So the ISP's firmware start clears the same flag the first deep wake sets: the next sleep goes deep, and SLP_DDR applies again from its wake. It costs one USB hub reset after a camera session. Signed-off-by: Diljit Singh <hey@djdev.me>
…roc-crash Moves the deep-path rules onto the generic sleep driver, with the stack below it and integration/aurora 15f88e1. The three conflicts in sleep.c take this branch's code as written; the next commit moves it to the new names. RTKit's crash report also lands in integration's new crash path. Signed-off-by: Diljit Singh <hey@djdev.me>
The rules that send a sleep deep after a coprocessor crash or a camera start were written against t8140-sleep.c. Move them to the renamed driver's names: apple_sleep, apple_sleep_coproc_find(), and the sleep_slp_ddr_* state and lock. No functional change against the rules on the old driver. Signed-off-by: Diljit Singh <hey@djdev.me>
DjDeveloperr
changed the base branch from
fix/t8140-debug-port-select
to
feat/apple-soc-sleep-generic
November 9, 2026 18:17
…roc-crash Brings in #1208's aop-bootargs host test fix. No conflicts. Signed-off-by: Diljit Singh <hey@djdev.me>
Signed-off-by: Diljit Singh <hey@djdev.me>
This was referenced Nov 9, 2026
Closed
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #1310 (
fix/t8140-debug-port-select). Two ways a sleep that keeps DRAM up (SLP_DDR) never came back on the Neo: the SoC reset 5 s after the alarm, inside the sleep engine's D->M wake, before aura or Linux ran. A deep sleep returns in both cases, so each now takes the deep path when it would stall.After the camera ran. A capture since the last deep wake made the next SLP_DDR sleep stall 6 of 6 times: right after the capture, ~50 s after it, and whether the ISP firmware was stopped at the sleep or at the end of the stream. A failed camera start counts too. SLP_DDR wakes without camera use returned 70+ of 70+. The ISP's firmware start now clears the same flag the first deep wake sets, so the next sleep goes deep and SLP_DDR applies again from its wake. It costs one USB hub reset after a camera session.
After a coprocessor that runs through a sleep crashed. The AOP firmware sometimes crashes during a sleep (
RTKit: Message to undiscovered endpoint 0x01,co-processor has crashed: crash log buffer ... not mapped). After one during a deep sleep, the next, DRAM-kept sleep stalled. SLP_DDR keeps DRAM up for the AOP, and nothing restarts it short of a reboot, so after such a crash every later sleep takes the deep path. RTKit now reports each firmware crash to the sleep controller. Coprocessors the controller stops and restarts around each sleep (DCP, ANS, GPU) are left alone.Tested on the Neo (J700), #1310 + #1313 + this, stage2-14, production policy (first sleep deep), 30 s PMU RTC sleeps:
310c00000.aop crashed: later sleeps take the deep path, and sleeps 2 and 3 went deep and returned.Not fixed here:
STREAMON ... Timer expired, then -EIO until reboot) after a capture, a deep sleep and a DRAM-kept sleep.🤖 Generated with Claude Code