From 726da3247592dabbede1bc5bb448f34c96b73078 Mon Sep 17 00:00:00 2001 From: Ryan Murray Date: Thu, 19 Nov 2026 22:42:21 +1100 Subject: [PATCH] soc: apple: aop: refuse EPIC calls once the firmware has crashed 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: https://github.com/aurora-silicon/linux/issues/2188 Signed-off-by: Ryan Murray --- drivers/soc/apple/aop.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/soc/apple/aop.rs b/drivers/soc/apple/aop.rs index 38cddac3a30e9..adbc64b9c8757 100644 --- a/drivers/soc/apple/aop.rs +++ b/drivers/soc/apple/aop.rs @@ -962,6 +962,12 @@ impl AFKEndpoint { data: &[u8], ret: Option>, ) -> Result>> { + // A crashed firmware takes no more messages and answers none. Refuse the call before it + // reserves a tag: a tag reserved now is never released, and once they are all gone every + // caller would see "too many inflight calls" instead of the crash. + if client.crashed.load(Acquire) { + return Err(ENODEV); + } if client.epic_v4 && self .calls