From mboxrd@z Thu Jan 1 00:00:00 1970 From: Claude Code Review Bot To: dri-devel-reviews@example.com Subject: Claude review: accel/amdxdna: Fix runtime suspend deadlock when there is pending job Date: Wed, 11 Mar 2026 13:04:35 +1000 Message-ID: In-Reply-To: <20260310180058.336348-1-lizhi.hou@amd.com> References: <20260310180058.336348-1-lizhi.hou@amd.com> X-Mailer: Claude Code Patch Reviewer Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Overall Series Review Subject: accel/amdxdna: Fix runtime suspend deadlock when there is pending = job Author: Lizhi Hou Patches: 3 Reviewed: 2026-03-11T13:04:35.223006 --- This is a single-patch fix for a runtime suspend deadlock in the amdxdna ac= celerator driver. The deadlock scenario is well-described: `aie2_hwctx_susp= end_cb()` waits for in-flight jobs via `aie2_hwctx_wait_for_idle()` (which = calls `dma_fence_wait_timeout()`), but the running job in `aie2_sched_job_r= un()` calls `amdxdna_pm_resume_get()` =E2=86=92 `pm_runtime_resume_and_get(= )`, which blocks waiting for the runtime suspend to complete. This is a cla= ssic PM deadlock. The fix moves the `pm_runtime_resume_and_get()` to the submit path (before = the job is queued to the scheduler) and the `pm_runtime_put_autosuspend()` = to `amdxdna_sched_job_cleanup()` (called when the job's refcount drops to z= ero). This is a reasonable approach that ensures the device stays awake for= the duration of a job's lifetime without risking the deadlock. Overall the approach is sound, but there is one significant concern with th= e PM reference balance. --- Generated by Claude Code Patch Reviewer