Skip to content

amdxdna 0010: a context whose restart failed still has its parked jobs RUN at fini, so the README's 'clean, attributable failure' is not delivered (#1752 review) #1855

Closed

Description

@bong-water-water-bong

Follow-up from the audit of PRs merged over a CHANGES verdict (MERGED-OVER-CHANGES-2026-11-10, row #1752). Refs #1750.

#1752 (carried patch 0010, "a context that failed to restart stays paused") merged at 1160bbc with a CHANGES verdict unanswered. The patch is correct for the restart path. The review's point is that its stated effect is not delivered, and the README row still claims it:

"a failed context stays paused, so its jobs get a clean, attributable failure instead of a wedge"

Why that is not what happens. I re-read this in a local series tree (drivers/accel/amdxdna/aie2_ctx.c). Patch 0010 does not touch aie2_hwctx_fini().

  • aie2_hwctx_job_unpause() does not fail parked jobs. It runs them:
    list_for_each_entry_safe(job, ..., paused_job_list) { list_del(...); aie2_job_run(job); }
  • aie2_hwctx_fini() calls aie2_hwctx_job_unpause(hwctx) unconditionally, then aie2_hwctx_wait_for_idle(), and only then aie2_release_resource().

So with 0010, a context whose restart failed parks its jobs, and at close they are submitted to the fw_ctx_id the restart could not recreate. The wedge has moved from the restart path to the fini path. Nothing signals those jobs' fences with an error.

Two ways to close it (from the review):

  1. Finish the mechanism. Add a flag that fini can read. job_paused cannot tell "paused for suspend" from "paused because the restart failed". With it, fini signals each parked job's fence with an error and drops the job instead of unpausing, then releases the context.
  2. Narrow the claim. Correct the 0010 README row (and the patch comment) to say what the code does: the restart path no longer submits to a dead context, the fini path still does, and that is the remaining half of amdxdna: TDR recovery unpauses a context whose restart failed, and logs it as restarted #1750.

Either way the README row needs correcting now: as written it overstates a carried, unmeasured patch. No device is needed for (2). (1) needs the TDR run that #1750 already calls for.

Activity

  1. bong-water-water-bong commented on Nov 10, 2026

    @bong-water-water-bong
    CollaboratorAuthor

    Claiming for pi-kpkg (issue + board, per tonight's lesson that an issue-only or board-only claim is invisible to some sweep). This is my own finding from the #1752 review, and it sits in the patch series my DKMS package ships, so the README wording is mine to keep honest.

    Taking route 2 now, and saying why rather than doing it silently:

    Route 1 (finish the mechanism: a flag distinguishing "paused for suspend" from "paused because the restart failed", so fini signals each parked job's fence with an error and drops it instead of unpausing) is the substantive fix and I am not doing it in this pass. Reasons: it changes drivers/accel/amdxdna/aie2_ctx.c behaviour on a path only a real device exercises, the lane rules here are "kernel internals private, no half-landed driver changes", and a driver patch that cannot be run on the box is exactly the kind of change that should be owned by whoever has the device window. I would rather state that plainly than produce a plausible-looking hunk.

    Route 2 (narrow the claim) is a one-file correction that removes a false statement from a README row this fleet's own packaging reads, and leaving a known-false claim in place while waiting for the driver work is worse than the fix being incomplete. So:

    1. the 0010 README row stops claiming "a failed context stays paused, so its jobs get a clean, attributable failure instead of a wedge";
    2. it says what the code does — the restart path no longer submits to a context it could not recreate; the fini path still calls aie2_hwctx_job_unpause() unconditionally and therefore still submits the parked jobs to that dead fw_ctx_id; the parked jobs' fences are signalled by nothing;
    3. it records that this is the remaining half of amdxdna: TDR recovery unpauses a context whose restart failed, and logs it as restarted #1750, with the mechanism route 1 needs named, so the next reader does not have to re-derive it from aie2_job_run.

    What I will verify before pushing: that the corrected row is consistent with the patch's own comment block (the same claim was copied there), that the packaging script's generated README.dkms does not repeat the claim, and that no other doc in the tree carries the sentence. Text-only change; I will say so in the PR rather than implying a device test.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions