AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v6 1/8] drm/amdgpu/userq: Fix doorbell object cleanup of queue
@ 2026-05-19 11:17 Sunil Khatri
  2026-05-19 11:17 ` [PATCH v6 2/8] drm/amdgpu/userq: Fix the mutex_init cleanup for fence_drv_lock Sunil Khatri
                   ` (7 more replies)
  0 siblings, 8 replies; 19+ messages in thread
From: Sunil Khatri @ 2026-05-19 11:17 UTC (permalink / raw)
  To: Alex Deucher, Christian König; +Cc: amd-gfx, Sunil Khatri

Unpin and unref the door bell obj if queue creation fails before
initialization is complete.

Signed-off-by: Sunil Khatri <sunil.khatri@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c
index 154742bdd5a6..eedea84c5e0f 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c
@@ -787,7 +787,7 @@ amdgpu_userq_create(struct drm_file *filp, union drm_amdgpu_userq *args)
 	r = uq_funcs->mqd_create(queue, &args->in);
 	if (r) {
 		drm_file_err(uq_mgr->file, "Failed to create Queue\n");
-		goto clean_mapping;
+		goto clean_doorbell_bo;
 	}
 
 	/* Update VM owner at userq submit-time for page-fault attribution. */
@@ -808,7 +808,7 @@ amdgpu_userq_create(struct drm_file *filp, union drm_amdgpu_userq *args)
 		if (r) {
 			drm_file_err(uq_mgr->file, "Failed to map Queue\n");
 			mutex_unlock(&uq_mgr->userq_mutex);
-			goto clean_doorbell;
+			goto erase_doorbell;
 		}
 	}
 
@@ -831,10 +831,15 @@ amdgpu_userq_create(struct drm_file *filp, union drm_amdgpu_userq *args)
 	args->out.queue_id = qid;
 	return 0;
 
-clean_doorbell:
+erase_doorbell:
 	xa_erase_irq(&adev->userq_doorbell_xa, index);
 clean_mqd:
 	uq_funcs->mqd_destroy(queue);
+clean_doorbell_bo:
+	amdgpu_bo_reserve(queue->db_obj.obj, true);
+	amdgpu_bo_unpin(queue->db_obj.obj);
+	amdgpu_bo_unreserve(queue->db_obj.obj);
+	amdgpu_bo_unref(&queue->db_obj.obj);
 clean_mapping:
 	amdgpu_bo_reserve(fpriv->vm.root.bo, true);
 	amdgpu_userq_buffer_vas_list_cleanup(adev, queue);
-- 
2.34.1


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

end of thread, other threads:[~2026-05-19 14:06 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-19 11:17 [PATCH v6 1/8] drm/amdgpu/userq: Fix doorbell object cleanup of queue Sunil Khatri
2026-05-19 11:17 ` [PATCH v6 2/8] drm/amdgpu/userq: Fix the mutex_init cleanup for fence_drv_lock Sunil Khatri
2026-05-19 12:38   ` Christian König
2026-05-19 13:09     ` Khatri, Sunil
2026-05-19 13:52       ` Christian König
2026-05-19 11:17 ` [PATCH v6 3/8] drm/amdgpu: simplify return value in amdgpu_userq_get_doorbell_index Sunil Khatri
2026-05-19 12:39   ` Christian König
2026-05-19 11:17 ` [PATCH v6 4/8] drm/amdgpu/userq: clean up wptr_obj along with mqd_destroy Sunil Khatri
2026-05-19 12:43   ` Christian König
2026-05-19 13:10     ` Khatri, Sunil
2026-05-19 11:17 ` [PATCH v6 5/8] drm/amdgpu/userq: add amdgpu_bo_unpin when amdgpu_ttm_alloc_gart fails Sunil Khatri
2026-05-19 13:53   ` Christian König
2026-05-19 11:17 ` [PATCH v6 6/8] drm/amdgpu/userq: reserve root bo without interruption Sunil Khatri
2026-05-19 13:54   ` Christian König
2026-05-19 11:18 ` [PATCH v6 7/8] drm/amdgpu/userq: make sure queue is valid in the hang_detect_work Sunil Khatri
2026-05-19 14:00   ` Christian König
2026-05-19 11:18 ` [PATCH v6 8/8] drm/amdgpu/userq: user array to store userq vas Sunil Khatri
2026-05-19 14:06   ` Christian König
2026-05-19 12:34 ` [PATCH v6 1/8] drm/amdgpu/userq: Fix doorbell object cleanup of queue Christian König

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox