dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Wang Haoran" <wanghr2026@mail.zgclab.edu.cn>
Cc: dri-devel@lists.freedesktop.org, media-ci@linuxtv.org
Subject: Re: [PATCH] accel/qaic: hold the dma_resv lock when mapping imported buffers
Date: Thu, 19 Nov 2026 08:24:43 +0000	[thread overview]
Message-ID: <sashiko-outbox-222665@kernel.org> (raw)
In-Reply-To: <1795076088845-1-b103cfa7@mail.zgclab.edu.cn>

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] accel/qaic: open-coded dma-buf unlocked map/unmap helpers in
  qaic_data.c
--

commit 393bb58da0dd7ba519229334f4b5698ecdaba857
Author: Wang Haoran <wanghr2026@mail.zgclab.edu.cn>

accel/qaic: hold the dma_resv lock when mapping imported buffers

This commit acquires the buffer reservation lock around
dma_buf_map_attachment() and dma_buf_unmap_attachment() in
qaic_prepare_import_bo() and qaic_unprepare_import_bo().

> diff --git a/drivers/accel/qaic/qaic_data.c b/drivers/accel/qaic/qaic_data.c
> index be3ceb8c51a09..8879ffe647c52 100644
> --- a/drivers/accel/qaic/qaic_data.c
> +++ b/drivers/accel/qaic/qaic_data.c
> @@ -895,7 +895,9 @@ static int qaic_prepare_import_bo(struct qaic_bo *bo, struct qaic_attach_slice_h
>  	struct sg_table *sgt;
>  	int ret;
>  
> +	dma_resv_lock(obj->resv, NULL);
>  	sgt = dma_buf_map_attachment(obj->import_attach, hdr->dir);
> +	dma_resv_unlock(obj->resv);
>  	if (IS_ERR(sgt)) {
>  		ret = PTR_ERR(sgt);
>  		return ret;
> @@ -936,7 +938,9 @@ static int qaic_prepare_bo(struct qaic_device *qdev, struct qaic_bo *bo,
>  
>  static void qaic_unprepare_import_bo(struct qaic_bo *bo)
>  {
> +	dma_resv_lock(bo->base.resv, NULL);
>  	dma_buf_unmap_attachment(bo->base.import_attach, bo->sgt, bo->dir);
> +	dma_resv_unlock(bo->base.resv);
>  	bo->sgt = NULL;
>  }

[Severity: Low]
This isn't a bug, but could qaic_prepare_import_bo() and
qaic_unprepare_import_bo() call dma_buf_map_attachment_unlocked() and
dma_buf_unmap_attachment_unlocked() directly instead of open-coding the
dma_resv_lock() and dma_resv_unlock() sequence?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/1795076088845-1-b103cfa7@mail.zgclab.edu.cn?part=1

           reply	other threads:[~2026-11-19  8:24 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <1795076088845-1-b103cfa7@mail.zgclab.edu.cn>]

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=sashiko-outbox-222665@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=media-ci@linuxtv.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=wanghr2026@mail.zgclab.edu.cn \
    /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