Repository navigation
accel/ane: recover a T600x engine after a hang without an event - #1660
Merged
Merged
Conversation
linux#1446 kept a T600x engine wedged until reboot once a job hung without a completion event, because every job after the recovery hung the same way. The task-manager file was thought to survive the power cycle. It does not: after the cycle it reads its reset values (nothing committed, no valid descriptor slot, TM_STATUS idle). The retained-state drain then cleared TQ_EN bit 13 along with the enable bit. That bit reads set after every power-on, and without it the TM never dispatches: the next descriptor stays pending in its queue while TM_STATUS reads idle, so that job timed out too. Clear only the enable bit (12) in the drain; the re-arm sets it again. Before the power cycle, abort the hung queue in the task manager while the engine is still powered: write the queue number with START to the abort register, wait for START to clear, then for the queue to report hardware idle with no descriptor pending, and only then invalidate both descriptor slots, clear the ownership word and restore the queue priority. Every poll reads the DART latch before the engine. A task stalled below the task manager never lets the abort be taken; the power cycle stops it then. The tm_abort parameter (default on) turns the abort off. A hang without an event is recoverable again on T600x. The engine is wedged until reboot only after three recoveries in a row without one completed job. T8103 keeps its single recovery. The drain also cleared only the first descriptor slot, and cleared the ownership word before it. Clear both slots, then the ownership word, as the normal completion path does. Assisted-by: LLM Signed-off-by: Ryan Murray <[email protected]>
The completion-poll harness compiles the production ane_tm.c. Give it the abort-path registers and the recovery counter, and check the new policy: a T600x hang is aborted and recovered, a hang after three recoveries in a row without a completed job wedges the engine, and T8103 keeps its single recovery. Assisted-by: LLM Signed-off-by: Ryan Murray <[email protected]>
This was referenced Nov 12, 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.
A job that hangs on the T6000 Neural Engine (M1 Pro/Max) no longer needs a reboot. The driver recovers the engine and the next job runs.
#1446 kept the engine wedged after a hang without a completion event, because every job after the recovery hung the same way. The task-manager file does not survive the recovery power cycle; it comes back at its reset values (nothing committed, no valid descriptor slot, TM_STATUS idle). The retained-state drain then cleared TQ_EN bit 13 together with the enable bit. Without bit 13 the task manager never dispatches: the next descriptor sits pending in its queue while TM_STATUS reads idle. The drain now clears only the enable bit.
Before the power cycle the driver also tries the per-queue abort: START plus the queue number, then wait for queue idle and a pending count of zero, then clear both descriptor slots and the ownership word. A task stalled below the task manager never lets the abort be taken, and the power cycle stops it instead. The drain now clears both descriptor slots before the ownership word. The engine is wedged until reboot only after three recoveries in a row without a completed job. T8103 keeps its single recovery.
tm_abort=0turns the abort off.Tests