Queue reset records into the WAIT_EVENT path when hung user queues are
detected and reset.

The user queue reset path already identifies the affected queue and
marks it as AMDGPU_USERQ_STATE_HUNG. Reuse that point to queue a
queue-scoped WAIT_EVENT reset record keyed by the queue doorbell index.

This does not change WAIT_EVENT UAPI semantics.

Cc: Alex Deucher <[email protected]>
Cc: Christian König <[email protected]>
Signed-off-by: Srinivasan Shanmugam <[email protected]>
---
 drivers/gpu/drm/amd/amdgpu/mes_userqueue.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/mes_userqueue.c 
b/drivers/gpu/drm/amd/amdgpu/mes_userqueue.c
index af29c1d8d699..e130ff9b5a7d 100644
--- a/drivers/gpu/drm/amd/amdgpu/mes_userqueue.c
+++ b/drivers/gpu/drm/amd/amdgpu/mes_userqueue.c
@@ -24,6 +24,7 @@
 #include <drm/drm_drv.h>
 #include "amdgpu.h"
 #include "amdgpu_gfx.h"
+#include "amdgpu_wait_event.h"
 #include "mes_userqueue.h"
 #include "amdgpu_userq_fence.h"
 
@@ -262,6 +263,13 @@ static int mes_userq_detect_and_reset(struct amdgpu_device 
*adev,
                                                                
DRM_AMDGPU_EVENT_TYPE_QUEUE_RESET,
                                                                
queue->doorbell_index);
 
+                                               if (queue->userq_mgr &&
+                                                   
queue->userq_mgr->wait_event_mgr)
+                                                       
amdgpu_wait_event_push_queue_reset(
+                                                               
queue->userq_mgr->wait_event_mgr,
+                                                               
queue->doorbell_index,
+                                                               0, 0, 0);
+
                                                found_hung_queue = true;
                                                
atomic_inc(&adev->gpu_reset_counter);
                                                
amdgpu_userq_fence_driver_force_completion(queue);
-- 
2.34.1

Reply via email to