Commit 2dc3851e authored by Alex Deucher's avatar Alex Deucher
Browse files

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: a03ebf11 ("drm/amdgpu/sdma5.2: Update wptr registers as well as doorbell")
Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/3556


Acked-by: default avatarRuijing Dong <ruijing.dong@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 1a2103d6
Loading
Loading
Loading
Loading
+10 −8
Original line number Diff line number Diff line
@@ -225,6 +225,7 @@ static void sdma_v5_2_ring_set_wptr(struct amdgpu_ring *ring)
		DRM_DEBUG("calling WDOORBELL64(0x%08x, 0x%016llx)\n",
				ring->doorbell_index, ring->wptr << 2);
		WDOORBELL64(ring->doorbell_index, ring->wptr << 2);
		if (amdgpu_ip_version(adev, SDMA0_HWIP, 0) == IP_VERSION(5, 2, 1)) {
			/* SDMA seems to miss doorbells sometimes when powergating kicks in.
			 * Updating the wptr directly will wake it. This is only safe because
			 * we disallow gfxoff in begin_use() and then allow it again in end_use().
@@ -233,6 +234,7 @@ static void sdma_v5_2_ring_set_wptr(struct amdgpu_ring *ring)
			       lower_32_bits(ring->wptr << 2));
			WREG32(sdma_v5_2_get_reg_offset(adev, ring->me, mmSDMA0_GFX_RB_WPTR_HI),
			       upper_32_bits(ring->wptr << 2));
		}
	} else {
		DRM_DEBUG("Not using doorbell -- "
				"mmSDMA%i_GFX_RB_WPTR == 0x%08x "