AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1 1/2] drm/amdgpu/userq: remove queue from doorbell xarray
@ 2026-03-03 17:11 Sunil Khatri
  2026-03-03 17:11 ` [PATCH v1 2/2] drm/amdgpu/userq: remove queue from doorbell xa during clean up Sunil Khatri
  2026-03-04 13:09 ` [PATCH v1 1/2] drm/amdgpu/userq: remove queue from doorbell xarray Khatri, Sunil
  0 siblings, 2 replies; 4+ messages in thread
From: Sunil Khatri @ 2026-03-03 17:11 UTC (permalink / raw)
  To: Alex Deucher, Christian König; +Cc: amd-gfx, Sunil Khatri

In case of failure in xa_alloc, remove the queue during
clean up from the userq_doorbell_xa.

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

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c
index 001fcfcbde0f..5224871a099c 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c
@@ -865,6 +865,7 @@ amdgpu_userq_create(struct drm_file *filp, union drm_amdgpu_userq *args)
 	if (r) {
 		drm_file_err(uq_mgr->file, "Failed to allocate a queue id\n");
 		amdgpu_userq_fence_driver_free(queue);
+		xa_erase_irq(&adev->userq_doorbell_xa, index);
 		uq_funcs->mqd_destroy(queue);
 		kfree(queue);
 		r = -ENOMEM;
-- 
2.34.1


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

* [PATCH v1 2/2] drm/amdgpu/userq: remove queue from doorbell xa during clean up
  2026-03-03 17:11 [PATCH v1 1/2] drm/amdgpu/userq: remove queue from doorbell xarray Sunil Khatri
@ 2026-03-03 17:11 ` Sunil Khatri
  2026-03-04 13:09 ` [PATCH v1 1/2] drm/amdgpu/userq: remove queue from doorbell xarray Khatri, Sunil
  1 sibling, 0 replies; 4+ messages in thread
From: Sunil Khatri @ 2026-03-03 17:11 UTC (permalink / raw)
  To: Alex Deucher, Christian König; +Cc: amd-gfx, Sunil Khatri

If function amdgpu_userq_map_helper fails we do need to clean
up and remove the queue from the userq_doorbell_xa.

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

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c
index 5224871a099c..7d2f78899c47 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c
@@ -885,6 +885,7 @@ amdgpu_userq_create(struct drm_file *filp, union drm_amdgpu_userq *args)
 		r = amdgpu_userq_map_helper(queue);
 		if (r) {
 			drm_file_err(uq_mgr->file, "Failed to map Queue\n");
+			xa_erase_irq(&adev->userq_doorbell_xa, index);
 			xa_erase(&uq_mgr->userq_xa, qid);
 			amdgpu_userq_fence_driver_free(queue);
 			uq_funcs->mqd_destroy(queue);
-- 
2.34.1


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

* Re: [PATCH v1 1/2] drm/amdgpu/userq: remove queue from doorbell xarray
  2026-03-03 17:11 [PATCH v1 1/2] drm/amdgpu/userq: remove queue from doorbell xarray Sunil Khatri
  2026-03-03 17:11 ` [PATCH v1 2/2] drm/amdgpu/userq: remove queue from doorbell xa during clean up Sunil Khatri
@ 2026-03-04 13:09 ` Khatri, Sunil
  2026-03-05 10:41   ` Christian König
  1 sibling, 1 reply; 4+ messages in thread
From: Khatri, Sunil @ 2026-03-04 13:09 UTC (permalink / raw)
  To: Deucher, Alexander, Koenig, Christian; +Cc: amd-gfx@lists.freedesktop.org

[-- Attachment #1: Type: text/plain, Size: 1431 bytes --]

[AMD Official Use Only - AMD Internal Distribution Only]

Ping

Get Outlook for iOS<https://aka.ms/o0ukef>
________________________________
From: Sunil Khatri <sunil.khatri@amd.com>
Sent: Tuesday, March 3, 2026 10:41:10 PM
To: Deucher, Alexander <Alexander.Deucher@amd.com>; Koenig, Christian <Christian.Koenig@amd.com>
Cc: amd-gfx@lists.freedesktop.org <amd-gfx@lists.freedesktop.org>; Khatri, Sunil <Sunil.Khatri@amd.com>
Subject: [PATCH v1 1/2] drm/amdgpu/userq: remove queue from doorbell xarray

In case of failure in xa_alloc, remove the queue during
clean up from the userq_doorbell_xa.

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

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c
index 001fcfcbde0f..5224871a099c 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c
@@ -865,6 +865,7 @@ amdgpu_userq_create(struct drm_file *filp, union drm_amdgpu_userq *args)
         if (r) {
                 drm_file_err(uq_mgr->file, "Failed to allocate a queue id\n");
                 amdgpu_userq_fence_driver_free(queue);
+               xa_erase_irq(&adev->userq_doorbell_xa, index);
                 uq_funcs->mqd_destroy(queue);
                 kfree(queue);
                 r = -ENOMEM;
--
2.34.1


[-- Attachment #2: Type: text/html, Size: 3305 bytes --]

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

* Re: [PATCH v1 1/2] drm/amdgpu/userq: remove queue from doorbell xarray
  2026-03-04 13:09 ` [PATCH v1 1/2] drm/amdgpu/userq: remove queue from doorbell xarray Khatri, Sunil
@ 2026-03-05 10:41   ` Christian König
  0 siblings, 0 replies; 4+ messages in thread
From: Christian König @ 2026-03-05 10:41 UTC (permalink / raw)
  To: Khatri, Sunil, Deucher, Alexander; +Cc: amd-gfx@lists.freedesktop.org

Reviewed-by: Christian König <christian.koenig@amd.com> for both.

On 3/4/26 14:09, Khatri, Sunil wrote:
> [AMD Official Use Only - AMD Internal Distribution Only]
> 
> 
> Ping
> 
> Get Outlook for iOS <https://aka.ms/o0ukef>
> ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
> *From:* Sunil Khatri <sunil.khatri@amd.com>
> *Sent:* Tuesday, March 3, 2026 10:41:10 PM
> *To:* Deucher, Alexander <Alexander.Deucher@amd.com>; Koenig, Christian <Christian.Koenig@amd.com>
> *Cc:* amd-gfx@lists.freedesktop.org <amd-gfx@lists.freedesktop.org>; Khatri, Sunil <Sunil.Khatri@amd.com>
> *Subject:* [PATCH v1 1/2] drm/amdgpu/userq: remove queue from doorbell xarray
>  
> In case of failure in xa_alloc, remove the queue during
> clean up from the userq_doorbell_xa.
> 
> Signed-off-by: Sunil Khatri <sunil.khatri@amd.com>
> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c
> index 001fcfcbde0f..5224871a099c 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c
> @@ -865,6 +865,7 @@ amdgpu_userq_create(struct drm_file *filp, union drm_amdgpu_userq *args)
>          if (r) {
>                  drm_file_err(uq_mgr->file, "Failed to allocate a queue id\n");
>                  amdgpu_userq_fence_driver_free(queue);
> +               xa_erase_irq(&adev->userq_doorbell_xa, index);
>                  uq_funcs->mqd_destroy(queue);
>                  kfree(queue);
>                  r = -ENOMEM;
> -- 
> 2.34.1
> 


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

end of thread, other threads:[~2026-03-05 10:41 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-03 17:11 [PATCH v1 1/2] drm/amdgpu/userq: remove queue from doorbell xarray Sunil Khatri
2026-03-03 17:11 ` [PATCH v1 2/2] drm/amdgpu/userq: remove queue from doorbell xa during clean up Sunil Khatri
2026-03-04 13:09 ` [PATCH v1 1/2] drm/amdgpu/userq: remove queue from doorbell xarray Khatri, Sunil
2026-03-05 10:41   ` 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