Repository navigation
soc: apple: rtkit: give the saved scope's AP IDLE up to 10 s - #2599
Merged
DjDeveloperr merged 1 commit intoNov 20, 2026
Merged
Conversation
On the J714s (M5 Pro), about one deep sleep in thirty to fifty entered some 40 s after a Type-C event on the Dell monitor's port hung: the machine stayed silent until the sleep watchdog, armed at the sleep's begin for 120 s, reset it. A step trace of the committed SMC notice on the DockChannel named the step: the SMC took MBSE = slpa and the message drain, then AP IDLE: -110, 834453 us into the notice, 816318 us in the step and the committed notice's panic followed, silent with panic=0 and the consoles suspended. On a clean sleep AP IDLE and the drain after it take about 0.2 ms. The -110 is the saved scope's fixed bound of 50000 steps of 10 us (500 ms nominal, 816 ms as measured) on posting the AP power state or on its ack. Those hangs all ran without commit ac2079f ("soc: apple: rtkit: echo log words on the saved lane"), which this tree has: the SMC holds back AP IDLE's ack while a syslog record word or OSLOG counter on the saved lane goes unechoed, and the saved poll used to defer those words unanswered. That is the cause. This is margin behind it: AP IDLE's post and its ack now each get up to 1000000 steps (10 s nominal, about 16 s as measured), so an SMC that answers late for any other reason gives a slow sleep instead of a halt. AP ON, which the wake sends from .finish with interrupts on, keeps the 500 ms bound, as do the other saved-scope messages. A post or an ack that takes more than 5 ms is logged with its count, and a failure with its count too. A longer wait does not change two other ends: an SMC that never answers still fails the notice (after ~16 s rather than ~0.8 s), and the deferred kfifo of SMC-endpoint messages (64 entries) can still fill over a long wait, which fails the poll with -ENOBUFS. Tested on the J714s, with the J714s macOS sleep entry, on a tree without ac2079f: 22 logind deep sleeps each entered 40 s after a replug of the Dell's port, 0 hangs (2 hangs in 55 such sleeps before). No AP IDLE post or ack was slow in those sleeps, so the longer bound was not needed there. Signed-off-by: Diljit Singh <hey@djdev.me> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
DjDeveloperr
force-pushed
the
djdev/m5-j714s-rtkit-ap-state-wait
branch
from
November 20, 2026 20:03
097e29a to
36d2d18
Compare
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.
J714s (M5 Pro) deep sleep: a late AP IDLE ack from the SMC should give a slow sleep, not a silent halt. This is margin behind the real fix.
The hang: about 1 in 30-50 sleeps entered ~40 s after a Type-C event on the Dell's port hung until the sleep watchdog reset the machine. The watchdog is armed at
.beginfor 120 s.AP IDLE: -110, 834453 us into the notice, 816318 us in the step.The cause is already fixed in this tree. Every one of those hangs ran without ac2079f ("soc: apple: rtkit: echo log words on the saved lane", via #2445). The SMC holds back AP IDLE's ack while a syslog/OSLOG word on the saved lane goes unechoed, and the old saved poll deferred those words unanswered. This PR is margin behind that fix.
What changes
.finishwith interrupts on, keeps 500 ms. So do the other saved-scope messages.Testing (M5 Pro), on a tree without ac2079f, with the J714s macOS sleep entry: 22 logind deep sleeps, each 40 s after a replug of the Dell's port. 0 hangs, against 2 in 55 before. No AP IDLE was slow, so the longer bound wasn't exercised.
Review: independent review done. AP ON is back to 500 ms and the watchdog wording is corrected, per its findings.
Independent of the tipd PRs (#2597, #2598, #2601, #2600).
🤖 Generated with Claude Code