drm/amdgpu: make amdgpu_vm_update_funcs commit return void
Subsystems (2)
PATCH 1/1 drm/amdgpu: make amdgpu_vm_update_funcs commit return void
As both SDMA and CPU implementations always return 0, they can as well just return void.
Signed-off-by Thadeu Lima de Souza Cascardo <[email protected]>
--- 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(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +2 -6
@@ -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);
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h +2 -2
@@ -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 {
drivers/gpu/drm/amd/amdgpu/amdgpu_vm_cpu.c +3 -5
@@ -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 = {
drivers/gpu/drm/amd/amdgpu/amdgpu_vm_pt.c +1 -1
@@ -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;
drivers/gpu/drm/amd/amdgpu/amdgpu_vm_sdma.c +3 -8
@@ -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,
Signature · 1 line
Thadeu Lima de Souza Cascardo <[email protected]>