All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH RESEND 1/4] drm/amdgpu: add UAPI for user queue query status
@ 2026-11-17  7:23 Prike Liang
  2026-11-17  7:23 ` [PATCH RESEND 2/4] drm/amdgpu/userq: implement support for " Prike Liang
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Prike Liang @ 2026-11-17  7:23 UTC (permalink / raw)
  To: amd-gfx
  Cc: Alexander.Deucher, Christian.Koenig, Pierre-eric.Pelloux-prayer,
	Alex Deucher, Christian König, Sunil Khatri, Prike Liang

From: Alex Deucher <alexander.deucher@amd.com>

Add an API to query whether a queue is broken because it is hung or
VRAM has been lost. Report either condition through a single BROKEN flag.

Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Sunil Khatri <sunil.khatri@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Prike Liang <Prike.Liang@amd.com>
---
 include/uapi/drm/amdgpu_drm.h | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/include/uapi/drm/amdgpu_drm.h b/include/uapi/drm/amdgpu_drm.h
index 29009f6aabde..a1da2833610f 100644
--- a/include/uapi/drm/amdgpu_drm.h
+++ b/include/uapi/drm/amdgpu_drm.h
@@ -340,6 +340,7 @@ union drm_amdgpu_ctx {
 /* user queue IOCTL operations */
 #define AMDGPU_USERQ_OP_CREATE	1
 #define AMDGPU_USERQ_OP_FREE	2
+#define AMDGPU_USERQ_OP_QUERY_STATUS	3
 
 /* queue priority levels */
 /* low < normal low < normal high < high */
@@ -352,6 +353,9 @@ 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 */
+#define AMDGPU_USERQ_QUERY_STATUS_FLAGS_BROKEN  (1 << 0)
+
 /*
  * This structure is a container to pass input configuration
  * info for all supported userqueue related operations.
@@ -433,9 +437,16 @@ struct drm_amdgpu_userq_out {
 	__u32 _pad;
 };
 
+/* The structure to carry output of userqueue ops */
+struct drm_amdgpu_userq_out_query_state {
+	__u32 flags;
+	__u32 _pad;
+};
+
 union drm_amdgpu_userq {
 	struct drm_amdgpu_userq_in in;
 	struct drm_amdgpu_userq_out out;
+	struct drm_amdgpu_userq_out_query_state out_qs;
 };
 
 /* GFX V11 IP specific MQD parameters */
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH RESEND 2/4] drm/amdgpu/userq: implement support for query status
  2026-11-17  7:23 [PATCH RESEND 1/4] drm/amdgpu: add UAPI for user queue query status Prike Liang
@ 2026-11-17  7:23 ` Prike Liang
  2026-11-17  7:41   ` sashiko-bot
  2026-11-17  7:23 ` [PATCH RESEND 3/4] drm/amdgpu/userq: report invalid VA through the broken status flag Prike Liang
  2026-11-17  7:23 ` [PATCH RESEND 4/4] drm/amdgpu/userq: report GPU reset in progress Prike Liang
  2 siblings, 1 reply; 6+ messages in thread
From: Prike Liang @ 2026-11-17  7:23 UTC (permalink / raw)
  To: amd-gfx
  Cc: Alexander.Deucher, Christian.Koenig, Pierre-eric.Pelloux-prayer,
	Alex Deucher, Prike Liang, Sunil Khatri

From: Alex Deucher <alexander.deucher@amd.com>

Query the status of the user queue. Report BROKEN when the queue is hung
or its VM generation indicates that VRAM has been lost.

v2: Misc cleanups

Reviewed-by: Prike Liang <Prike.Liang@amd.com>
Reviewed-by: Sunil Khatri <sunil.khatri@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Prike Liang <Prike.Liang@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c | 34 +++++++++++++++++++++++
 drivers/gpu/drm/amd/amdgpu/amdgpu_userq.h |  1 +
 2 files changed, 35 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c
index ed6f3b67e872..496137fca1f0 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c
@@ -702,6 +702,7 @@ amdgpu_userq_create(struct drm_file *filp, union drm_amdgpu_userq *args)
 	queue->queue_type = args->in.ip_type;
 	queue->vm = &fpriv->vm;
 	queue->priority = priority;
+	queue->generation = amdgpu_vm_generation(adev, &fpriv->vm);
 	queue->xcp_id = (fpriv->xcp_id != AMDGPU_XCP_NO_PARTITION) ?
 				fpriv->xcp_id : 0;
 	queue->userq_mgr = uq_mgr;
@@ -817,6 +818,33 @@ amdgpu_userq_create(struct drm_file *filp, union drm_amdgpu_userq *args)
 	return r;
 }
 
+static int
+amdgpu_userq_query_status(struct drm_file *filp, union drm_amdgpu_userq *args)
+{
+	struct amdgpu_fpriv *fpriv = filp->driver_priv;
+	struct amdgpu_userq_mgr *uq_mgr = &fpriv->userq_mgr;
+	struct amdgpu_device *adev = uq_mgr->adev;
+	struct amdgpu_usermode_queue *queue;
+	int queue_id = args->in.queue_id;
+
+	mutex_lock(&uq_mgr->userq_mutex);
+
+	queue = amdgpu_userq_get(uq_mgr, queue_id);
+	if (!queue) {
+		mutex_unlock(&uq_mgr->userq_mutex);
+		return -EINVAL;
+	}
+
+	args->out_qs.flags = 0;
+	if (queue->state == AMDGPU_USERQ_STATE_HUNG ||
+	    queue->generation != amdgpu_vm_generation(adev, &fpriv->vm))
+		args->out_qs.flags |= AMDGPU_USERQ_QUERY_STATUS_FLAGS_BROKEN;
+	amdgpu_userq_put(queue);
+	mutex_unlock(&uq_mgr->userq_mutex);
+
+	return 0;
+}
+
 static int amdgpu_userq_input_args_validate(struct drm_device *dev,
 					union drm_amdgpu_userq *args,
 					struct drm_file *filp)
@@ -938,6 +966,12 @@ int amdgpu_userq_ioctl(struct drm_device *dev, void *data,
 		break;
 	}
 
+	case AMDGPU_USERQ_OP_QUERY_STATUS:
+		r = amdgpu_userq_query_status(filp, args);
+		if (r)
+			drm_dbg_driver(dev, "Failed to query usermode queue status\n");
+		break;
+
 	default:
 		drm_dbg_driver(dev, "Invalid user queue op specified: %d\n", args->in.op);
 		return -EINVAL;
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_userq.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_userq.h
index 488dc21d7c81..d1a2e2a45861 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_userq.h
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_userq.h
@@ -79,6 +79,7 @@ struct amdgpu_usermode_queue {
 	struct dma_fence	*last_fence;
 	u32			xcp_id;
 	int			priority;
+	uint64_t		generation;
 	struct dentry		*debugfs_queue;
 
 	/**
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH RESEND 3/4] drm/amdgpu/userq: report invalid VA through the broken status flag
  2026-11-17  7:23 [PATCH RESEND 1/4] drm/amdgpu: add UAPI for user queue query status Prike Liang
  2026-11-17  7:23 ` [PATCH RESEND 2/4] drm/amdgpu/userq: implement support for " Prike Liang
