Skip to content

soc: apple: rtkit: give the saved scope's AP IDLE up to 10 s - #2599

Merged
DjDeveloperr merged 1 commit into
integration/aurorafrom
djdev/m5-j714s-rtkit-ap-state-wait
Nov 20, 2026
Merged

DjDeveloperr merged 1 commit into
integration/aurorafrom
djdev/m5-j714s-rtkit-ap-state-wait

Conversation

@DjDeveloperr

@DjDeveloperr DjDeveloperr commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

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 .begin for 120 s.

  • A step trace of the committed SMC notice named the failing step: AP IDLE: -110, 834453 us into the notice, 816318 us in the step.
  • The committed notice then panicked silently. On a clean sleep that step takes ~0.2 ms.
  • The -110 comes from the saved scope's fixed 50000 x 10 us bound (500 ms nominal, 816 ms measured).

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

  • AP IDLE's post and its ack each get up to 1000000 steps (10 s nominal, ~16 s measured).
  • AP ON, sent from .finish with interrupts on, keeps 500 ms. So do the other saved-scope messages.
  • A post or ack over 5 ms is logged with its count, and so is a failure.
  • An SMC that never answers still fails the notice, only later. The 64-entry deferred kfifo can still fill (-ENOBUFS).

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

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
DjDeveloperr force-pushed the djdev/m5-j714s-rtkit-ap-state-wait branch from 097e29a to 36d2d18 Compare November 20, 2026 20:03
@DjDeveloperr DjDeveloperr changed the title soc: apple: rtkit: give the saved scope's AP power state up to 10 s soc: apple: rtkit: give the saved scope's AP IDLE up to 10 s Nov 20, 2026
@DjDeveloperr
DjDeveloperr merged commit b1301be into integration/aurora Nov 20, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant