From: "Christian König" <christian.koenig@amd.com>
To: Thadeu Lima de Souza Cascardo <cascardo@igalia.com>,
Alex Deucher <alexander.deucher@amd.com>,
David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>,
Sumit Semwal <sumit.semwal@linaro.org>, Zihao Mu <zmu@amd.com>
Cc: amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
kernel-dev@igalia.com
Subject: Re: [PATCH 1/2] drm/amdgpu: make amdgpu_vm_update_funcs commit return void
Date: Fri, 4 Dec 2026 10:52:48 +0100 [thread overview]
Message-ID: <c965af38-e5db-407e-8fbb-c55fa9f0898d@amd.com> (raw)
In-Reply-To: <20261203-amdgpu_vm_update_funcs_cleanup-v1-1-bc9e80055e41@igalia.com>
On 12/3/26 22:41, Thadeu Lima de Souza Cascardo wrote:
> 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>
Reviewed-by: Christian König <christian.koenig@amd.com>
> ---
> drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 8 ++------
> drivers/gpu/drm/amd/amdgpu/amdgpu_vm_cpu.c | 8 +++-----
> drivers/gpu/drm/amd/amdgpu/amdgpu_vm_internal.h | 4 ++--
> 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 19177ff37ac8..f8f28cd99e15 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
> @@ -1073,9 +1073,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);
> @@ -1286,9 +1284,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_cpu.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm_cpu.c
> index d03b9bbe20c7..ec715bcaa0f2 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm_cpu.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm_cpu.c
> @@ -117,8 +117,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;
>
> @@ -128,12 +128,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_internal.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm_internal.h
> index 8ebb0b033291..0b7cc3a1701e 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm_internal.h
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm_internal.h
> @@ -111,8 +111,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);
> };
>
> int amdgpu_vm_pt_clear(struct amdgpu_device *adev, struct amdgpu_vm *vm,
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm_pt.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm_pt.c
> index 8f1e0bc7d65a..0eed53863604 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm_pt.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm_pt.c
> @@ -431,7 +431,7 @@ int amdgpu_vm_pt_clear(struct amdgpu_device *adev, struct amdgpu_vm *vm,
> if (r)
> goto exit;
>
> - r = vm->update_funcs->commit(¶ms, &vm->last_update);
> + vm->update_funcs->commit(¶ms, &vm->last_update);
> 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 d3a5e8487419..9b417bf3ea88 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm_sdma.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm_sdma.c
> @@ -101,11 +101,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;
> @@ -143,7 +141,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);
>
next prev parent reply other threads:[~2026-12-04 9:53 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-03 21:41 [PATCH 0/2] drm/amdgpu: Small cleanup for amdgpu_vm_update_funcs Thadeu Lima de Souza Cascardo
2026-12-03 21:41 ` [PATCH 1/2] drm/amdgpu: make amdgpu_vm_update_funcs commit return void Thadeu Lima de Souza Cascardo
2026-12-04 9:52 ` Christian König [this message]
2026-12-04 14:41 ` Alex Deucher
2026-12-03 21:41 ` [PATCH 2/2] drm/amdgpu: pass job id as part of amdgpu_vm_update_params Thadeu Lima de Souza Cascardo
2026-12-03 22:01 ` sashiko-bot
2026-12-04 9:53 ` Christian König
-- strict thread matches above, loose matches on Subject: below --
2026-09-29 20:34 [PATCH 0/2] drm/amdgpu: fix memleak when amdgpu_vm_ptes_update fails Thadeu Lima de Souza Cascardo
2026-09-29 20:34 ` [PATCH 1/2] drm/amdgpu: make amdgpu_vm_update_funcs commit return void Thadeu Lima de Souza Cascardo
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=c965af38-e5db-407e-8fbb-c55fa9f0898d@amd.com \
--to=christian.koenig@amd.com \
--cc=airlied@gmail.com \
--cc=alexander.deucher@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=cascardo@igalia.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=kernel-dev@igalia.com \
--cc=simona@ffwll.ch \
--cc=sumit.semwal@linaro.org \
--cc=zmu@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.