Skip to content

accel/ane: fail a DART fault that clears before it is handled - #364

Closed
joshuaswarren wants to merge 1 commit into
omacom:integration/aurorafrom
joshuaswarren:ane/tm-transient-dart-fault
Closed

joshuaswarren wants to merge 1 commit into
omacom:integration/aurorafrom
joshuaswarren:ane/tm-transient-dart-fault

Conversation

@joshuaswarren

@joshuaswarren joshuaswarren commented Nov 5, 2026 •

Copy link
Copy Markdown

The ANE completion poll reported success for a DART fault that cleared before it was handled. It now fails the request and recovers. The new host test fails four of seven cases on the base commit b798f2b0 and passes all seven with this change.

Same change as aurora-silicon/linux#980, ported from omarchy-ane#359 (merge 20629c55). This tree and aurora-silicon/linux diverged at 44d5afc7 and drivers/accel/ane/ane_tm.c differs (blob e4fab5e3 here), so #980 does not reach this branch on its own. The three production hunks are identical; only their context lines differ.

How it maps to #359:

#359 This tree
ane_tm_poll_step() returns -EIO on a latched fault Ported in drivers/accel/ane/ane_tm.c
Carry the scratch cap and the drain failure into err Ported in the same function
Retain scratch when completion is unknown Different form: ane_tm_execute() never releases scratch on the wedge path, and ane_reclaim_preserved() (ane_tm.c:643, ane_drv.c:363) releases it only after a verified power cycle. #359 keeps scratch until reboot and returns -EBUSY from ane_tm_recover(); that flag is not ported
Runtime-PM balance in close and release Nothing to port: pm_runtime_get_sync() raises the usage count even when the resume fails, so the unconditional put is balanced

Test: tools/asahi/ane-tm-transient-fault-tests.py compiles the production poll and execute functions against a simulated DART latch. Seven cases: normal completion, a fault that clears before the second read, a drained fault, a fault seen only by the last poll, a failed second drain, a scratch cap with a clear latch, and the scratch cap with the latch held. It is registered twice in tools/aurora-ci/host-tests.json: once as a plain run and once with --old-ref b798f2b0.

  • Base b798f2b0: four cases fail. The second-read case returns 0. The last-poll case releases scratch without recovery. The failed drain loses its error. The scratch cap with a clear latch releases four scratch pages with no recovery.
  • This head: all seven pass. tools/aurora-ci/host-tests.py runs both suites ok, and the test_host_tests.py unit tests pass (12 of 12).
  • Differences from the #980 test: this tree's recovery comment marker is Bounded recovery, its ane_device stub needs a tm_retention field, and the three ktime stubs are marked unused because this tree has no deadline code. The suites are registered in tools/aurora-ci/host-tests.json; #980 registers in run-host-tests.py.

No hardware ran this; it is a host test only. Not covered: runtime behavior on an M1 or M2, a verified reclaim of scratch after a power cycle, and the timeout path.

The completion poll stops when the DART error latch is set, but it
returned 1, the same value as a finished request. If the latch cleared
before ane_tm_execute() read it again, no fault was recorded and the
request went on to the completion check and returned success although
the engine never completed. If a drained fault cleared the same way,
the scratch pages were released without a recovery.

Return -EIO from the poll step so the poll reports the fault itself.
Carry the scratch cap and the drain failure into err as well, so a
fault that clears after them ends in the recovery path and keeps the
scratch mappings until a verified reset reclaims them.

This is the poll and error propagation change of omarchy-ane AsahiLinux#359
(merge 20629c55), the same change as aurora-silicon/linux#980. The
scratch lifetime part of AsahiLinux#359 is already present here in a different
form: the scratch pages live in struct ane_device, the wedge path never
releases them, and ane_reclaim_preserved() releases them after a
verified power cycle.

The host test builds the production poll and execute code against a
simulated latch. The base revision fails four of seven cases: a fault
that clears before the second read returns 0, a fault seen only by the
last poll releases scratch without recovery, a failed drain loses its
error, and a scratch cap followed by a clear latch releases the scratch
without recovery. With this change all seven pass.

Assisted-by: LLM
@joshuaswarren

Copy link
Copy Markdown
Author

[Joshua's agent] The failing check was ci / commits: commit c8c15e3 had no Signed-off-by trailer, so the Developer Certificate of Origin check failed. checkpatch reported the same single error. The runner is not at fault.

The same commit, with the sign-off added and no other change, is in #383: #383 . Its checkpatch run has 0 errors and 2 warnings (the Assisted-by format and the MAINTAINERS note for a new file). Neither warning fails CI.

Closing this PR as superseded by #383.

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