diff options
| author | Christian König <[email protected]> | 2023-04-17 11:04:06 +0000 |
|---|---|---|
| committer | Alex Deucher <[email protected]> | 2023-06-15 15:37:55 +0000 |
| commit | 89fae8dc41d0a9bfc9fc1ea7ec03bf36e680774d (patch) | |
| tree | a2e7eb374e5d415bd8016ab494141c1638fdcbd0 /drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c | |
| parent | drm/amdgpu: mark force completed fences with -ECANCELED (diff) | |
| download | kernel-89fae8dc41d0a9bfc9fc1ea7ec03bf36e680774d.tar.gz kernel-89fae8dc41d0a9bfc9fc1ea7ec03bf36e680774d.zip | |
drm/amdgpu: mark soft recovered fences with -ENODATA
Set the fence error code before trying to soft-recover it.
It gets overwritten when a hard recovery is required.
Signed-off-by: Christian König <[email protected]>
Reviewed-by: Luben Tuikov <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c')
| -rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c index 9fd55a10da19..80d6e132e409 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c @@ -433,11 +433,18 @@ void amdgpu_ring_emit_reg_write_reg_wait_helper(struct amdgpu_ring *ring, bool amdgpu_ring_soft_recovery(struct amdgpu_ring *ring, unsigned int vmid, struct dma_fence *fence) { + unsigned long flags; + ktime_t deadline = ktime_add_us(ktime_get(), 10000); if (amdgpu_sriov_vf(ring->adev) || !ring->funcs->soft_recovery || !fence) return false; + spin_lock_irqsave(fence->lock, flags); + if (!dma_fence_is_signaled_locked(fence)) + dma_fence_set_error(fence, -ENODATA); + spin_unlock_irqrestore(fence->lock, flags); + atomic_inc(&ring->adev->gpu_reset_counter); while (!dma_fence_is_signaled(fence) && ktime_to_ns(ktime_sub(deadline, ktime_get())) > 0) |
