Skip to content

soc: apple: aop: refuse EPIC calls once the firmware has crashed - #2342

Closed
RyanTheTide wants to merge 1 commit into
integration/aurorafrom
isw/aop-crashed-refuse-calls
Closed

RyanTheTide wants to merge 1 commit into
integration/aurorafrom
isw/aop-crashed-refuse-calls

Conversation

@RyanTheTide

@RyanTheTide RyanTheTide commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Refs #2188 (the driver side after an AOP crash; the crash itself is not addressed here)

After RTKit reports the AOP crashed, every EPIC call still reserved a tag on its endpoint before rtkit refused the doorbell ("Device is crashed, cannot send message"). The call was then marked abandoned, keeping its tag until a reply arrives, and a crashed firmware never replies. After about eight calls the table was full, and every later call failed with "Too many inflight calls on endpoint 34". The result was the same, but the log no longer named the crash, and clients saw EIO from a full table.

epic_notify() now checks the crash flag before it reserves anything and fails the call with ENODEV, as calls already fail while the transport is closing. Clients such as the speaker service's pw1/pwrd/idle requests and the sensors report ENODEV for as long as the firmware stays down. No firmware message, power sequence or speaker-protection path changes, and the change applies to every AOP the driver binds.

Evidence

  • Base integration/aurora 0abc2f3. arm64 LLVM=1 build of drivers/soc/apple/, drivers/gpu/drm/asahi/ and drivers/media/platform/apple/avd/ with the fleet config (DRM_ASAHI=m with G15/G16/G18/M5, APPLE_AOP=m; rustc 1.97.1, bindgen 0.73.2): rc 0, and no error or warning in the changed file.
  • checkpatch.pl --strict: 0 errors. The only warnings are about the Co-Authored-By trailer form.

Not run on hardware. This needs an AOP crash to observe; the expected log after one is spkr pw1 failed: ENODEV on every later request, and no "Too many inflight calls".

Assisted-by: LLM (Claude:Opus 5.5)

After RTKit reports the AOP crashed, every EPIC call still reserved a
tag on its endpoint before rtkit refused the doorbell ("Device is
crashed, cannot send message"). The call was then marked abandoned, to
keep the tag until its reply arrives, and a crashed firmware never
replies. After about eight calls the endpoint had no free tag and every
later call failed with "Too many inflight calls on endpoint 34". The
result was the same, but the log no longer said the firmware was dead,
and the client errors changed from the crash to EIO from a full table.

Check the crash flag before a call reserves anything, and fail it with
ENODEV, as calls already fail while the transport is closing. EPIC
clients (the speaker service's pw1/pwrd/idle requests, the sensors) now
report ENODEV for as long as the firmware stays down, and no tag is used
up.

This does not change the crash itself, nor any AOP firmware or speaker
power sequence.

Link: #2188
Signed-off-by: Ryan Murray <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
@RyanTheTide

Copy link
Copy Markdown
Contributor Author

Blockers: 1.

  1. Commit d9a4dea carries Co-Authored-By: Claude Opus 5.5 <[email protected]> (checkpatch flagged the trailer, as the body says). Please re-commit with only the human Signed-off-by. The PR body's Assisted-by line is the right place for that credit.

The code is correct. drivers/soc/apple/aop.rs:943 reads crashed before any slot or tag is reserved and before write_entry(), so a crashed AOP no longer fills the call table. crashed is only ever set (:2870) and the struct comment says nothing restarts the firmware, so a stale flag can't refuse calls to a live AOP. The window between the check and send_message() (:1012) is no wider than before: if a crash lands there, it costs at most one abandoned tag. Both callers (epic_call :2174, epic_call_ret :2201) already return ENODEV on transport_closing, so clients see the same errno they get at teardown. On epic_v4 the first abandoned slot already refused later calls with EIO, so the gain there is a clearer errno. On v2 the change also stops the table from filling.

HW row: Neo (J700) on this head with the AOP crash that #2188 tracks (it shows up in some first deep-sleep cycles; loop s2idle/deep until an AOP crash is logged). Pass: after "AOP firmware crashed", every later EPIC client error is ENODEV, there are 0 "Too many inflight calls" lines, and the next suspend logs "sleeping without it". Also 0 AVC, 0 failed units and no new kernel errors on a boot with no crash.

Assisted-by: LLM (Claude:Opus 5.5)

@RyanTheTide

Copy link
Copy Markdown
Contributor Author

Replaced by #2800: the same changes with the commit trailers fixed, on the current integration/aurora.

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