@ 2026-11-17  7:23 ` Prike Liang
  2026-11-17  7:42   ` sashiko-bot
  2026-11-17  7:23 ` [PATCH RESEND 4/4] drm/amdgpu/userq: report GPU reset in progress Prike Liang
  2 siblings, 1 reply; 6+ messages in thread
From: Prike Liang @ 2026-11-17  7:23 UTC (permalink / raw)
  To: amd-gfx
  Cc: Alexander.Deucher, Christian.Koenig, Pierre-eric.Pelloux-prayer,
	Prike Liang

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 <Prike.Liang@amd.com>
---
 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 496137fca1f0..b48cf2a2118c 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c
@@ -837,6 +837,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 a1da2833610f..6c0992d06fcf 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


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH RESEND 4/4] drm/amdgpu/userq: report GPU reset in progress
  2026-11-17  7:23 [PATCH RESEND 1/4] drm/amdgpu: add UAPI for user queue query status Prike Liang
  2026-11-17  7:23 ` [PATCH RESEND 2/4] drm/amdgpu/userq: implement support for " Prike Liang
  2026-11-17  7:23 ` [PATCH RESEND 3/4] drm/amdgpu/userq: report invalid VA through the broken status flag Prike Liang
@ 2026-11-17  7:23 ` Prike Liang
  2 siblings, 0 replies; 6+ messages in thread
