Repository navigation
accel/ane: t6021: boot the firmware after system resume, not inside it - #2138
Merged
Merged
Conversation
On the T8112 (M2) the ANE firmware cold boot in ane_t6021's system resume takes about 1.2 s, which is nearly all of the machine's device resume time: on a J413 every s2idle wake spent 1.29 s in "PM: resume devices", 1.20 s of it in ane_t6021's platform_pm_resume. Resume now only queues the existing freezable restart work, the same one an aborted suspend already uses. The work boots the firmware once user space runs, and a client that submits first finishes the restart itself through ane_rtclient_admit(), as before. The power cycle stays limited to a CPU whose domain did not go off during the sleep; a cold CPU boots directly, as the inline path did. Probe holds a runtime PM reference for the firmware lifetime, so the domains stay up between resume and the work. Measured on a J413 (fleet74 kernel, patched module): resume devices 1.29 s -> 0.104 s over four s2idle wakes; ANE inference results are unchanged after each wake. Co-Authored-By: Claude Opus 5.5 <[email protected]>
With the firmware boot moved out of system resume, the restart a sleep leaves behind finishes with user space running, and the wedged attribute counted it as a wedge for ~1.2 s after every wake: the transaction raises recovering at suspend and clears it only when the new firmware is up, and ane_t6021_pm_restart_deferred() marked the device FAILED while the boot ran. A tool that checks wedged before submitting gave up on a healthy engine. A pending sleep restart is not a wedge: the first client finishes it in ane_rtclient_admit() before any command is accepted. So wedged no longer counts recovering while that restart is pending, the pending flag is cleared only after the deferred boot, and the device stays SUSPENDED until the restart's outcome is known, becoming FAILED only when it fails. Submitters still wait on the firmware mutex the restart holds. The kunit case checks the state the restart callback sees. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This was referenced Nov 17, 2026
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.
What this does
On the T8112 (M2),
ane_t6021's system resume cold-boots the Neural Engine firmware inline, which takes about 1.2 s. That is nearly all of the device-resume time on a J413: every s2idle wake spent 1.29 s inPM: resume devices, andane_t6021'splatform_pm_resumetook 1.20 s of it (pm_print_times).ane_rtclient_admit(), as before. The power cycle is still limited to a CPU whose domain stayed on through the sleep; a cold CPU boots directly, as the inline path did. Probe holds a runtime-PM reference for the firmware lifetime, so the domains stay up between resume and the work.wedgedattribute read it as a wedge for about 1.2 s after every wake: the restart transaction raisesrecoveringat suspend, andane_t6021_pm_restart_deferred()marked the device FAILED while it booted. Nowwedgedignoresrecoveringwhile a sleep restart is pending, the pending flag is cleared only after the boot, and the device stays SUSPENDED until the restart's outcome is known (FAILED only on failure). Submitters still wait on the firmware mutex the restart holds.Tested
J413 (M2), production kernel 7.3.0-aurora-fleet74 with
ane_t6021built from the same source plus these two commits, loaded on a one-shot boot (modprobe.blacklist=ane_t6021, theninsmod):PM: resume devices took(rtc s2idle)pm_test=devicesabort (CPU domain stayed on, so a power cycle first).wedgedstayed 0. No deferred-restart failures, sequence errors or DART faults, 0 AVC denials.wedgedbefore submitting skipped the engine for about 1.2 s after each wake. The second commit fixes that.ane_t6021_pm_test(UML): 16/16 pass (ane-pm-recovery 6, ane-h14-sleep 7, ane-fw-ids 3). New check: the state the deferred restart callback sees is SUSPENDED.--strictclean; W=1 clean on the changed files (arm64, LLVM).🤖 Generated with Claude Code