From: Timur Kristóf <[email protected]>

This is necessary to make soft reset work after a failed queue
reset. Otherwise the ring reset begin helper would clear out
the guilty fence and the backed up ring contents.

v2: skip the begin helper only for the guilty ring already backed up by
    the failed ring reset, and keep backing up the other rings (Jesse).

Signed-off-by: Timur Kristóf <[email protected]>
Signed-off-by: Jesse Zhang <[email protected]>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c
index be91143d9aed..40cf8342eee9 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c
@@ -1036,8 +1036,10 @@ void amdgpu_multi_ring_reset_helper_begin(struct 
amdgpu_device *adev,
                 * Backup current contents of the ring.
                 * The helper takes care to only reemit unsignalled fences
                 * so we don't have to worry about that here.
+                * A failed ring reset of the same job already backed it up.
                 */
-               amdgpu_ring_reset_helper_begin(ring, ring_guilty_fence);
+               if (ring != guilty_ring || ring->guilty_fence != guilty_fence)
+                       amdgpu_ring_reset_helper_begin(ring, ring_guilty_fence);
        }
 }
 
-- 
2.50.1

Reply via email to