public inbox for stable@vger.kernel.org
 help / color / mirror / Atom feed
From: "Christian König" <ckoenig.leichtzumerken@gmail.com>
To: Matthew Auld <matthew.auld@intel.com>, intel-xe@lists.freedesktop.org
Cc: "Christian König" <christian.koenig@amd.com>,
	amd-gfx@lists.freedesktop.org, stable@vger.kernel.org
Subject: Re: [PATCH 2/2] drm/amdgpu/dma_buf: fix page_link check
Date: Mon, 7 Apr 2025 16:32:13 +0200	[thread overview]
Message-ID: <a4b1190d-4d4f-4c66-9fb7-2be19d2ea3dc@gmail.com> (raw)
In-Reply-To: <20250407141823.44504-4-matthew.auld@intel.com>

Am 07.04.25 um 16:18 schrieb Matthew Auld:
> The page_link lower bits of the first sg could contain something like
> SG_END, if we are mapping a single VRAM page or contiguous blob which
> fits into one sg entry. Rather pull out the struct page, and use that in
> our check to know if we mapped struct pages vs VRAM.
>
> Fixes: f44ffd677fb3 ("drm/amdgpu: add support for exporting VRAM using DMA-buf v3")
> Signed-off-by: Matthew Auld <matthew.auld@intel.com>
> Cc: Christian König <christian.koenig@amd.com>
> Cc: amd-gfx@lists.freedesktop.org
> Cc: <stable@vger.kernel.org> # v5.8+

Good point, haven't thought about that at all since we only abuse the sg table as DMA addr container.

Reviewed-by: Christian König <christian.koenig@amd.com>

Were is patch #1 from this series?

Thanks,
Christian.

> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.c
> index 9f627caedc3f..c9842a0e2a1c 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.c
> @@ -184,7 +184,7 @@ static void amdgpu_dma_buf_unmap(struct dma_buf_attachment *attach,
>  				 struct sg_table *sgt,
>  				 enum dma_data_direction dir)
>  {
> -	if (sgt->sgl->page_link) {
> +	if (sg_page(sgt->sgl)) {
>  		dma_unmap_sgtable(attach->dev, sgt, dir, 0);
>  		sg_free_table(sgt);
>  		kfree(sgt);


  reply	other threads:[~2025-04-07 14:32 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-07 14:18 [PATCH 1/2] drm/xe/dma_buf: stop relying on placement in unmap Matthew Auld
2025-04-07 14:18 ` [PATCH 2/2] drm/amdgpu/dma_buf: fix page_link check Matthew Auld
2025-04-07 14:32   ` Christian König [this message]
2025-04-07 14:44     ` Matthew Auld
2025-04-07 14:46       ` Christian König
2025-04-07 15:01         ` Matthew Auld
2025-04-07 15:05     ` Alex Deucher

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=a4b1190d-4d4f-4c66-9fb7-2be19d2ea3dc@gmail.com \
    --to=ckoenig.leichtzumerken@gmail.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=christian.koenig@amd.com \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=matthew.auld@intel.com \
    --cc=stable@vger.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