drm/amdgpu/sdma7.1: add support for disable_kq
Subsystems (2)
Alex Deucher
maintainerPATCH 1/1 drm/amdgpu/sdma7.1: add support for disable_kq
Plumb in support for disabling kernel queues and make it the default. For testing, kernel queues can be re-enabled by setting amdgpu.user_queue=0. Kernel queues are still created for use by the kernel driver for memory management, etc., just not user submissions.
--- drivers/gpu/drm/amd/amdgpu/sdma_v7_1.c | 12 ++++++++++++ 1 file changed, 12 insertions(+)
drivers/gpu/drm/amd/amdgpu/sdma_v7_1.c +12 -0
@@ -1268,6 +1268,18 @@ static int sdma_v7_1_early_init(struct amdgpu_ip_block *ip_block)struct amdgpu_device *adev = ip_block->adev;int r; +switch (amdgpu_user_queue) { +case -1 : +default : + adev->sdma.no_user_submission = true; + adev->sdma.disable_uq = true; +break ; +case 0 : + adev->sdma.no_user_submission = false; + adev->sdma.disable_uq = true; +break ; + } + r =amdgpu_sdma_init_microcode (adev,0 , true);if (r) {DRM_ERROR ("Failed to init sdma firmware!\n" );
Signature · 1 line
2.53.0
Ping?
Quoted 38 lines · Alex Deucher
Plumb in support for disabling kernel queues and make it the default. For testing, kernel queues can be re-enabled by setting amdgpu.user_queue=0. Kernel queues are still created for use by the kernel driver for memory management, etc., just not user submissions.
Signed-off-by Alex Deucher <[email protected]>--- drivers/gpu/drm/amd/amdgpu/sdma_v7_1.c | 12 ++++++++++++ 1 file changed, 12 insertions(+)drivers/gpu/drm/amd/amdgpu/sdma_v7_1.c +12
-1@@ -1268,6 +1268,18 @@ static int sdma_v7_1_early_init(struct amdgpu_ip_block *ip_block)struct amdgpu_device *adev = ip_block->adev;int r; +switch (amdgpu_user_queue) { +case -1 : +default : + adev->sdma.no_user_submission = true; + adev->sdma.disable_uq = true; +break ; +case 0 : + adev->sdma.no_user_submission = false; + adev->sdma.disable_uq = true; +break ; + } + r =amdgpu_sdma_init_microcode (adev,0 , true);if (r) {DRM_ERROR ("Failed to init sdma firmware!\n" ); --2.53.0
Ping?
Quoted 42 lines · Alex Deucher
Ping?
Quoted 38 lines · Alex Deucher
Plumb in support for disabling kernel queues and make it the default. For testing, kernel queues can be re-enabled by setting amdgpu.user_queue=0. Kernel queues are still created for use by the kernel driver for memory management, etc., just not user submissions.
Signed-off-by Alex Deucher <[email protected]>--- drivers/gpu/drm/amd/amdgpu/sdma_v7_1.c | 12 ++++++++++++ 1 file changed, 12 insertions(+)drivers/gpu/drm/amd/amdgpu/sdma_v7_1.c +12
-1@@ -1268,6 +1268,18 @@ static int sdma_v7_1_early_init(struct amdgpu_ip_block *ip_block)struct amdgpu_device *adev = ip_block->adev;int r; +switch (amdgpu_user_queue) { +case -1 : +default : + adev->sdma.no_user_submission = true; + adev->sdma.disable_uq = true; +break ; +case 0 : + adev->sdma.no_user_submission = false; + adev->sdma.disable_uq = true; +break ; + } + r =amdgpu_sdma_init_microcode (adev,0 , true);if (r) {DRM_ERROR ("Failed to init sdma firmware!\n" ); --2.53.0
[Public]
Regards,
Prike
Quoted 28 lines
-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Alex Deucher
Sent: Tuesday, April 14, 2026 12:12 AM
To: Deucher, Alexander <[email protected]>
Cc: [email protected]
Subject: Re: [PATCH] drm/amdgpu/sdma7.1: add support fordisable_kqPing?
Quoted 4 lines · Alex Deucher
Ping?
On Thu, Mar 26, 2026 at 2:09 PM Alex Deucher <[email protected]>
Quoted 12 lines · wrote:
Quoted 12 lines
Plumb in support for disabling kernel queues and make it the default. For testing, kernel queues can be re-enabled by setting amdgpu.user_queue=0. Kernel queues are still created for use by the kernel driver for memory management, etc., just not user submissions.
Signed-off-by Alex Deucher <[email protected]>--- drivers/gpu/drm/amd/amdgpu/sdma_v7_1.c | 12 ++++++++++++ 1 file changed, 12 insertions(+)
Quoted 16 lines
Quoted 6 lines
drivers/gpu/drm/amd/amdgpu/sdma_v7_1.c static int sdma_v7_1_early_init(struct
Quoted 6 lines
drivers/gpu/drm/amd/amdgpu/sdma_v7_1.c +0
-0@@ -1268,6 +1268,18 @@ static int sdma_v7_1_early_init(struct
amdgpu_ip_block*ip_block)Quoted 9 lines
Quoted 9 lines
drivers/gpu/drm/amd/amdgpu/sdma_v7_1.c +6
-0struct amdgpu_device *adev = ip_block->adev;int r; +switch (amdgpu_user_queue) { +case -1 : +default : + adev->sdma.no_user_submission = true; + adev->sdma.disable_uq = true; +break ;
What's the case which requires disabling the UQ and dropping the userspace submission to the ring at the same time? If so, then how to schedule the job to the SDMA for this case?
Quoted 12 lines
Quoted 12 lines
Quoted 12 lines
drivers/gpu/drm/amd/amdgpu/sdma_v7_1.c +6
-1+case 0 : + adev->sdma.no_user_submission = false; + adev->sdma.disable_uq = true; +break ; + } + r =amdgpu_sdma_init_microcode (adev,0 , true);if (r) {DRM_ERROR ("Failed to init sdma firmware!\n" ); --2.53.0
Quoted 44 lines · Prike
[Public]
Regards,
PrikeQuoted 38 lines
-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Alex Deucher
Sent: Tuesday, April 14, 2026 12:12 AM
To: Deucher, Alexander <[email protected]>
Cc: [email protected]
Subject: Re: [PATCH] drm/amdgpu/sdma7.1: add support fordisable_kqPing?
Quoted 4 lines · Alex Deucher
Ping?
On Thu, Mar 26, 2026 at 2:09 PM Alex Deucher <[email protected]>
Quoted 12 lines · wrote:
Quoted 12 lines
Plumb in support for disabling kernel queues and make it the default. For testing, kernel queues can be re-enabled by setting amdgpu.user_queue=0. Kernel queues are still created for use by the kernel driver for memory management, etc., just not user submissions.
Signed-off-by Alex Deucher <[email protected]>--- drivers/gpu/drm/amd/amdgpu/sdma_v7_1.c | 12 ++++++++++++ 1 file changed, 12 insertions(+)Quoted 6 lines
drivers/gpu/drm/amd/amdgpu/sdma_v7_1.c static int sdma_v7_1_early_init(struct
Quoted 6 lines
drivers/gpu/drm/amd/amdgpu/sdma_v7_1.c +0
-0@@ -1268,6 +1268,18 @@ static int sdma_v7_1_early_init(struct
amdgpu_ip_block*ip_block)Quoted 3 lines
Quoted 3 lines
drivers/gpu/drm/amd/amdgpu/sdma_v7_1.c +0
-0struct amdgpu_device *adev = ip_block->adev;int r;
Quoted 7 lines
Quoted 6 lines
Quoted 6 lines
drivers/gpu/drm/amd/amdgpu/sdma_v7_1.c static int sdma_v7_1_early_init(struct amdgpu_ip_block *ip_block) · line 1276
Quoted 6 lines
drivers/gpu/drm/amd/amdgpu/sdma_v7_1.c +6
-0+switch (amdgpu_user_queue) { +case -1 : +default : + adev->sdma.no_user_submission = true; + adev->sdma.disable_uq = true; +break ;What's the case which requires disabling the UQ and dropping the userspace submission to the ring at the same time? If so, then how to schedule the job to the SDMA for this case?
All submissions will go through KFD user queues. There's no need for user submission via kernel queues. The kernel queues are still used by the kernel driver for internal buffer clears, migration.
Alex
Quoted 13 lines
Quoted 13 lines
Quoted 13 lines
Quoted 13 lines
drivers/gpu/drm/amd/amdgpu/sdma_v7_1.c +6
-1+case 0 : + adev->sdma.no_user_submission = false; + adev->sdma.disable_uq = true; +break ; + } + r =amdgpu_sdma_init_microcode (adev,0 , true);if (r) {DRM_ERROR ("Failed to init sdma firmware!\n" ); --2.53.0
Liang, Prike
Reviewed-by[Public]
Regards,
Prike
Quoted 60 lines
-----Original Message-----
From: Alex Deucher <[email protected]>
Sent: Tuesday, April 14, 2026 9:41 PM
To: Liang, Prike <[email protected]>
Cc: Deucher, Alexander <[email protected]>; amd- [email protected]
Subject: Re: [PATCH] drm/amdgpu/sdma7.1: add support fordisable_kqQuoted 51 lines · Prike
[Public]
Regards,
PrikeQuoted 45 lines
-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Alex Deucher
Sent: Tuesday, April 14, 2026 12:12 AM
To: Deucher, Alexander <[email protected]>
Cc: [email protected]
Subject: Re: [PATCH] drm/amdgpu/sdma7.1: add support fordisable_kqPing?
Quoted 5 lines · Alex Deucher
Ping?
On Thu, Mar 26, 2026 at 2:09 PM Alex Deucher
<[email protected]>Quoted 12 lines · wrote:
Quoted 12 lines
Plumb in support for disabling kernel queues and make it the default. For testing, kernel queues can be re-enabled by setting amdgpu.user_queue=0. Kernel queues are still created for use by the kernel driver for memory management, etc., just not user submissions.
Signed-off-by Alex Deucher <[email protected]>--- drivers/gpu/drm/amd/amdgpu/sdma_v7_1.c | 12 ++++++++++++ 1 file changed, 12 insertions(+)Quoted 6 lines
drivers/gpu/drm/amd/amdgpu/sdma_v7_1.c static int sdma_v7_1_early_init(struct
Quoted 6 lines
drivers/gpu/drm/amd/amdgpu/sdma_v7_1.c +0
-0@@ -1268,6 +1268,18 @@ static int sdma_v7_1_early_init(struct
amdgpu_ip_block*ip_block)Quoted 9 lines
Quoted 9 lines
drivers/gpu/drm/amd/amdgpu/sdma_v7_1.c +6
-0struct amdgpu_device *adev = ip_block->adev;int r; +switch (amdgpu_user_queue) { +case -1 : +default : + adev->sdma.no_user_submission = true; + adev->sdma.disable_uq = true; +break ;
Quoted 7 lines
Quoted 1 line
What's the case which requires disabling the UQ and dropping the userspace
submission to the ring at the same time? If so, then how to schedule the job to the SDMA for this case?
All submissions will go through KFD user queues. There's no need for user submission via kernel queues. The kernel queues are still used by the kernel driver for internal buffer clears, migration.
Got it. Before userq can be used as a monolithic implementation for both KGD and KFD, we may need a flag to identify this case and keep the userq enablement logic consistent with how we configure other IP blocks.
But this setting should also be fine, the patch is
Quoted 15 lines
Alex
Quoted 13 lines
Quoted 13 lines
Quoted 13 lines
Quoted 13 lines
drivers/gpu/drm/amd/amdgpu/sdma_v7_1.c +6
-1+case 0 : + adev->sdma.no_user_submission = false; + adev->sdma.disable_uq = true; +break ; + } + r =amdgpu_sdma_init_microcode (adev,0 , true);if (r) {DRM_ERROR ("Failed to init sdma firmware!\n" ); --2.53.0