From: Prike Liang @ 2026-11-17  7:23 UTC (permalink / raw)
  To: amd-gfx
  Cc: Alexander.Deucher, Christian.Koenig, Pierre-eric.Pelloux-prayer,
	Prike Liang

Report an ongoing GPU reset through RESET_IN_PROGRESS at bit 1, alongside
BROKEN at bit 0, so userspace can query whether GPU recovery is ongoing.

Validate query inputs using the same rules as queue deletion and document
the required fields. Drop the queue reference after releasing userq_mutex
because the final put may destroy the queue and acquire that mutex.

Signed-off-by: Prike Liang <Prike.Liang@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c | 6 +++++-
 include/uapi/drm/amdgpu_drm.h             | 8 +++++---
 2 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c
index b48cf2a2118c..f5e152bf5529 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c
@@ -840,8 +840,11 @@ amdgpu_userq_query_status(struct drm_file *filp, union drm_amdgpu_userq *args)
 	    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);
+	if (amdgpu_in_reset(adev))
+		args->out_qs.flags |= AMDGPU_USERQ_QUERY_STATUS_FLAGS_RESET_IN_PROGRESS;
 	mutex_unlock(&uq_mgr->userq_mutex);
+	/* The final put may destroy the queue and take userq_mutex. */
+	amdgpu_userq_put(queue);
 
 	return 0;
 }
@@ -903,6 +906,7 @@ static int amdgpu_userq_input_args_validate(struct drm_device *dev,
 		}
 		break;
 	case AMDGPU_USERQ_OP_FREE:
