Skip to contentSkip to conversation

drm/amdgpu/sdma_v6.0: enable WPTR polling for UMQ SDMA MQD

PATCH In review Jesse Zhang 2 participants 5 messages Mar 31 – Apr 1

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

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
index b005672f2f96..622518483c6e 100644
@@ -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
#1 lore raw

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
index 5679a94d0815..ba6b7a2e6577 100644
@@ -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
maintainer
#2 lore raw
In reply to Jesse Zhang
Quoted 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_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 +0 -0
index b005672f2f96..622518483c6e 100644

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 -0
 		1 << SDMA0_QUEUE0_RB_CNTL__F32_WPTR_POLL_ENABLE__SHIFT;
 
 	m->sdmax_rlcx_rb_base = lower_32_bits(prop->hqd_base_gpu_addr >> 8);
#3 lore raw

[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 MQD

Quoted 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_ENABLE in sdma_v6_0 init so hardware can reliably observe WB write pointer updates while keeping the existing doorbell path

enabled.

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
---
 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
index b005672f2f96..622518483c6e 100644
@@ -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 -0
            order_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 -0
            1 <<

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 -0
            4 <<

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 -0
            1 <<

SDMA0_QUEUE0_RB_CNTL__F32_WPTR_POLL_ENABLE__SHIFT;

Quoted 2 lines
drivers/gpu/drm/amd/amdgpu/sdma_v6_0.c +0 -0
    m->sdmax_rlcx_rb_base = lower_32_bits(prop->hqd_base_gpu_addr >> 8);
maintainer
#4 lore raw
Quoted 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 MQD

Quoted 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_ENABLE in sdma_v6_0 init so hardware can reliably observe WB write pointer updates while keeping the existing doorbell path

enabled.

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
---
 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
index b005672f2f96..622518483c6e 100644
@@ -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 -0
            order_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 -0
            1 <<

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 -0
            4 <<

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
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 -0
            1 <<

SDMA0_QUEUE0_RB_CNTL__F32_WPTR_POLL_ENABLE__SHIFT;

Quoted 2 lines
drivers/gpu/drm/amd/amdgpu/sdma_v6_0.c +0 -0
    m->sdmax_rlcx_rb_base = lower_32_bits(prop->hqd_base_gpu_addr >> 8);