Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A8D56C369D9 for ; Tue, 22 Apr 2025 08:15:53 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 74B2310E535; Tue, 22 Apr 2025 08:15:49 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="N9dHOmo/"; dkim-atps=neutral Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by gabe.freedesktop.org (Postfix) with ESMTPS id 7BD7510E500 for ; Tue, 22 Apr 2025 06:35:40 +0000 (UTC) Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id E60E85C58EE; Tue, 22 Apr 2025 06:33:22 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 58C6AC4CEE9; Tue, 22 Apr 2025 06:35:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1745303739; bh=bZqkhwr3NmBDgPG066rDljCJbnwaKghPQjIhiztSo6w=; h=Subject:To:Cc:From:Date:From; b=N9dHOmo/t6eLsqDG2PJm7JdjZqDW8WBUW0fq6e6UrfxkQiGMBB/5/C5a2+sv3qwOx N0+F9MxyjhQwnYMEAcpFON8P+ONbd3Qs3dq2AZGbjqrvvb0HmCej9n7wygL/quaYlq Kt15BgbvvROQsXeBFdWaGRrn8i8CRmg+/mFnCOWY= Subject: Patch "drm/amdgpu/dma_buf: fix page_link check" has been added to the 6.12-stable tree To: alexander.deucher@amd.com, amd-gfx@lists.freedesktop.org, christian.koenig@amd.com, gregkh@linuxfoundation.org, matthew.auld@intel.com Cc: From: Date: Tue, 22 Apr 2025 08:35:10 +0200 Message-ID: <2025042210-wronged-correct-4a40@gregkh> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-stable: commit X-Patchwork-Hint: ignore X-Mailman-Approved-At: Tue, 22 Apr 2025 08:15:48 +0000 X-BeenThere: amd-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion list for AMD gfx List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: amd-gfx-bounces@lists.freedesktop.org Sender: "amd-gfx" This is a note to let you know that I've just added the patch titled drm/amdgpu/dma_buf: fix page_link check to the 6.12-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: drm-amdgpu-dma_buf-fix-page_link-check.patch and it can be found in the queue-6.12 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let know about it. From c0dd8a9253fadfb8e5357217d085f1989da4ef0a Mon Sep 17 00:00:00 2001 From: Matthew Auld Date: Mon, 7 Apr 2025 15:18:25 +0100 Subject: drm/amdgpu/dma_buf: fix page_link check MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Matthew Auld commit c0dd8a9253fadfb8e5357217d085f1989da4ef0a upstream. 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 Cc: Christian König Cc: amd-gfx@lists.freedesktop.org Cc: # v5.8+ Reviewed-by: Christian König Signed-off-by: Alex Deucher Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.c @@ -181,7 +181,7 @@ static void amdgpu_dma_buf_unmap(struct 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); Patches currently in stable-queue which might be from matthew.auld@intel.com are queue-6.12/drm-xe-dma_buf-stop-relying-on-placement-in-unmap.patch queue-6.12/drm-xe-use-local-fence-in-error-path-of-xe_migrate_clear.patch queue-6.12/drm-amdgpu-dma_buf-fix-page_link-check.patch queue-6.12/drm-xe-userptr-fix-notifier-vs-folio-deadlock.patch