public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Sultan Alsawaf <sultan@kerneltoast.com>
To: bin.du@amd.com, pratap.nirujogi@amd.com,
	mario.limonciello@amd.com, amd-gfx@lists.freedesktop.org,
	linux-kernel@vger.kernel.org
Cc: alexander.deucher@amd.com, benjamin.chan@amd.com,
	christian.koenig@amd.com, dantony@amd.com,
	gjorgji.rosikopulos@amd.com, king.li@amd.com,
	phil.jawich@amd.com
Subject: [PATCH] drm/amd/amdgpu: Ensure isp_kernel_buffer_alloc() creates a new BO
Date: Wed,  5 Nov 2025 15:21:08 -0800	[thread overview]
Message-ID: <20251105232108.107765-1-sultan@kerneltoast.com> (raw)

From: Sultan Alsawaf <sultan@kerneltoast.com>

When the BO pointer provided to amdgpu_bo_create_kernel() points to
non-NULL, amdgpu_bo_create_kernel() takes it as a hint to pin that address
rather than allocate a new BO.

This functionality is never desired for allocating ISP buffers. A new BO
should always be created when isp_kernel_buffer_alloc() is called, per the
description for isp_kernel_buffer_alloc().

Ensure this by zeroing *bo right before the amdgpu_bo_create_kernel() call.

Fixes: 55d42f616976 ("drm/amd/amdgpu: Add helper functions for isp buffers")
Signed-off-by: Sultan Alsawaf <sultan@kerneltoast.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_isp.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_isp.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_isp.c
index 9cddbf50442a..37270c4dab8d 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_isp.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_isp.c
@@ -280,6 +280,8 @@ int isp_kernel_buffer_alloc(struct device *dev, u64 size,
 	if (ret)
 		return ret;
 
+	/* Ensure *bo is NULL so a new BO will be created */
+	*bo = NULL;
 	ret = amdgpu_bo_create_kernel(adev,
 				      size,
 				      ISP_MC_ADDR_ALIGN,
-- 
2.51.2


             reply	other threads:[~2025-11-05 23:21 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-05 23:21 Sultan Alsawaf [this message]
2025-11-06 18:46 ` [PATCH] drm/amd/amdgpu: Ensure isp_kernel_buffer_alloc() creates a new BO Mario Limonciello
2025-11-06 18:58   ` Sultan Alsawaf
2025-11-06 19:00     ` Mario Limonciello
2025-11-06 20:08     ` Nirujogi, Pratap
2025-11-06 20:31       ` Sultan Alsawaf
2025-11-06 20:51         ` Nirujogi, Pratap
2025-11-10  3:12           ` Du, Bin
2025-11-10 16:26             ` Nirujogi, Pratap

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=20251105232108.107765-1-sultan@kerneltoast.com \
    --to=sultan@kerneltoast.com \
    --cc=alexander.deucher@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=benjamin.chan@amd.com \
    --cc=bin.du@amd.com \
    --cc=christian.koenig@amd.com \
    --cc=dantony@amd.com \
    --cc=gjorgji.rosikopulos@amd.com \
    --cc=king.li@amd.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mario.limonciello@amd.com \
    --cc=phil.jawich@amd.com \
    --cc=pratap.nirujogi@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