+	case AMDGPU_USERQ_OP_QUERY_STATUS:
 		if (args->in.ip_type ||
 		    args->in.doorbell_handle ||
 		    args->in.doorbell_offset ||
diff --git a/include/uapi/drm/amdgpu_drm.h b/include/uapi/drm/amdgpu_drm.h
index 6c0992d06fcf..cde359344929 100644
--- a/include/uapi/drm/amdgpu_drm.h
+++ b/include/uapi/drm/amdgpu_drm.h
@@ -355,19 +355,21 @@ union drm_amdgpu_ctx {
 
 /* 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)
+/* indicate that a GPU reset has not completed yet */
+#define AMDGPU_USERQ_QUERY_STATUS_FLAGS_RESET_IN_PROGRESS (1 << 1)
 
 /*
  * This structure is a container to pass input configuration
  * info for all supported userqueue related operations.
  * For operation AMDGPU_USERQ_OP_CREATE: user is expected
  *  to set all fields, excep the parameter 'queue_id'.
- * For operation AMDGPU_USERQ_OP_FREE: the only input parameter expected
- *  to be set is 'queue_id', eveything else is ignored.
+ * For operations AMDGPU_USERQ_OP_FREE and AMDGPU_USERQ_OP_QUERY_STATUS:
+ *  only 'op' and 'queue_id' should be set; all other fields must be zero.
  */
 struct drm_amdgpu_userq_in {
 	/** AMDGPU_USERQ_OP_* */
 	__u32	op;
-	/** Queue id passed for operation USERQ_OP_FREE */
+	/** Queue id passed for operations USERQ_OP_FREE and USERQ_OP_QUERY_STATUS */
 	__u32	queue_id;
 	/** the target GPU engine to execute workload (AMDGPU_HW_IP_*) */
 	__u32   ip_type;
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH RESEND 2/4] drm/amdgpu/userq: implement support for query status
  2026-11-17  7:23 ` [PATCH RESEND 2/4] drm/amdgpu/userq: implement support for " Prike Liang
@ 2026-11-17  7:41   ` sashiko-bot
  0 siblings, 0 replies; 6+ messages in thread
From: sashiko-bot @ 2026-11-17  7:41 UTC (permalink / raw)
  To: Prike Liang, amd-gfx

Thank you for your contribution! Sashiko AI review found no new issues
in this patch, but noticed 1 related pre-existing issue it does not
introduce:
- [High] drm/amdgpu/userq: unlocked queue state and unmap/map in
  mes_userq_reset() [1]
--

commit 8f1348ec761b7ada9e6ca46fe71c338002a3662a
Author: Alex Deucher <alexander.deucher@amd.com>

drm/amdgpu/userq: implement support for query status

This commit implements the AMDGPU_USERQ_OP_QUERY_STATUS operation to report
when a usermode queue is hung or its VM generation has changed due to lost
VRAM.

> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c
> index ed6f3b67e8720..496137fca1f0c 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c
[ ... ]
> @@ -817,6 +818,33 @@ amdgpu_userq_create(struct drm_file *filp, union drm_amdgpu_userq *args)
>  	return r;
>  }
>  
> +static int
> +amdgpu_userq_query_status(struct drm_file *filp, union drm_amdgpu_userq *args)
> +{
> +	struct amdgpu_fpriv *fpriv = filp->driver_priv;
> +	struct amdgpu_userq_mgr *uq_mgr = &fpriv->userq_mgr;
> +	struct amdgpu_device *adev = uq_mgr->adev;
> +	struct amdgpu_usermode_queue *queue;
> +	int queue_id = args->in.queue_id;
> +
> +	mutex_lock(&uq_mgr->userq_mutex);
> +
> +	queue = amdgpu_userq_get(uq_mgr, queue_id);
> +	if (!queue) {
> +		mutex_unlock(&uq_mgr->userq_mutex);
> +		return -EINVAL;
> +	}
> +
> +	args->out_qs.flags = 0;
> +	if (queue->state == AMDGPU_USERQ_STATE_HUNG ||
> +	    queue->generation != amdgpu_vm_generation(adev, &fpriv->vm))
> +		args->out_qs.flags |= AMDGPU_USERQ_QUERY_STATUS_FLAGS_BROKEN;

[Severity: High]
This problem wasn't introduced by this patch, but can a concurrent eviction
in amdgpu_userq_unmap_helper() race with mes_userq_reset_hw() [1] and
overwrite AMDGPU_USERQ_STATE_HUNG?

amdgpu_userq_query_status() and amdgpu_userq_unmap_helper() serialize
queue->state under uq_mgr->userq_mutex, whereas mes_userq_reset_hw() unmaps
the queue and sets queue->state = AMDGPU_USERQ_STATE_HUNG without holding
userq_mutex:

CPU0                                  CPU1
amdgpu_userq_hang_detect_work()       amdgpu_eviction_fence_suspend_worker()
  mes_userq_reset()                     mutex_lock(&uq_mgr->userq_mutex)
    mes_userq_reset_hw()                amdgpu_userq_evict_all()
      mes_userq_unmap(queue)              amdgpu_userq_unmap_helper(queue)
                                            // sees AMDGPU_USERQ_STATE_MAPPED
                                            mes_userq_unmap(queue)
      queue->state =
        AMDGPU_USERQ_STATE_HUNG
                                            queue->state =
                                              AMDGPU_USERQ_STATE_UNMAPPED
                                              <-- clobbers HUNG state
                                        mutex_unlock(&uq_mgr->userq_mutex)

Both paths call mes_userq_unmap() concurrently, issuing duplicate
remove_hw_queue MES packets and double-freeing queue->gang_ctx_array_index.
Overwriting AMDGPU_USERQ_STATE_HUNG with AMDGPU_USERQ_STATE_UNMAPPED also
hides the broken status from amdgpu_userq_query_status() and allows
amdgpu_userq_restore_worker() to remap and re-execute the hung queue.

[1] https://sashiko.dev/#/bug/linux-ea51473b-6c36-421a-880f-c4fff09847a7

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261117072353.537506-1-Prike.Liang@amd.com?part=2

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH RESEND 3/4] drm/amdgpu/userq: report invalid VA through the broken status flag
  2026-11-17  7:23 ` [PATCH RESEND 3/4] drm/amdgpu/userq: report invalid VA through the broken status flag Prike Liang
@ 2026-11-17  7:42   ` sashiko-bot
  0 siblings, 0 replies; 6+ messages in thread
From: sashiko-bot @ 2026-11-17  7:42 UTC (permalink / raw)
  To: Prike Liang, amd-gfx

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Medium] drm/amdgpu/userq: missing resume_work flush in
  amdgpu_userq_query_status()
