Skip to content

accel/ane: power off a T8112 ANE CPU left busy by a hung job - #1693

Merged
RyanTheTide merged 1 commit into
integration/aurorafrom
fix/ane-t8112-hung-job-stop
Nov 12, 2026
Merged

RyanTheTide merged 1 commit into
integration/aurorafrom
fix/ane-t8112-hung-job-stop

Conversation

@RyanTheTide

Copy link
Copy Markdown
Contributor

A hung ANE job on T8112 (M2) left the ANE CPU busy. RUN clear never brought STOPPED, so the driver kept the instance quarantined until reboot and refused every system sleep for the rest of the boot. This change powers the busy CPU and the engine domains off through genpd (children first, DARTs and ane_sys held powered), requires every PMGR word to read back off and the cold CPU to read STOPPED, and boots the firmware again. A live CPU power-state reset is never used, because it resets the SoC.

  • ane_t6021_lifetime.h: halt returns ANE_T6021_ASC_BUSY for a busy core; restart_stop() hands it to an optional contain step for unplanned stops only.
  • ane_t6021_rtclient_main.c: contain step (extra hung_settle_ms wait, PMGR word log), DART hold around the busy power cycle, system sleep: a quarantined instance takes an unplanned stop and is restarted on resume, and a failed device with a busy core no longer refuses sleep. hung_stop (0644, default 1) and hung_settle_ms (default 100) parameters.
  • KUnit: restart_busy_core_test (contain on unplanned only, refused contain, disabled contain, missing contain step, non-busy halt failure, sleep stop).

Results

M2 (J413), kernel 7.3.0-aurora-fleet67st1 = fleet67 + #1680 + this change, SELinux enforcing, deliberate hang r6-L00, good jobs dw-k3-s2-14 and full-relu:

before (fleet67 + #1680) after
hung job quarantined until reboot 12/12 contained, no SoC reset, CPU still busy after a 20 s extra wait
recovery none 11 at the timeout (about 1.2 s), 1 by the next s2idle (hung_stop=0 case)
s2idle after a hang refused (-16, then -110) 10/10 hang then s2idle rc 0
s2idle overall 39/39 rc 0, 4 pm_test=devices aborts in between, 0 refused, 0 -112
dw-k3-s2-14 relL2 / p50 (x200) 9.5e-5 / 124.0 us 9.5e-5 / 124.5 us
full-relu top-5 = reference = reference on every run
DART faults, AVC 0, 0

KUnit (arm64, ane + fw + pm suites): 266 pass, 1 skip, 1 fail. The failure, ane-h16-program program_add128_slots_test, also fails on unmodified integration/aurora with the same config. checkpatch --strict clean.

T6000 (ane.ko) has the same symptom without #1660; with #1660 a hang recovers and s2idle works (3/3 after a hang). The H16 platform path still refuses sleep after a hung job and is not changed here.

🤖 Generated with Claude Code

A job that hangs the T8112 engine leaves the ANE CPU busy. After the
CALL timeout the driver clears RUN, but CPU_STATUS never reports STOPPED
(it stays at 0x2d, even 20 s later), so recovery gives up and the
instance stays quarantined until reboot. System sleep is refused for the
rest of the boot as well: the next suspend fails with -EBUSY and every
later one with "ASC stop NOT proven, sleep refused".

Asserting the CPU power-state reset while the domain is on resets the
whole SoC. The vendor driver powers the CPU off through its power
controller instead, checks that the power state reads back off, and
starts the firmware cold later.

Do the same through genpd. The halt step now reports a busy core (RUN
clear, STOPPED never seen) separately from other failures. Only an
unplanned stop may hand a busy core to a new contain step, which waits
hung_settle_ms more for STOPPED and then accepts it. The power cycle
lowers the engine domains and ane_sys_cpu, children first, with each
transition run by the PMGR state machine, while the three DARTs (and so
ane_sys) are held powered. Every PMGR word has to read back off, and the
cold CPU has to read STOPPED with RUN clear before the firmware boots.
Programs load again on their next use. A planned stop still requires
POWER_DOWN, WFI and STOPPED and never contains.

System sleep uses the same boundary. A quarantined instance takes an
unplanned stop in suspend, genpd powers it off in the noirq phase and
resume boots it, so the sleep also brings it back. A failed device with
a busy core no longer refuses sleep.

hung_stop=0 keeps the old behaviour.

On an M2 (fleet67-based kernel with this change): 12 of 12 deliberate
hangs contained without a SoC reset, 11 recovered at the timeout and one
(left quarantined with hung_stop=0) by the next s2idle; s2idle 39/39
with 4 pm_test=devices aborts in between; MobileNet layer relL2 9.5e-5
and full network top-5 unchanged, p50 124.0 us before and 124.5 us
after; no DART faults.

Assisted-by: LLM
Signed-off-by: Ryan Murray <[email protected]>
@RyanTheTide
RyanTheTide merged commit 562dcfc into integration/aurora Nov 12, 2026
1 check passed
@RyanTheTide
RyanTheTide deleted the fix/ane-t8112-hung-job-stop branch November 12, 2026 13:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant