Repository navigation
Conversation
m0d16l14n1
added a commit
to m0d16l14n1/linux
that referenced
this pull request
Nov 15, 2026
RyanTheTide: accel/ane: h17: recover a hung engine and retry a failed boot With aurora-silicon#1863 (idle park) kept: the idle park leaves the engine alone while a hung-request recovery is queued or running. aurora-silicon#1303 is not taken (aurora-silicon#1768 carries its retry).
The H17 engine stays off until its first request and is parked again after each system sleep, but once a request has brought it up it stays powered for the rest of the boot: ANE_SYS, the engine and its DARTs keep drawing power until the next sleep. macOS keeps the ANE off whenever it has no client. After idle_park_ms (5 s by default, 0 disables it) with no request, take the way down a system sleep takes: close the session and wait for requests in flight, stop the firmware and power the engine off, then mark it parked as after a wake. The next request boots it from the preload and replays every open program, the path a wake already uses. An execute cancels the timer and its end rearms it; a system sleep cancels a pending park and parks the engine itself. Leave the session closed while parked, as a wake from system sleep does, and wake the requests that waited out the park so they wake the engine. A program closed while parked is then deferred: the wake reopens the session after the cold boot, and the deferred close finds its program lost to the new firmware and only releases its memory, with no firmware traffic. Reopening the session with the engine off would let a close send TERMINATE to it: the transport fails that with -EBUSY and the session is quarantined for good, since the hung-request recovery does not touch a parked engine. Outside a system sleep there is no deep path to fall back on, so a firmware stop that fails quarantines the engine, as a failed sleep does without one. Assisted-by: LLM
niteria
force-pushed
the
ane/h17-idle-park
branch
from
November 19, 2026 03:57
6eda4a2 to
74eccdd
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.
After its first request the H17 ANE stays powered until the next system sleep: on a J700,
ane_sys, the engine and its three DARTs were still on 10 minutes after the last request. Between boot and the first request, and after each wake, the engine is already parked, as macOS keeps it whenever it has no client.This parks it after
idle_park_mswithout a request (default 5000,0turns it off), with the sequence a system sleep already uses:ane_h16_session_sleep(true), which waits only for requests in flight (s->active), not open programs. If a ring still has something pending, it reopens and rearms.clean_stop), powers the engine down, and marks it parked as after a wake. The next request takes the existingane_fw_session_wake()path: cold boot from the preload and replay of every open program.-EBUSY, and quarantined the session for good, because recovery skips a parked engine. camera-denoise hit this when a client kept its program loaded through an idle gap and then switched formats.PM_SUSPEND_PREPAREcancels a pending park (cancel_delayed_work_sync), and the sleep then parks the engine itself.ane_fw_sleep_prepare()(backend lock, then session lock). None of the session callbacks that run under the session lock take the backend lock.Testing
J700 (MacBook Neo, T8140), Aura 1.0.0b9, integration 1d2ef21 plus this commit, ANE built in. The program is an H17 elementwise add (1024 fp16 lanes) from mil-hwx-compiler, run through
tools/testing/selftests/drivers/ane/ane-run.py. The loaded-program test used a local copy with a pause between runs.ane_sys, engine and DARTs off.idle_park_ms=0, then5000The session-closed-while-parked change was folded in afterwards. KUnit passes (246/246), and so does a W=1 build of
drivers/accel/ane/with the Neo config, but KUnit doesn't build the park path. On 2026-11-19 it ran on the J700. That kernel had this PR's change (same patch-id as this head) on top of #1768 (hang recovery), a local non-contiguous allocation change and the address-space fix in #2240.No new kernel errors.
Open questions
ane_fw_ps_off()falls back toapple_sleep_request_deep_once()when a power word stays BUSY after the unlatch. Outside a system sleep that flags the next sleep as deep and returns success, so an idle park would report success with a stuck word, and the next request's power-up would fail into quarantine. That fails safe, but I haven't hit it: the words read clear since 992923c. Should the idle path treat a stuck word as a failure instead?ane_fw_cold.c. I'm happy to rebase onto it.ane_fw_power_down()still logs "powered down for system sleep" on an idle park; the next line says it was an idle park.The commit has
Assisted-by: LLMand noSigned-off-byyet. niteria will add the sign-off before this leaves draft.🤖 Generated with Claude Code