Skip to content

Commit e3e4bf5

Browse files
committed
drm/amdgpu/sdma5.2: limit wptr workaround to sdma 5.2.1
The workaround seems to cause stability issues on other SDMA 5.2.x IPs. Fixes: a03ebf1 ("drm/amdgpu/sdma5.2: Update wptr registers as well as doorbell") Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/3556 Acked-by: Ruijing Dong <[email protected]> Signed-off-by: Alex Deucher <[email protected]> (cherry picked from commit 2dc3851) Cc: [email protected]
1 parent 0b43312 commit e3e4bf5

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -176,14 +176,16 @@ static void sdma_v5_2_ring_set_wptr(struct amdgpu_ring *ring)
176176
DRM_DEBUG("calling WDOORBELL64(0x%08x, 0x%016llx)\n",
177177
ring->doorbell_index, ring->wptr << 2);
178178
WDOORBELL64(ring->doorbell_index, ring->wptr << 2);
179-
/* SDMA seems to miss doorbells sometimes when powergating kicks in.
180-
* Updating the wptr directly will wake it. This is only safe because
181-
* we disallow gfxoff in begin_use() and then allow it again in end_use().
182-
*/
183-
WREG32(sdma_v5_2_get_reg_offset(adev, ring->me, mmSDMA0_GFX_RB_WPTR),
184-
lower_32_bits(ring->wptr << 2));
185-
WREG32(sdma_v5_2_get_reg_offset(adev, ring->me, mmSDMA0_GFX_RB_WPTR_HI),
186-
upper_32_bits(ring->wptr << 2));
179+
if (amdgpu_ip_version(adev, SDMA0_HWIP, 0) == IP_VERSION(5, 2, 1)) {
180+
/* SDMA seems to miss doorbells sometimes when powergating kicks in.
181+
* Updating the wptr directly will wake it. This is only safe because
182+
* we disallow gfxoff in begin_use() and then allow it again in end_use().
183+
*/
184+
WREG32(sdma_v5_2_get_reg_offset(adev, ring->me, mmSDMA0_GFX_RB_WPTR),
185+
lower_32_bits(ring->wptr << 2));
186+
WREG32(sdma_v5_2_get_reg_offset(adev, ring->me, mmSDMA0_GFX_RB_WPTR_HI),
187+
upper_32_bits(ring->wptr << 2));
188+
}
187189
} else {
188190
DRM_DEBUG("Not using doorbell -- "
189191
"mmSDMA%i_GFX_RB_WPTR == 0x%08x "

0 commit comments

Comments
 (0)