From: Mario Limonciello <mario.limonciello@amd.com>
To: Lizhi Hou <lizhi.hou@amd.com>,
ogabbay@kernel.org, quic_jhugo@quicinc.com,
dri-devel@lists.freedesktop.org,
maciej.falkowski@linux.intel.com
Cc: linux-kernel@vger.kernel.org, max.zhen@amd.com, sonal.santan@amd.com
Subject: Re: [PATCH V1] accel/amdxdna: Fix command hang on suspended hardware context
Date: Wed, 11 Feb 2026 15:54:00 -0600 [thread overview]
Message-ID: <44575547-fc1e-4319-b40d-12e73fafdd4f@amd.com> (raw)
In-Reply-To: <20260211205341.722982-1-lizhi.hou@amd.com>
On 2/11/26 2:53 PM, Lizhi Hou wrote:
> When a hardware context is suspended, the job scheduler is stopped. If a
> command is submitted while the context is suspended, the job is queued in
> the scheduler but aie2_sched_job_run() is never invoked to restart the
> hardware context. As a result, the command hangs.
>
> Fix this by modifying the hardware context suspend routine to keep the job
> scheduler running so that queued jobs can trigger context restart properly.
>
> Fixes: aac243092b70 ("accel/amdxdna: Add command execution")
> Signed-off-by: Lizhi Hou <lizhi.hou@amd.com>
> ---
Reviewed-by: Mario Limonciello (AMD) <superm1@kernel.org>
> drivers/accel/amdxdna/aie2_ctx.c | 18 +++++++++++-------
> 1 file changed, 11 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/accel/amdxdna/aie2_ctx.c b/drivers/accel/amdxdna/aie2_ctx.c
> index 89c0ab896f92..622ddbf7fb6f 100644
> --- a/drivers/accel/amdxdna/aie2_ctx.c
> +++ b/drivers/accel/amdxdna/aie2_ctx.c
> @@ -53,6 +53,7 @@ static void aie2_hwctx_stop(struct amdxdna_dev *xdna, struct amdxdna_hwctx *hwct
> {
> drm_sched_stop(&hwctx->priv->sched, bad_job);
> aie2_destroy_context(xdna->dev_handle, hwctx);
> + drm_sched_start(&hwctx->priv->sched, 0);
> }
>
> static int aie2_hwctx_restart(struct amdxdna_dev *xdna, struct amdxdna_hwctx *hwctx)
> @@ -80,7 +81,6 @@ static int aie2_hwctx_restart(struct amdxdna_dev *xdna, struct amdxdna_hwctx *hw
> }
>
> out:
> - drm_sched_start(&hwctx->priv->sched, 0);
> XDNA_DBG(xdna, "%s restarted, ret %d", hwctx->name, ret);
> return ret;
> }
> @@ -297,19 +297,23 @@ aie2_sched_job_run(struct drm_sched_job *sched_job)
> struct dma_fence *fence;
> int ret;
>
> - if (!hwctx->priv->mbox_chann)
> + ret = amdxdna_pm_resume_get(hwctx->client->xdna);
> + if (ret)
> + return NULL;
> +
> + if (!hwctx->priv->mbox_chann) {
> + amdxdna_pm_suspend_put(hwctx->client->xdna);
> return NULL;
> + }
>
> - if (!mmget_not_zero(job->mm))
> + if (!mmget_not_zero(job->mm)) {
> + amdxdna_pm_suspend_put(hwctx->client->xdna);
> return ERR_PTR(-ESRCH);
> + }
>
> kref_get(&job->refcnt);
> fence = dma_fence_get(job->fence);
>
> - ret = amdxdna_pm_resume_get(hwctx->client->xdna);
> - if (ret)
> - goto out;
> -
> if (job->drv_cmd) {
> switch (job->drv_cmd->opcode) {
> case SYNC_DEBUG_BO:
prev parent reply other threads:[~2026-02-11 21:54 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-11 20:53 Lizhi Hou
2026-02-11 21:54 ` Mario Limonciello [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=44575547-fc1e-4319-b40d-12e73fafdd4f@amd.com \
--to=mario.limonciello@amd.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lizhi.hou@amd.com \
--cc=maciej.falkowski@linux.intel.com \
--cc=max.zhen@amd.com \
--cc=ogabbay@kernel.org \
--cc=quic_jhugo@quicinc.com \
--cc=sonal.santan@amd.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®