Repository navigation
accel/ane: add bounded timeout recovery for H13 and owned H14 - #692
RyanTheTide wants to merge 8 commits into
Conversation
Suspend the ANE consumer before its domain suppliers, verify the engine islands actually power off, and restore its runtime PM reference on every exit. Avoid the system-sleep force helpers and speculative retained task-error writes. Keep DMA backing and the exceptional module pin until recovery is verified. Use one deadline across H13 fault drains and H14 command ACK/finish waits. Add an explicit destructive H13 recovery test and a deterministic fixture generator using the licensed public compiler. Document the remaining H14 firmware ownership and stale-ID work; H14 reset remains quarantined. Assisted-by: LLM Signed-off-by: Ryan Murray <[email protected]>
Share the runtime-PM cycle independently of task-manager MMIO and test it against real runtime-PM supplier links. Cover repeated and single-domain cycles, consumer and supplier suspend errors, a missing off acknowledgment and resume failure, including restoration of the caller reference. Assisted-by: LLM Signed-off-by: Ryan Murray <[email protected]>
The packaged tools contain a static libane, so a ctypes test cannot rely on a system shared library. Use the documented ABI 1 buffer and submit ioctls directly. Keep both fds, GEM handles and mappings alive across all three resets, pin both public fixture hashes, and provide device-free container validation before the destructive run. Also depend on DRM_ACCEL for traversal of the PM KUnit test directory. Assisted-by: LLM Signed-off-by: Ryan Murray <[email protected]>
Exercise the malformed convolution with fp16 one inputs so the test requests MAC work rather than relying on an all-zero activation path. The input and weight bytes are deterministic; only the add fixture is used as a numerical oracle. Assisted-by: LLM Signed-off-by: Ryan Murray <[email protected]>
The SET window covers the engine islands but not their SYS_CPU parent. DART suppliers suspend asynchronously after the ANE consumer drops its references. Require every attached genpd, including SYS_CPU, to report off before resuming the consumer; otherwise that resume can race the DART idle work and keep the task-manager register file powered. Use only the genpd provider API and always-accessible PMGR reads. A shared domain that cannot turn off leaves recovery failed and preserves the DMA safety pin. Assisted-by: LLM Signed-off-by: Ryan Murray <[email protected]>
Change the add inputs for each call and poison its 64 logical output lanes before submitting. Zero the unused padding, which need not be written by the engine. Comparing the complete tile with the oracle now rejects a stale completion even when the previous call was correct. Assisted-by: LLM Signed-off-by: Ryan Murray <[email protected]>
Fence commands and buffer creation, stop only the Linux-owned ASC CPU, and power-cycle every domain through the same runtime-PM transaction. Verify the physical PMGR states and repeat the probe access gates before restoring the cached pristine image and the existing fenced boot flow. Require READY/DONE, ChMan validation, host ACK and CONFIG_GET before accepting work again. Unsupported ownership profiles remain quarantined. Retain metadata for closed firmware-visible BOs and old boot/MALLOC arenas. Reclaim old resources only after validated restart; charge retired arenas to the existing limits and bound failed-boot retention. Release the old CPU pin only after quiescence and acquire its replacement before any boot write. The existing domain-link lifetime pin remains. Use opaque kernel program/process IDs, independent of reused firmware wire IDs. Invalidate the cache across restart without resetting the allocator, so clients reload rather than executing a stale identifier. Add KUnit non-reuse/exhaustion checks and matching reset diagnostics. Validated on buildbox: arm64 driver objects and 9/9 KUnit tests in QEMU. H14 silicon qualification is still required; no H14 hardware was changed. Assisted-by: LLM Signed-off-by: Ryan Murray <[email protected]>
|
Three wedges on the M1 Pro (T6000) tonight, all on kernels without this PR (fleet12d, fleet12e), each needed a reboot because Signature each time The same task error with Natural reproducers, in case they help qualify this on silicon
Happy to run the recovery selftest plus reproducer 1 on the M1 Pro when there's a build of this branch for fleet12e. |
Recovery refused to restart whenever TQ_EN bit 13 was set after the partition power cycle, reading it as "task manager still halted". On the M1 Pro that bit is set on every healthy runtime resume as well: TQ_EN reads 0x3000 and TM_ERROR1 0x22222222 each time the engine comes back from autosuspend. So the check failed every recovery and left the engine wedged until reboot. Drop it. The tm/tq register file on T600x also keeps its state through the acknowledged power-off, and through PMGR reset pulses on every ANE domain (ane_sys, sys_cpu, set0, base, set1-4), so a power cycle alone does not clear what a failed task latched. Bring back the retained-state drain for SoCs whose descriptor says the file is retained (T6000/T6001), based on omarchy-ane's ane_tm_drain_retained by Joshua Warren (MIT). Before it was removed, the drain recovered every "-5, finish lines=1" task error seen on the M1 Pro. A wedge the drain cannot clear still fails the idle check and stays wedged, with no reboot loop. Assisted-by: LLM Signed-off-by: Ryan Murray <[email protected]>
|
Silicon result on the M1 Pro (T6000), and a fix pushed as a14c10c. Test kernel 7.3.0-aurora-fleet12e-ane692 = fleet12e plus this branch at 71fa8e9, one-shot booted. Reproducer is the real-weight MobileNetV1 package I mentioned above, which times out on its first submit ( 71fa8e9 as is does not recover. The power cycle works ( The reason is that TQ_EN bit 13 isn't a halt latch on this SoC. A diagnostic build logged TQ_EN on every healthy runtime resume from autosuspend, and it always reads 0x3000 with TM_ERROR1 0x22222222. So the check refuses every recovery. The tm/tq file is also retained through the power-off, which is what the old a14c10c drops that check and brings back the retained-state drain for T600x (based on omarchy-ane's
What the registers did each round: TQ_EN 0x3000 and STATUS 0x0 before the cycle, STATUS back to 0x1 after the power cycle with the error words at their healthy values, TQ_EN 0x0 after the drain, then 0x1000 and idle after re-enable, matching the fresh probe status. About 0.5 ms from failure to recovered. Not re-run on this commit yet: the KUnit set from this PR and T8103. I didn't change the T8103 path apart from no longer refusing on bit 13, which has no evidence behind it there either. Checkpatch strict is clean. The diagnostic logging isn't in the commit. |
accel/ane: H13 recovery without reboot (H13 part of #692, on aurora-wip)
|
Closing as superseded: all eight commits landed in integration/aurora as revised versions with the same subjects (e.g. 5c93b77 'power-cycle runtime PM suppliers after a bounded job timeout', b5ba418 'exercise the recovery PM transaction with KUnit devices', 68e1aee 'restart owned H14 firmware after a command timeout', 51c8db3 'drain the retained task manager on T600x recovery', plus the selftest commits). 92% of this PR's added lines are byte-identical in integration 43c790f; the rest are the revisions. Deleting the head branch fix/ane-hang-recovery (tip a14c10c, no open PR based on it). Overnight merge train, 11-07. |
A timed-out ANE job currently leaves the engine quarantined and its resources pinned until reboot. H13 recovery force-suspends suppliers while their consumer remains active, which can keep parent domains powered; its log incorrectly promises that module reload restores service.
H13 now uses one job deadline across fault drains and a serialized runtime-PM reset: suspend the consumer, finish supplier suspension, require physical PMGR and attached-genpd power-off (including SYS_CPU), resume and re-arm the task manager. The failed job returns its original error. Live BO mappings survive for resubmission; preserved mappings and the exceptional module reference are released only after verified recovery. Speculative retained-error-register writes and the misleading reload message are removed.
The Linux-owned H14 legacy profile stops its owned ASC CPU, cycles domains through genpd, verifies physical power-off, and restores a cached pristine image through the existing fenced boot sequence. READY/DONE, ChMan, host ACK and CONFIG_GET must validate before quarantine clears. Old firmware arenas and closed BOs retain metadata until restart succeeds; existing resource limits still charge retained arenas. Opaque kernel program/process IDs cannot alias reused firmware IDs, so clients reload programs after reset. Borrowed firmware, RTKit mode and later-generation ownership remain fenced. H14's existing active-firmware/domain lifetime references remain; this does not claim normal H14 module unload while firmware is active.
Validation:
Silicon qualification is pending. The M1 Pro experiment awaits exclusive controller approval; no recovery-without-reboot result is claimed yet. H14 restart also needs hardware qualification. This PR remains draft and is not ready to merge.