--

commit dcee7ab7a079dac06e55c3b0a31589e130baf8e9
Author: Prike Liang <Prike.Liang@amd.com>

drm/amdgpu/userq: report invalid VA through the broken status flag

This commit sets AMDGPU_USERQ_QUERY_STATUS_FLAGS_BROKEN in
amdgpu_userq_query_status() when a usermode queue is in
AMDGPU_USERQ_STATE_INVALID_VA, and updates the UAPI comment in
amdgpu_drm.h.

> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c
> index 496137fca1f0c..b48cf2a2118c0 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c
> @@ -837,6 +837,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);

[Severity: Medium]
Can amdgpu_userq_query_status() miss AMDGPU_USERQ_STATE_INVALID_VA when
called before uq_mgr->resume_work finishes?

The only place that sets queue->state to AMDGPU_USERQ_STATE_INVALID_VA is
amdgpu_userq_restore_all(), which runs asynchronously from
uq_mgr->resume_work:

CPU0                                  kworker
amdgpu_gem_va_ioctl(UNMAP)
  amdgpu_userq_gem_va_unmap_validate()
    dma_resv_wait_timeout()
                                      amdgpu_eviction_fence_suspend_worker()
                                        amdgpu_userq_evict()
                                          queue->state =
                                            AMDGPU_USERQ_STATE_UNMAPPED
                                        dma_fence_signal(ev_fence)
                                        schedule_delayed_work(
                                          &uq_mgr->resume_work, 0)
  drm_exec_fini()
amdgpu_userq_query_status()
  mutex_lock(&uq_mgr->userq_mutex)
  queue->state ==
    AMDGPU_USERQ_STATE_UNMAPPED  <-- BROKEN not set
  mutex_unlock(&uq_mgr->userq_mutex)
                                      amdgpu_userq_restore_worker()
                                        ...
                                        amdgpu_userq_restore_all()
                                          queue->state =
                                            AMDGPU_USERQ_STATE_INVALID_VA

Because amdgpu_gem_va_ioctl() holds the VM reservation lock until
drm_exec_fini() just before returning to userspace, uq_mgr->resume_work
cannot finish validating the VM and calling amdgpu_userq_restore_all()
before the unmap ioctl returns.  Unlike amdgpu_userq_ensure_ev_fence(),
amdgpu_userq_query_status() does not call
flush_delayed_work(&uq_mgr->resume_work) before acquiring
uq_mgr->userq_mutex, so querying queue status after unmapping a queue VA
reports flags as 0 instead of AMDGPU_USERQ_QUERY_STATUS_FLAGS_BROKEN.

Also, if a queue VA mapping is removed via AMDGPU_VA_OP_CLEAR or
AMDGPU_VA_OP_REPLACE (amdgpu_vm_bo_clear_mappings()),
amdgpu_userq_gem_va_unmap_validate() is never called to trigger eviction and
transition the queue to AMDGPU_USERQ_STATE_INVALID_VA.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261117072353.537506-1-Prike.Liang@amd.com?part=3

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2026-11-17  7:42 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-17  7:23 [PATCH RESEND 1/4] drm/amdgpu: add UAPI for user queue query status Prike Liang
2026-11-17  7:23 ` [PATCH RESEND 2/4] drm/amdgpu/userq: implement support for " Prike Liang
2026-11-17  7:41   ` sashiko-bot
2026-11-17  7:23 ` [PATCH RESEND 3/4] drm/amdgpu/userq: report invalid VA through the broken status flag Prike Liang
2026-11-17  7:42   ` sashiko-bot
2026-11-17  7:23 ` [PATCH RESEND 4/4] drm/amdgpu/userq: report GPU reset in progress Prike Liang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.