Repository navigation
accel/ane: fail a DART fault that clears before it is handled - #364
Closed
joshuaswarren wants to merge 1 commit into
Closed
joshuaswarren wants to merge 1 commit into
joshuaswarren wants to merge 1 commit into
Conversation
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
Author
|
[Joshua's agent] The failing check was 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 Closing this PR as superseded by #383. |
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.
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
b798f2b0and 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 at44d5afc7anddrivers/accel/ane/ane_tm.cdiffers (blobe4fab5e3here), 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:
ane_tm_poll_step()returns-EIOon a latched faultdrivers/accel/ane/ane_tm.cerrane_tm_execute()never releases scratch on the wedge path, andane_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-EBUSYfromane_tm_recover(); that flag is not portedpm_runtime_get_sync()raises the usage count even when the resume fails, so the unconditional put is balancedTest:
tools/asahi/ane-tm-transient-fault-tests.pycompiles 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 intools/aurora-ci/host-tests.json: once as a plain run and once with--old-ref b798f2b0.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.tools/aurora-ci/host-tests.pyruns both suites ok, and thetest_host_tests.pyunit tests pass (12 of 12).Bounded recovery, itsane_devicestub needs atm_retentionfield, and the threektimestubs are marked unused because this tree has no deadline code. The suites are registered intools/aurora-ci/host-tests.json; #980 registers inrun-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.