drm/amdgpu/sdma_v6.0: enable WPTR polling for UMQ SDMA MQD
Subsystems (2)
PATCH 1/2 drm/amdgpu/sdma_v6.0: enable WPTR polling for UMQ SDMA MQD
UMQ SDMA queues can stall when only F32/MCU WPTR polling is enabled in the MQD RB control configuration. Enable WPTR_POLL_ENABLE in sdma_v6_0 init so hardware can reliably observe WB write pointer updates while keeping the existing doorbell path enabled.
This fixes UMQ SDMA submissions timing out on subsequent packets where wptr/rptr no longer advance.
--- drivers/gpu/drm/amd/amdgpu/sdma_v6_0.c | 1 + 1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/amdgpu/sdma_v6_0.c +1 -0
@@ -863,6 +863,7 @@ static int sdma_v6_0_mqd_init(struct amdgpu_device *adev, void *mqd,order_base_2 (prop->queue_size /4 ) <<SDMA0_QUEUE0_RB_CNTL__RB_SIZE__SHIFT |1 <<SDMA0_QUEUE0_RB_CNTL__RPTR_WRITEBACK_ENABLE__SHIFT |4 <<SDMA0_QUEUE0_RB_CNTL__RPTR_WRITEBACK_TIMER__SHIFT | +1 <<SDMA0_QUEUE0_RB_CNTL__WPTR_POLL_ENABLE__SHIFT |1 <<SDMA0_QUEUE0_RB_CNTL__F32_WPTR_POLL_ENABLE__SHIFT ; m->sdmax_rlcx_rb_base =lower_32_bits (prop->hqd_base_gpu_addr >>8 );
Signature · 1 line
2.49.0
PATCH 2/2 drm/amdgpu/sdma_v7.0: enable WPTR polling for UMQ SDMA MQD
Enable WPTR_POLL_ENABLE in sdma_v7_0 init so hardware can reliably observe WB write pointer updates while keeping the existing doorbell path enabled.
This fixes UMQ SDMA submissions timing out on subsequent packets where wptr/rptr no longer advance.
--- drivers/gpu/drm/amd/amdgpu/sdma_v7_0.c | 1 + 1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/amdgpu/sdma_v7_0.c +1 -0
@@ -882,6 +882,7 @@ static int sdma_v7_0_mqd_init(struct amdgpu_device *adev, void *mqd,order_base_2 (prop->queue_size /4 ) <<SDMA0_QUEUE0_RB_CNTL__RB_SIZE__SHIFT |1 <<SDMA0_QUEUE0_RB_CNTL__RPTR_WRITEBACK_ENABLE__SHIFT |4 <<SDMA0_QUEUE0_RB_CNTL__RPTR_WRITEBACK_TIMER__SHIFT | +1 <<SDMA0_QUEUE0_RB_CNTL__WPTR_POLL_ENABLE__SHIFT |1 <<SDMA0_QUEUE0_RB_CNTL__MCU_WPTR_POLL_ENABLE__SHIFT ; m->sdmax_rlcx_rb_base =lower_32_bits (prop->hqd_base_gpu_addr >>8 );
Signature · 1 line
2.49.0
Christian König
maintainerQuoted 16 lines · Jesse Zhang
UMQ SDMA queues can stall when only F32/MCU WPTR polling is enabled in the MQD RB control configuration. Enable
WPTR_POLL_ENABLEinsdma_v6_0init so hardware can reliably observe WB write pointer updates while keeping the existing doorbell path enabled.This fixes UMQ SDMA submissions timing out on subsequent packets where wptr/rptr no longer advance.
Signed-off-by Jesse Zhang <[email protected]>--- drivers/gpu/drm/amd/amdgpu/sdma_v6_0.c | 1 + 1 file changed, 1 insertion(+)drivers/gpu/drm/amd/amdgpu/sdma_v6_0.c +0
-0
drivers/gpu/drm/amd/amdgpu/sdma_v6_0.c static int sdma_v6_0_mqd_init(struct amdgpu_device *adev, void *mqd, · line 866
Quoted 4 lines
drivers/gpu/drm/amd/amdgpu/sdma_v6_0.c +1
-0@@ -863,6 +863,7 @@ static int sdma_v6_0_mqd_init(struct amdgpu_device *adev, void *mqd,order_base_2 (prop->queue_size /4 ) <<SDMA0_QUEUE0_RB_CNTL__RB_SIZE__SHIFT |1 <<SDMA0_QUEUE0_RB_CNTL__RPTR_WRITEBACK_ENABLE__SHIFT |4 <<SDMA0_QUEUE0_RB_CNTL__RPTR_WRITEBACK_TIMER__SHIFT | + 1 << SDMA0_QUEUE0_RB_CNTL__WPTR_POLL_ENABLE__SHIFT |
This enabled WPTR polling for the kernel queue which is clearly not correct.
My educated guess is that this only works around the problem because it keeps the SDMA awake.
Regards,
Christian.
Quoted 3 lines
drivers/gpu/drm/amd/amdgpu/sdma_v6_0.c +0
-01 <<SDMA0_QUEUE0_RB_CNTL__F32_WPTR_POLL_ENABLE__SHIFT ; m->sdmax_rlcx_rb_base =lower_32_bits (prop->hqd_base_gpu_addr >>8 );
[AMD Official Use Only - AMD Internal Distribution Only]
Quoted 34 lines
-----Original Message-----
From: Koenig, Christian <[email protected]>
Sent: Tuesday, March 31, 2026 7:57 PM
To: Zhang, Jesse(Jie) <[email protected]>; [email protected]
Cc: Deucher, Alexander <[email protected]>
Subject: Re: [PATCH 1/2] drm/amdgpu/sdma_v6.0: enable WPTR polling for UMQ SDMA MQDQuoted 1 line · Jesse Zhang
UMQ SDMA queues can stall when only F32/MCU WPTR polling is enabled in the
MQD RB control configuration.
Quoted 2 lines
Enable
WPTR_POLL_ENABLEinsdma_v6_0init so hardware can reliably observe WB write pointer updates while keeping the existing doorbell pathenabled.
Quoted 2 lines
This fixes UMQ SDMA submissions timing out on subsequent packets where
wptr/rptr no longer advance.
drivers/gpu/drm/amd/amdgpu/sdma_v6_0.c static int sdma_v6_0_mqd_init(struct amdgpu_device
Quoted 12 lines
Signed-off-by Jesse Zhang <[email protected]>--- drivers/gpu/drm/amd/amdgpu/sdma_v6_0.c | 1 + 1 file changed, 1 insertion(+)drivers/gpu/drm/amd/amdgpu/sdma_v6_0.c +0
-0@@ -863,6 +863,7 @@ static int sdma_v6_0_mqd_init(struct amdgpu_device*adev, void *mqd,
drivers/gpu/drm/amd/amdgpu/sdma_v6_0.c static int sdma_v6_0_mqd_init(struct amdgpu_device · line 863
Quoted 1 line
drivers/gpu/drm/amd/amdgpu/sdma_v6_0.c +0
-0order_base_2(prop->queue_size / 4) <<
SDMA0_QUEUE0_RB_CNTL__RB_SIZE__SHIFT|
Quoted 8 lines
drivers/gpu/drm/amd/amdgpu/sdma_v6_0.c static int sdma_v6_0_mqd_init(struct amdgpu_device · line 864
Quoted 1 line
drivers/gpu/drm/amd/amdgpu/sdma_v6_0.c +0
-01 <<
SDMA0_QUEUE0_RB_CNTL__RPTR_WRITEBACK_ENABLE__SHIFT|drivers/gpu/drm/amd/amdgpu/sdma_v6_0.c static int sdma_v6_0_mqd_init(struct amdgpu_device · line 865
Quoted 1 line
drivers/gpu/drm/amd/amdgpu/sdma_v6_0.c +0
-04 <<
SDMA0_QUEUE0_RB_CNTL__RPTR_WRITEBACK_TIMER__SHIFT|drivers/gpu/drm/amd/amdgpu/sdma_v6_0.c static int sdma_v6_0_mqd_init(struct amdgpu_device · line 866
Quoted 1 line
drivers/gpu/drm/amd/amdgpu/sdma_v6_0.c +1
-0+ 1 <<
SDMA0_QUEUE0_RB_CNTL__WPTR_POLL_ENABLE__SHIFT|This enabled WPTR polling for the kernel queue which is clearly not correct.
This patch will not affect the SDMA kernel queue.
the kernel ring path configures SDMA queues via register writes; the UMQ path supplies a firmware-facing MQD built by sdma_*_mqd_init().
Thanks
Jesse
Quoted 11 lines
My educated guess is that this only works around the problem because it keeps the SDMA awake.
Regards,
Christian.drivers/gpu/drm/amd/amdgpu/sdma_v6_0.c static int sdma_v6_0_mqd_init(struct amdgpu_device · line 867
Quoted 1 line
drivers/gpu/drm/amd/amdgpu/sdma_v6_0.c +0
-01 <<
SDMA0_QUEUE0_RB_CNTL__F32_WPTR_POLL_ENABLE__SHIFT;Quoted 2 lines
drivers/gpu/drm/amd/amdgpu/sdma_v6_0.c +0
-0m->sdmax_rlcx_rb_base =lower_32_bits (prop->hqd_base_gpu_addr >>8 );
Christian König
maintainerQuoted 38 lines · Jesse(Jie)
[AMD Official Use Only - AMD Internal Distribution Only]
Quoted 36 lines
-----Original Message-----
From: Koenig, Christian <[email protected]>
Sent: Tuesday, March 31, 2026 7:57 PM
To: Zhang, Jesse(Jie) <[email protected]>; [email protected]
Cc: Deucher, Alexander <[email protected]>
Subject: Re: [PATCH 1/2] drm/amdgpu/sdma_v6.0: enable WPTR polling for UMQ SDMA MQDQuoted 1 line · Jesse Zhang
UMQ SDMA queues can stall when only F32/MCU WPTR polling is enabled in the
MQD RB control configuration.
Quoted 2 lines
Enable
WPTR_POLL_ENABLEinsdma_v6_0init so hardware can reliably observe WB write pointer updates while keeping the existing doorbell pathenabled.
Quoted 2 lines
This fixes UMQ SDMA submissions timing out on subsequent packets where
wptr/rptr no longer advance.
drivers/gpu/drm/amd/amdgpu/sdma_v6_0.c static int sdma_v6_0_mqd_init(struct amdgpu_device
Quoted 12 lines
Signed-off-by Jesse Zhang <[email protected]>--- drivers/gpu/drm/amd/amdgpu/sdma_v6_0.c | 1 + 1 file changed, 1 insertion(+)drivers/gpu/drm/amd/amdgpu/sdma_v6_0.c +0
-0@@ -863,6 +863,7 @@ static int sdma_v6_0_mqd_init(struct amdgpu_device*adev, void *mqd,
drivers/gpu/drm/amd/amdgpu/sdma_v6_0.c static int sdma_v6_0_mqd_init(struct amdgpu_device · line 863
Quoted 1 line
drivers/gpu/drm/amd/amdgpu/sdma_v6_0.c +0
-0order_base_2(prop->queue_size / 4) <<
SDMA0_QUEUE0_RB_CNTL__RB_SIZE__SHIFT|drivers/gpu/drm/amd/amdgpu/sdma_v6_0.c static int sdma_v6_0_mqd_init(struct amdgpu_device · line 864
Quoted 1 line
drivers/gpu/drm/amd/amdgpu/sdma_v6_0.c +0
-01 <<
SDMA0_QUEUE0_RB_CNTL__RPTR_WRITEBACK_ENABLE__SHIFT|
Quoted 8 lines
Quoted 6 lines
drivers/gpu/drm/amd/amdgpu/sdma_v6_0.c static int sdma_v6_0_mqd_init(struct amdgpu_device · line 865
Quoted 1 line
drivers/gpu/drm/amd/amdgpu/sdma_v6_0.c +0
-04 <<
SDMA0_QUEUE0_RB_CNTL__RPTR_WRITEBACK_TIMER__SHIFT|drivers/gpu/drm/amd/amdgpu/sdma_v6_0.c static int sdma_v6_0_mqd_init(struct amdgpu_device · line 866
Quoted 1 line
drivers/gpu/drm/amd/amdgpu/sdma_v6_0.c +1
-0+ 1 <<
SDMA0_QUEUE0_RB_CNTL__WPTR_POLL_ENABLE__SHIFT|This enabled WPTR polling for the kernel queue which is clearly not correct.
This patch will not affect the SDMA kernel queue.
the kernel ring path configures SDMA queues via register writes; the UMQ path supplies a firmware-facing MQD built by sdma_*_mqd_init().
Ah! So the MQD path just uses the SDMA0_QUEUE0_RB_CNTL_* macros to fill in the MQD values the MES should use. That makes a bit more sense, yes.
But that still doesn't explain why that should fix the SDMA issue we are seeing?
Regards,
Christian.
Quoted 15 lines
Thanks
JesseQuoted 11 lines
My educated guess is that this only works around the problem because it keeps the SDMA awake.
Regards,
Christian.drivers/gpu/drm/amd/amdgpu/sdma_v6_0.c static int sdma_v6_0_mqd_init(struct amdgpu_device · line 867
Quoted 1 line
drivers/gpu/drm/amd/amdgpu/sdma_v6_0.c +0
-01 <<
SDMA0_QUEUE0_RB_CNTL__F32_WPTR_POLL_ENABLE__SHIFT;Quoted 2 lines
drivers/gpu/drm/amd/amdgpu/sdma_v6_0.c +0
-0m->sdmax_rlcx_rb_base =lower_32_bits (prop->hqd_base_gpu_addr >>8 );