From: Thadeu Lima de Souza Cascardo <cascardo@igalia.com>
To: "Alex Deucher" <alexander.deucher@amd.com>,
"Christian König" <christian.koenig@amd.com>,
"David Airlie" <airlied@gmail.com>,
"Simona Vetter" <simona@ffwll.ch>,
"Sumit Semwal" <sumit.semwal@linaro.org>
Cc: amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
kernel-dev@igalia.com,
Thadeu Lima de Souza Cascardo <cascardo@igalia.com>
Subject: [PATCH] drm/amdgpu: make amdgpu_vm_update_funcs commit return void
Date: Thu, 24 Sep 2026 11:58:40 -0300 [thread overview]
Message-ID: <20260924-amdgpu_vm_update_funcs_commit_void-v1-1-9ad7a8283920@igalia.com> (raw)
As both SDMA and CPU implementations always return 0, they can as well
just return void.
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@igalia.com>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 8 ++------
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h | 4 ++--
drivers/gpu/drm/amd/amdgpu/amdgpu_vm_cpu.c | 8 +++-----
drivers/gpu/drm/amd/amdgpu/amdgpu_vm_pt.c | 2 +-
drivers/gpu/drm/amd/amdgpu/amdgpu_vm_sdma.c | 11 +++--------
5 files changed, 11 insertions(+), 22 deletions(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
index bb04101b0fb5..09037df76400 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
@@ -1027,9 +1027,7 @@ int amdgpu_vm_update_pdes(struct amdgpu_device *adev,
goto error;
}
- r = vm->update_funcs->commit(¶ms, &vm->last_update);
- if (r)
- goto error;
+ vm->update_funcs->commit(¶ms, &vm->last_update);
if (flush_tlb_needed)
atomic64_inc(&vm->tlb_seq);
@@ -1243,9 +1241,7 @@ int amdgpu_vm_update_range(struct amdgpu_device *adev, struct amdgpu_vm *vm,
start = tmp;
}
- r = vm->update_funcs->commit(¶ms, fence);
- if (r)
- goto error_free;
+ vm->update_funcs->commit(¶ms, fence);
if (params.needs_flush) {
amdgpu_vm_tlb_flush(¶ms, fence, tlb_cb);
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h
index d32183cd9e0f..3b237e78c8a8 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h
@@ -332,8 +332,8 @@ struct amdgpu_vm_update_funcs {
int (*update)(struct amdgpu_vm_update_params *p,
struct amdgpu_bo_vm *bo, uint64_t pe, uint64_t addr,
unsigned count, uint32_t incr, uint64_t flags);
- int (*commit)(struct amdgpu_vm_update_params *p,
- struct dma_fence **fence);
+ void (*commit)(struct amdgpu_vm_update_params *p,
+ struct dma_fence **fence);
};
struct amdgpu_vm_fault_info {
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm_cpu.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm_cpu.c
index b31ff6f56f0d..5c17946632cb 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm_cpu.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm_cpu.c
@@ -116,8 +116,8 @@ static int amdgpu_vm_cpu_update(struct amdgpu_vm_update_params *p,
*
* Make sure that the hardware sees the page table updates.
*/
-static int amdgpu_vm_cpu_commit(struct amdgpu_vm_update_params *p,
- struct dma_fence **fence)
+static void amdgpu_vm_cpu_commit(struct amdgpu_vm_update_params *p,
+ struct dma_fence **fence)
{
struct amdgpu_device *adev = p->adev;
@@ -127,12 +127,10 @@ static int amdgpu_vm_cpu_commit(struct amdgpu_vm_update_params *p,
mb();
/* A reset flushed the HDP anyway, so that here can be skipped when a reset is ongoing */
if (!down_read_trylock(&adev->reset_domain->sem))
- return 0;
+ return;
amdgpu_device_flush_hdp(adev, NULL);
up_read(&adev->reset_domain->sem);
-
- return 0;
}
const struct amdgpu_vm_update_funcs amdgpu_vm_cpu_funcs = {
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm_pt.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm_pt.c
index e43a60d09808..e9622adf1246 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm_pt.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm_pt.c
@@ -422,7 +422,7 @@ int amdgpu_vm_pt_clear(struct amdgpu_device *adev, struct amdgpu_vm *vm,
if (r)
goto exit;
- r = vm->update_funcs->commit(¶ms, NULL);
+ vm->update_funcs->commit(¶ms, NULL);
exit:
drm_dev_exit(idx);
return r;
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm_sdma.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm_sdma.c
index 50cc0779c340..9e3ade3cd646 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm_sdma.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm_sdma.c
@@ -100,11 +100,9 @@ static int amdgpu_vm_sdma_prepare(struct amdgpu_vm_update_params *p,
* @p: see amdgpu_vm_update_params definition
* @fence: resulting fence
*
- * Returns:
- * Negativ errno, 0 for success.
*/
-static int amdgpu_vm_sdma_commit(struct amdgpu_vm_update_params *p,
- struct dma_fence **fence)
+static void amdgpu_vm_sdma_commit(struct amdgpu_vm_update_params *p,
+ struct dma_fence **fence)
{
struct amdgpu_ib *ib = p->job->ibs;
struct amdgpu_ring *ring;
@@ -142,7 +140,6 @@ static int amdgpu_vm_sdma_commit(struct amdgpu_vm_update_params *p,
swap(*fence, f);
}
dma_fence_put(f);
- return 0;
}
/**
@@ -246,9 +243,7 @@ static int amdgpu_vm_sdma_update(struct amdgpu_vm_update_params *p,
ndw -= p->job->ibs->length_dw;
if (ndw < 32) {
- r = amdgpu_vm_sdma_commit(p, NULL);
- if (r)
- return r;
+ amdgpu_vm_sdma_commit(p, NULL);
r = amdgpu_vm_sdma_alloc_job(p, count,
AMDGPU_KERNEL_JOB_ID_VM_UPDATE);
---
base-commit: 62f4c998b297cf233997a2b4cd6fc2d2df0319c9
change-id: 20260923-amdgpu_vm_update_funcs_commit_void-7b6f145199b0
Best regards,
--
Thadeu Lima de Souza Cascardo <cascardo@igalia.com>
reply other threads:[~2026-09-24 14:58 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=20260924-amdgpu_vm_update_funcs_commit_void-v1-1-9ad7a8283920@igalia.com \
--to=cascardo@igalia.com \
--cc=airlied@gmail.com \
--cc=alexander.deucher@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=christian.koenig@amd.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=kernel-dev@igalia.com \
--cc=simona@ffwll.ch \
--cc=sumit.semwal@linaro.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