From cfae502f25c358b062b61bad6d68816efefc0ac4 Mon Sep 17 00:00:00 2001 From: bong-water-water-bong Date: Tue, 10 Nov 2026 09:01:26 -0400 Subject: [PATCH] amdxdna 0010: the README row stops claiming a clean failure it does not deliver MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit engine#1855, from the audit of PRs merged over an unanswered CHANGES. Patch `0010` is right for the restart path -- it moves `aie2_hwctx_job_unpause()` off the shared `out:` label so a context whose restart failed is no longer unpaused and drained onto a `fw_ctx_id` firmware no longer has. What the row claimed on top of that is not delivered: the patch changes ONE call site. `aie2_hwctx_fini()` still calls `aie2_hwctx_job_unpause()` unconditionally, and `aie2_hwctx_job_unpause()` **runs** the parked jobs (`list_del` + `aie2_job_run`) rather than failing them, so a failed context's parked jobs execute at teardown. Better than draining onto a dead firmware context; not "a clean, attributable failure instead of a wedge", which is what the row said. The row now says both halves: what the patch does, and what it does not -- with the reason the second half is a second patch rather than a doc change (failing jobs at fini changes driver behaviour and needs the kernel tree, which is not this lane's call). Verified in-repo: the patch touches exactly two lines of `aie2_ctx.c`, both the unpause call, and never names `aie2_hwctx_fini` (`grep -nE "aie2_hwctx_fini|job_unpause" third_party/patches/amdxdna/0010-*.patch` → the removed line and its moved replacement only). Docs only; no code, no patch bytes, and the series still applies as before (nothing about the patch changed). --- third_party/patches/amdxdna/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/third_party/patches/amdxdna/README.md b/third_party/patches/amdxdna/README.md index 898695b6c..9b9e7f571 100644 --- a/third_party/patches/amdxdna/README.md +++ b/third_party/patches/amdxdna/README.md @@ -50,7 +50,7 @@ two-client shape (3/3 wedges on `646FFC30…`) now refuses the second client `co | 0008 | `accel/amdxdna: a dying context must not fail the device resume` (2 files, +33/−4) | `aie2_hwctx_resume_cb()` failed the whole walk on the `-ESRCH` that `aie2_hwctx_restart()` returns for a context whose heap address is gone (a client closing while the device is runtime-suspended), and `aie2_hw_resume()` then `break`s out of the **client** loop: every context of every later client stayed destroyed with no firmware context at all, and `pm_runtime_resume_and_get()` reported failure for a resume that had in fact started the hardware, so `amdxdna_pm_resume_get()` called `pm_runtime_set_suspended()` on a started device | the c29 take's own log: `amdxdna_pm_resume_get: Resume failed: -3` then `amdxdna_drm_close: Resume failed (-3), pid 11374 restore data not reclaimed`, followed immediately by `device is already started` — the resume ran, the dying context made it report failure (engine#1051) | | 0009 | `accel/amdxdna: keep the array awake while a context exists` (1 file, +35/−0) | a runtime suspend destroys every firmware context and the resume recreates them; on this platform a recreated context is created and host-buffer-mapped with the same messages, the same fw ctx id and the same address, `aie2_hwctx_restart()` returns 0 — and its first dispatch still never reaches the DPU (`DPU PC 0xffffffff`, `TXN OP ID 0xffffffff`, `timed out sub command 0`), after which the array wedges until a power-cycle. Take a runtime-PM usage reference for the life of each hw_context (`pm_runtime_get_noresume()` in `aie2_hwctx_init()`, released with `pm_runtime_put_autosuspend()` in `aie2_hwctx_fini()`), so the array cannot enter that state under any client; a device with no contexts still autosuspends at 5 s | the engine#1051 ladder on strixhalo 2026-11-06: **3/3 wedge** with `power/control=auto` on the shipping module, each log showing `Destroyed fw ctx 15` → suspend → `Created fw ctx 15` + host buffer → `restarted, ret 0` → wedge, while the same request into a context created after the resume succeeded and XRT's own validate passed 5/5 across resumes. This is the driver-level form of the c30 keep-awake policy, so it protects every client, not only the payload that polls GET_INFO | -| 0010 | `accel/amdxdna: a context that failed to restart stays paused` (2 files, +16/−3) | `aie2_hwctx_restart()` called `aie2_hwctx_job_unpause()` from its shared `out:` label, so a context whose restart had just **failed** was unpaused anyway, and `aie2_tdr_resume_hwctx()` logged it as restarted either way: the queue then drained onto a `fw_ctx_id` firmware no longer has, and the only visible symptom is an NPU that says it recovered and then silently stops answering (engine#1750). The unpause now happens only on success; a failed context stays paused, so its jobs get a clean, attributable failure instead of a wedge. One change fixes both callers — the TDR resume callback and `aie2_hwctx_resume_cb()` on the pm-resume path, which had the same defect; `aie2_hwctx_init()` keeps its own unpause and is untouched | **carried, NOT measured** — no TDR run yet, and the issue's own first question (does firmware reject a command on a destroyed `fw_ctx_id` cleanly?) is the run that would settle bug vs robustness smell. Verified here instead: it applies **on top of `0001`–`0009`** (`git apply --check` against the series result) and **conflicts on the bare pin**, so it must be applied in series order; and the module **compiles** against `7.4.0-rc1-1bit`'s build tree (`amdxdna.ko`, 14,033,392 B, 0 errors, `aie2_ctx.o` and `aie2_tdr.o` rebuilt), never loaded — `/lib/modules` untouched, no `modprobe`, no parameter changed | +| 0010 | `accel/amdxdna: a context that failed to restart stays paused` (2 files, +16/−3) | `aie2_hwctx_restart()` called `aie2_hwctx_job_unpause()` from its shared `out:` label, so a context whose restart had just **failed** was unpaused anyway, and `aie2_tdr_resume_hwctx()` logged it as restarted either way: the queue then drained onto a `fw_ctx_id` firmware no longer has, and the only visible symptom is an NPU that says it recovered and then silently stops answering (engine#1750). The unpause now happens only on success. **What this does NOT deliver** (engine#1855): `aie2_hwctx_fini()` still calls `aie2_hwctx_job_unpause()` unconditionally -- this patch touches one call site, not fini -- and `aie2_hwctx_job_unpause()` *runs* the parked jobs (`list_del` + `aie2_job_run`) rather than failing them, so a failed context's parked jobs are executed at teardown. That is strictly better than draining them onto a `fw_ctx_id` firmware no longer has, but it is not the clean, attributable failure this row used to claim: the residual is a context whose restart failed doing work at destroy time. Failing those jobs at fini is a second patch, not a doc change, and is not carried here. One change fixes both callers — the TDR resume callback and `aie2_hwctx_resume_cb()` on the pm-resume path, which had the same defect; `aie2_hwctx_init()` keeps its own unpause and is untouched | **carried, NOT measured** — no TDR run yet, and the issue's own first question (does firmware reject a command on a destroyed `fw_ctx_id` cleanly?) is the run that would settle bug vs robustness smell. Verified here instead: it applies **on top of `0001`–`0009`** (`git apply --check` against the series result) and **conflicts on the bare pin**, so it must be applied in series order; and the module **compiles** against `7.4.0-rc1-1bit`'s build tree (`amdxdna.ko`, 14,033,392 B, 0 errors, `aie2_ctx.o` and `aie2_tdr.o` rebuilt), never loaded — `/lib/modules` untouched, no `modprobe`, no parameter changed | | 0011 | `accel/amdxdna: document trusted mailbox ring geometry and drop the power-of-two check` (1 file, +7/−5) — **carried, NOT installed** | `xdna_mailbox_start_channel()` refused any channel whose firmware-supplied `rb_size` was not a power of two (`-EINVAL`), which turns a ring geometry AMD's signed firmware handed us into a channel that cannot start at all. Upstream drops the check and documents that the geometry, `rb_start_addr` and `rb_size` come from signed firmware and are trusted by design | **carried, NOT measured** — no run has needed a non-power-of-two ring here, so this is a port of an upstream decision rather than a fix we have watched. Verified: the file is the upstream change unmodified, and it `git apply --check`s **both** on the bare pin (`526c6081`) and on top of `0001`–`0010`, so it is order-independent in the series. Never loaded: `/lib/modules` untouched, no `modprobe`, no parameter changed | | 0012 | `accel/amdxdna: Reject device heap BO when dev_mem_size is not set` (1 file, +5) — **carried, NOT installed** | a heap-BO request on a device with no heap hit a `WARN_ON` and a bogus alignment test instead of one quiet refusal; upstream returns `-EOPNOTSUPP` from the allocation path. Ours warns today (`amdxdna_gem.c`), so this removes a warning from a hot path rather than changing behaviour anyone has depended on | **carried, NOT measured** — the warn path has not been hit on this box in the fleet's runs. Verified the same way: unmodified upstream change, applies on the bare pin and on `0001`–`0011`. Not loaded |