From: "Mario Limonciello (AMD) (kernel.org)" <superm1@kernel.org>
To: Lizhi Hou <lizhi.hou@amd.com>,
ogabbay@kernel.org, quic_jhugo@quicinc.com,
maciej.falkowski@linux.intel.com,
dri-devel@lists.freedesktop.org
Cc: linux-kernel@vger.kernel.org, max.zhen@amd.com, sonal.santan@amd.com
Subject: Re: [PATCH] accel/amdxdna: Fix dma_fence leak when job is canceled
Date: Wed, 5 Nov 2025 13:43:06 -0600 [thread overview]
Message-ID: <5e341c1b-4cb1-46b3-a8b2-2c6758017988@kernel.org> (raw)
In-Reply-To: <20251105194140.1004314-1-lizhi.hou@amd.com>
On 11/5/2025 1:41 PM, Lizhi Hou wrote:
> Currently, dma_fence_put(job->fence) is called in job notification
> callback. However, if a job is canceled, the notification callback is never
> invoked, leading to a memory leak. Move dma_fence_put(job->fence)
> to the job cleanup function to ensure the fence is always released.
>
> 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 | 1 -
> drivers/accel/amdxdna/amdxdna_ctx.c | 1 +
> 2 files changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/accel/amdxdna/aie2_ctx.c b/drivers/accel/amdxdna/aie2_ctx.c
> index 2b51c5211c2d..e9dd9e03ef07 100644
> --- a/drivers/accel/amdxdna/aie2_ctx.c
> +++ b/drivers/accel/amdxdna/aie2_ctx.c
> @@ -189,7 +189,6 @@ aie2_sched_notify(struct amdxdna_sched_job *job)
>
> up(&job->hwctx->priv->job_sem);
> job->job_done = true;
> - dma_fence_put(fence);
> mmput_async(job->mm);
> aie2_job_put(job);
> }
> diff --git a/drivers/accel/amdxdna/amdxdna_ctx.c b/drivers/accel/amdxdna/amdxdna_ctx.c
> index 878cc955f56d..d17aef89a0ad 100644
> --- a/drivers/accel/amdxdna/amdxdna_ctx.c
> +++ b/drivers/accel/amdxdna/amdxdna_ctx.c
> @@ -422,6 +422,7 @@ void amdxdna_sched_job_cleanup(struct amdxdna_sched_job *job)
> trace_amdxdna_debug_point(job->hwctx->name, job->seq, "job release");
> amdxdna_arg_bos_put(job);
> amdxdna_gem_put_obj(job->cmd_bo);
> + dma_fence_put(job->fence);
> }
>
> int amdxdna_cmd_submit(struct amdxdna_client *client,
next prev parent reply other threads:[~2025-11-05 19:43 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-05 19:41 Lizhi Hou
2025-11-05 19:43 ` Mario Limonciello (AMD) (kernel.org) [this message]
2025-11-06 17:27 ` Lizhi Hou
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=5e341c1b-4cb1-46b3-a8b2-2c6758017988@kernel.org \
--to=superm1@kernel.org \
--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®