summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c
diff options
context:
space:
mode:
authorSrinivasan Shanmugam <srinivasan.shanmugam@amd.com>2026-02-10 20:25:05 +0530
committerAlex Deucher <alexander.deucher@amd.com>2026-02-23 14:16:31 -0500
commit7abc868acf804e1340b6e2978c255fa490710543 (patch)
treeb6d7222e9577884209a536613297b543aa29fb10 /drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c
parentd3499de3b737f3f6a2058382f7bff641c74f52a4 (diff)
downloadlinux-next-7abc868acf804e1340b6e2978c255fa490710543.tar.gz
linux-next-7abc868acf804e1340b6e2978c255fa490710543.zip
drm/amdgpu: Make amdgpu_fence_emit() non-failing v2
dma_fence_wait(old, false) is not interruptible and cannot return an error. Drop the unreachable error handling in amdgpu_fence_emit(). Since the function can no longer fail, convert amdgpu_fence_emit() to return void and remove return value handling from all callers. v2: - Add comment explaining why dma_fence_wait(..., false) return value is ignored (Alex) Suggested-by: Christian König <christian.koenig@amd.com> Cc: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Srinivasan Shanmugam <srinivasan.shanmugam@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c
index 1054d66c54fa..07568516c506 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c
@@ -107,16 +107,14 @@ static void amdgpu_fence_save_fence_wptr_end(struct amdgpu_fence *af)
* @flags: flags to pass into the subordinate .emit_fence() call
*
* Emits a fence command on the requested ring (all asics).
- * Returns 0 on success, -ENOMEM on failure.
*/
-int amdgpu_fence_emit(struct amdgpu_ring *ring, struct amdgpu_fence *af,
- unsigned int flags)
+void amdgpu_fence_emit(struct amdgpu_ring *ring, struct amdgpu_fence *af,
+ unsigned int flags)
{
struct amdgpu_device *adev = ring->adev;
struct dma_fence *fence;
struct dma_fence __rcu **ptr;
uint32_t seq;
- int r;
fence = &af->base;
af->ring = ring;
@@ -141,10 +139,13 @@ int amdgpu_fence_emit(struct amdgpu_ring *ring, struct amdgpu_fence *af,
rcu_read_unlock();
if (old) {
- r = dma_fence_wait(old, false);
+ /*
+ * dma_fence_wait(old, false) is not interruptible.
+ * It will not return an error in this case.
+ * So we can safely ignore the return value.
+ */
+ dma_fence_wait(old, false);
dma_fence_put(old);
- if (r)
- return r;
}
}
@@ -154,8 +155,6 @@ int amdgpu_fence_emit(struct amdgpu_ring *ring, struct amdgpu_fence *af,
* emitting the fence would mess up the hardware ring buffer.
*/
rcu_assign_pointer(*ptr, dma_fence_get(fence));
-
- return 0;
}
/**