Report a queue with an invalid virtual address as BROKEN, alongside hung
queues and queues whose VRAM has been lost. Use the existing BROKEN flag
instead of exposing a separate INVALID_VA status flag.

Signed-off-by: Prike Liang <[email protected]>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c | 1 +
 include/uapi/drm/amdgpu_drm.h             | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c
index b99fd7acdc1b..6340e647a67d 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c
@@ -832,6 +832,7 @@ amdgpu_userq_query_status(struct drm_file *filp, union 
drm_amdgpu_userq *args)
 
        args->out_qs.flags = 0;
        if (queue->state == AMDGPU_USERQ_STATE_HUNG ||
+           queue->state == AMDGPU_USERQ_STATE_INVALID_VA ||
            queue->generation != amdgpu_vm_generation(adev, &fpriv->vm))
                args->out_qs.flags |= AMDGPU_USERQ_QUERY_STATUS_FLAGS_BROKEN;
        amdgpu_userq_put(queue);
diff --git a/include/uapi/drm/amdgpu_drm.h b/include/uapi/drm/amdgpu_drm.h
index 71936418b0db..98c3fa8a4a72 100644
--- a/include/uapi/drm/amdgpu_drm.h
+++ b/include/uapi/drm/amdgpu_drm.h
@@ -353,7 +353,7 @@ union drm_amdgpu_ctx {
 /* for queues that need access to protected content */
 #define AMDGPU_USERQ_CREATE_FLAGS_QUEUE_SECURE  (1 << 2)
 
-/* the queue is broken because it is hung or VRAM was lost */
+/* the queue is broken because it is hung, has an invalid VA, or VRAM was lost 
*/
 #define AMDGPU_USERQ_QUERY_STATUS_FLAGS_BROKEN  (1 << 0)
 
 /*
-- 
2.34.1

Reply via email to