mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Lizhi Hou <lizhi.hou@amd.com>
To: <ogabbay@kernel.org>, <quic_jhugo@quicinc.com>,
	<dri-devel@lists.freedesktop.org>
Cc: Lizhi Hou <lizhi.hou@amd.com>, <linux-kernel@vger.kernel.org>,
	<min.ma@amd.com>, <max.zhen@amd.com>, <sonal.santan@amd.com>,
	<king.tam@amd.com>, <mario.limonciello@amd.com>
Subject: [PATCH V1 2/7] accel/amdxdna: Replace mmput with mmput_async to avoid dead lock
Date: Wed, 4 Dec 2024 13:37:24 -0800	[thread overview]
Message-ID: <20241204213729.3113941-3-lizhi.hou@amd.com> (raw)
In-Reply-To: <20241204213729.3113941-1-lizhi.hou@amd.com>

Hardware mailbox message receiving handler calls mmput to release the
process mm. If the process has already exited, the mmput here may call mmu
notifier handler, amdxdna_hmm_invalidate, which will cause a dead lock.
Using mmput_async instead prevents this dead lock.

Signed-off-by: Lizhi Hou <lizhi.hou@amd.com>
---
 drivers/accel/amdxdna/aie2_ctx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/accel/amdxdna/aie2_ctx.c b/drivers/accel/amdxdna/aie2_ctx.c
index 90e8d87666a9..b5282555bbf2 100644
--- a/drivers/accel/amdxdna/aie2_ctx.c
+++ b/drivers/accel/amdxdna/aie2_ctx.c
@@ -179,7 +179,7 @@ aie2_sched_notify(struct amdxdna_sched_job *job)
 	up(&job->hwctx->priv->job_sem);
 	job->job_done = true;
 	dma_fence_put(fence);
-	mmput(job->mm);
+	mmput_async(job->mm);
 	aie2_job_put(job);
 }
 
-- 
2.34.1


  parent reply	other threads:[~2024-12-04 21:38 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-04 21:37 [PATCH V1 0/7] AMD NPU driver improvements Lizhi Hou
2024-12-04 21:37 ` [PATCH V1 1/7] accel/amdxdna: Add device status for aie2 devices Lizhi Hou
2024-12-04 22:26   ` Mario Limonciello
2024-12-05  5:15     ` Lizhi Hou
2024-12-04 21:37 ` Lizhi Hou [this message]
2024-12-04 21:37 ` [PATCH V1 3/7] accel/amdxdna: Add RyzenAI-npu6 support Lizhi Hou
2024-12-04 21:37 ` [PATCH V1 4/7] accel/amdxdna: Replace idr api with xarray Lizhi Hou
2024-12-04 21:37 ` [PATCH V1 5/7] accel/amdxdna: Add query firmware version Lizhi Hou
2024-12-04 22:24   ` Mario Limonciello
2024-12-05  5:14     ` Lizhi Hou
2024-12-04 21:37 ` [PATCH V1 6/7] accel/amdxdna: Enhance power management settings Lizhi Hou
2024-12-05  3:52   ` Mario Limonciello
2024-12-06  1:13     ` Lizhi Hou
2024-12-04 21:37 ` [PATCH V1 7/7] accel/amdxdna: Read firmware interface version from registers 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=20241204213729.3113941-3-lizhi.hou@amd.com \
    --to=lizhi.hou@amd.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=king.tam@amd.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mario.limonciello@amd.com \
    --cc=max.zhen@amd.com \
    --cc=min.ma@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®