Skip to content

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

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

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

Conversation

@joshuaswarren

Copy link
Copy Markdown

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

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 #359
(merge 20629c55), the same change as aurora-silicon/linux#980. The
scratch lifetime part of #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
Signed-off-by: Joshua Warren 816217+joshuaswarren@users.noreply.github.com

@joshuaswarren

Copy link
Copy Markdown
Author

Agent review of head 4696270. Verdict: clean, no blocking findings.

Verified:

  • ane_tm.c: int err, status is signed, so the -EIO from the poll step survives. The status != 0 check ends the poll and the error propagates. The u32 truncation is avoided.
  • Wedge path never releases scratch; ane_reclaim_preserved() releases it after the verified power cycle. The contained-fault path releases scratch and fails the request without recovery, as its comment says.
  • DCO sign-off matches the author. The lineage hunk matches omarchy-ane 20629c5 (M6 audio: DART owned streams, ADMAC apertures, CIO reset, AOP audio and macaudio for the T8152 Mac mini #359).

Repro (both run on the head):

  • python3 tools/asahi/ane-tm-transient-fault-tests.py -> ane tm completion: PASS, rc=0.
  • python3 tools/asahi/ane-tm-transient-fault-tests.py --old-ref b798f2b -> old code fails 4 of 7 scenarios, as the body says.

Non-blocking notes (no failing behaviour shown):

  1. The harness stubs read_poll_timeout as a single call. It proves the error-propagation invariants, not latch timing. Real-latch timing is asserted by invariant only.
  2. build() matches the slice marker '/* Bounded recovery' exactly. Reflowing that comment makes the suite fail loudly (ValueError). Brittle, not wrong.
  3. ane_tm.c:295 has a redundant !err guard. Cosmetic.

Not covered: no hardware run. The aurora-silicon/linux#980 "same change" claim in the body was not checked.

Perf: no regression. Same DART and engine reads per poll, two int assignments added.

@joshuaswarren
joshuaswarren force-pushed the ane/tm-transient-dart-fault-dco branch from 4696270 to c28f63a Compare November 9, 2026 22:15
@joshuaswarren

Copy link
Copy Markdown
Author

[Joshua's agent] @maralcbr @chriskearney @scottjones Could one of you review this? I rebased it on integration/aurora at 49a8c15, where it was 33 commits behind. There were no conflicts, and git range-diff shows the commit unchanged. The new head is c28f63ace4. All 13 checks pass on it. It is mergeable and waits only for a review.

It fixes a request that reported success after a DART fault the engine never recovered from. If the fault latch cleared before the driver read it again, the poll returned the same value as a finished request. The poll now returns -EIO and the fault ends in the recovery path. Proven by a host test that builds the production poll and execute code against a simulated latch: the base fails 4 of 7 cases, and this change passes all 7. It is the same change as aurora-silicon/linux#980.

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
Signed-off-by: Joshua Warren <816217+joshuaswarren@users.noreply.github.com>
@joshuaswarren

Copy link
Copy Markdown
Author

[Joshua's agent] Rebased onto integration/aurora at bed544b. Head is now df1d434. No conflicts. The 1 commit(s) are unchanged (range-diff). CI re-runs on the new head. Review needed: one approval from @maralcbr, @scottjones or @chriskearney (CODEOWNERS). @maralcbr and @scottjones merged the last 6 PRs in this repo.

@joshuaswarren
joshuaswarren force-pushed the ane/tm-transient-dart-fault-dco branch from c28f63a to df1d434 Compare November 10, 2026 07:51
@joshuaswarren

Copy link
Copy Markdown
Author

[Joshua's agent] Status at 2026-11-12 08:13Z: head df1d434 is 0 commits behind integration/aurora (bed544b) and the checks that apply have passed. The PR still needs one approving CODEOWNER review before it can merge. Can a CODEOWNER take a look? Unvoiced; checked by hand.

@joshuaswarren

Copy link
Copy Markdown
Author

Closing with a pointer: this landed upstream as aurora-silicon#980 (merged). The DART fault that clears before it is handled now fails the submission there; nothing left to track on this side.

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