Skip to content

soc: apple: aop: Bound the time a failed start can hold the probe - #547

Merged
RyanTheTide merged 1 commit into
integration/aurorafrom
fix/aop-bounded-probe
Oct 28, 2026
Merged

RyanTheTide merged 1 commit into
integration/aurorafrom
fix/aop-bounded-probe

Conversation

@RyanTheTide

@RyanTheTide RyanTheTide commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

On a J616s warm boot the AOP probe held udev for 56 s. The initramfs could not switch root until it gave up, and the boot came up with no AOP (no microphones, ambient light sensor or lid input).

What happened, from the kernel log:

  • The AOP firmware took 0.37 s to report ready instead of the usual 0.065 s. Until then it does not read its inbound mailbox.
  • One AFK init request found the mailbox full for the whole 500 ms send timeout and failed with ETIMEDOUT. Nothing was logged about which endpoint or step failed.
  • The probe then stopped the endpoints it had already started. It waited the full 5 s for each shutdown acknowledgment in turn, eleven times, and the AOP never answered.

This change:

  • Sends every shutdown request first, then collects the acknowledgments against one 5 s deadline. Once a request finds the mailbox full for the whole send timeout, the remaining requests are skipped.
  • Sends an AFK init request once more when the mailbox was full (the request was never written, so a resend is safe).
  • Logs the endpoint and the step that failed, and a failed RTKit wake.

Worst case for a dead AOP goes from about 56 s to about 6 s.

Testing on the J616s

  • 20 warm reboots on a test kernel with this change, 13 of them issued about 15 s after boot. No hang, AOP bound on every boot, initrd 2.0 to 2.4 s.
  • One of those boots hit the slow firmware start again (ready after 0.51 s). The mailbox was full for an RTKit endpoint start, and the existing RTKit resend got it through, so the AOP came up normally.
  • Builds with no warnings. Clippy reports three failures in older code in this file; soc: apple: aop: Drop the casts clippy rejects #548 fixes those separately.

🤖 Generated with Claude Code

On a J616s warm boot the AOP firmware took 370 ms to come up and one AFK
init request found the mailbox full for the whole 500 ms send timeout.
The probe then stopped the endpoints it had started. It waited the full
five seconds for each shutdown acknowledgment in turn, and the AOP never
answered, so the probe held udev for 56 s. The initramfs could not
switch root until it gave up, and the boot came up without the AOP.

Send every shutdown request first, then collect the acknowledgments
against one five second deadline. Once a request finds the mailbox full
for the whole send timeout, skip the requests that remain.

A full mailbox on an init request means the request was never written,
so send it once more before giving up. Log which endpoint and which step
failed. Until now the probe failed with ETIMEDOUT and nothing said why.

Assisted-by: LLM
Signed-off-by: Ryan Murray <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
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