From: Alex Deucher <[email protected]>

We need to increment the reset counter, force fence completion,
and set the wedged event when a user queue is reset.

mes_userq_reset_queue() handles this for collateral damage, but the
caller needs to handle this directly for the original guilty queue.

Signed-off-by: Alex Deucher <[email protected]>
Cc: Srinivasan Shanmugam <[email protected]>
Cc: Prike Liang <[email protected]>
Cc: Sunil Khatri <[email protected]>
Reviewed-by: Jesse Zhang <[email protected]>
Reviewed-by: Srinivasan Shanmugam <[email protected]>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c
index ab3ef3a9f655..fb0d335875af 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c
@@ -167,8 +167,13 @@ static void amdgpu_userq_hang_detect_work(struct 
work_struct *work)
                                                         queue, NULL, NULL);
                else
                        r = userq_funcs->reset(queue);
-               if (r)
+               if (r) {
                        gpu_reset = true;
+               } else {
+                       atomic_inc(&adev->gpu_reset_counter);
+                       amdgpu_userq_fence_driver_force_completion(queue);
+                       drm_dev_wedged_event(adev_to_drm(adev), 
DRM_WEDGE_RECOVERY_NONE, NULL);
+               }
        } else {
                gpu_reset = true;
        }
-- 
2.34.1

Reply via email to