Repository navigation
accel/ane: power off a T8112 ANE CPU left busy by a hung job - #1693
Merged
Merged
Conversation
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]>
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 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 returnsANE_T6021_ASC_BUSYfor a busy core;restart_stop()hands it to an optionalcontainstep for unplanned stops only.ane_t6021_rtclient_main.c: contain step (extrahung_settle_mswait, 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) andhung_settle_ms(default 100) parameters.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 jobsdw-k3-s2-14andfull-relu: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