From: Li Sheng <wirsbf@gmail.com>
To: jeff.hugo@oss.qualcomm.com, carl.vanderlip@oss.qualcomm.com,
ogabbay@kernel.org
Cc: dri-devel@lists.freedesktop.org, linux-arm-msm@vger.kernel.org,
linux-kernel@vger.kernel.org, Li Sheng <wirsbf@gmail.com>
Subject: [PATCH drm-misc-fixes] accel/qaic: Use dma_buf_{map,unmap}_attachment_unlocked()
Date: Sun, 6 Dec 2026 11:16:32 +0800 [thread overview]
Message-ID: <20261206031632.531961-1-wirsbf@gmail.com> (raw)
qaic_prepare_import_bo() and qaic_unprepare_import_bo() call
dma_buf_map_attachment() and dma_buf_unmap_attachment() without holding
the dma_buf reservation lock. Since commit 47e982d5195d ("dma-buf: Move
dma_buf_map_attachment() to dynamic locking specification"), both helpers
assert dma_resv_assert_held(attach->dmabuf->resv). Calling them unlocked
triggers lockdep warnings and risks racing with dynamic dma-buf exporters
during buffer migration or teardown.
All callers (qaic_attach_slice_bo_ioctl(), qaic_detach_slice_bo_ioctl(),
and release_dbc()) execute in sleepable context without holding spinlocks
or the dma_buf reservation lock. Switch both call sites to
dma_buf_map_attachment_unlocked() and dma_buf_unmap_attachment_unlocked().
Compile-tested only (no QAIC hardware available).
Fixes: ff13be830333 ("accel/qaic: Add datapath")
Cc: stable@vger.kernel.org
Signed-off-by: Li Sheng <wirsbf@gmail.com>
---
Note: commit 77e0b2d2f4f3 in drm-misc-next renamed these helpers to
dma_buf_{map,unmap}_sgt_unlocked(); please adjust accordingly when
merging drm-misc-fixes into drm-misc-next.
drivers/accel/qaic/qaic_data.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/accel/qaic/qaic_data.c b/drivers/accel/qaic/qaic_data.c
index be3ceb8c5..988b8464e 100644
--- a/drivers/accel/qaic/qaic_data.c
+++ b/drivers/accel/qaic/qaic_data.c
@@ -895,7 +895,7 @@ static int qaic_prepare_import_bo(struct qaic_bo *bo, struct qaic_attach_slice_h
struct sg_table *sgt;
int ret;
- sgt = dma_buf_map_attachment(obj->import_attach, hdr->dir);
+ sgt = dma_buf_map_attachment_unlocked(obj->import_attach, hdr->dir);
if (IS_ERR(sgt)) {
ret = PTR_ERR(sgt);
return ret;
@@ -936,7 +936,7 @@ static int qaic_prepare_bo(struct qaic_device *qdev, struct qaic_bo *bo,
static void qaic_unprepare_import_bo(struct qaic_bo *bo)
{
- dma_buf_unmap_attachment(bo->base.import_attach, bo->sgt, bo->dir);
+ dma_buf_unmap_attachment_unlocked(bo->base.import_attach, bo->sgt, bo->dir);
bo->sgt = NULL;
}
--
2.56.1
reply other threads:[~2026-12-06 3:16 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20261206031632.531961-1-wirsbf@gmail.com \
--to=wirsbf@gmail.com \
--cc=carl.vanderlip@oss.qualcomm.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=jeff.hugo@oss.qualcomm.com \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=ogabbay@kernel.org \
/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®