When a privilege fault occurs in a user queue context, the GPU may be left in a 
hang state.
To handle this gracefully and recover the GPU, schedule a user queue reset via 
amdgpu_reset_domain_schedule.

Signed-off-by: Jesse Zhang <[email protected]>
---
 drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c 
b/drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c
index 3a4ca104b161..a2bc4e86e619 100644
--- a/drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c
@@ -50,6 +50,7 @@
 #include "mes_v11_0.h"
 #include "mes_userqueue.h"
 #include "amdgpu_userq_fence.h"
+#include "amdgpu_reset.h"
 
 #define GFX11_NUM_GFX_RINGS            1
 #define GFX11_MEC_HPD_SIZE     2048
@@ -6653,6 +6654,10 @@ static void gfx_v11_0_handle_priv_fault(struct 
amdgpu_device *adev,
                        BUG();
                        break;
                }
+       } else {
+               /*TODO: schedule a user queue reset work */
+               amdgpu_reset_domain_schedule(adev->reset_domain,
+                                                        
&adev->userq_reset_work);
        }
 }
 
-- 
2.49.0

Reply via email to