Skip to contentSkip to conversation

drm/amdgpu: Clean sdma wptr register when only enable wptr polling

PATCH In review Emily Deng 2 participants 2 messages Mar 6, 2018 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore

Emily Deng

author
#0 lore raw

PATCH 1/1 drm/amdgpu: Clean sdma wptr register when only enable wptr polling

The sdma wptr polling memory is not fast enough, then the sdma wptr register will be random, and not equal to sdma rptr, which will cause sdma engine hang when load driver, so clean up the sdma wptr directly to fix this issue.

---
 drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c +3 -2
index 521978c..2a27928 100644
@@ -719,11 +719,12 @@ static int sdma_v3_0_gfx_resume(struct amdgpu_device *adev)
 		WREG32(mmSDMA0_GFX_RB_WPTR_POLL_ADDR_HI + sdma_offsets[i],
 		       upper_32_bits(wptr_gpu_addr));
 		wptr_poll_cntl = RREG32(mmSDMA0_GFX_RB_WPTR_POLL_CNTL + sdma_offsets[i]);
-		if (ring->use_pollmem)
+		if (ring->use_pollmem) {
+			WREG32(mmSDMA0_GFX_RB_WPTR + sdma_offsets[i], 0);
 			wptr_poll_cntl = REG_SET_FIELD(wptr_poll_cntl,
 						       SDMA0_GFX_RB_WPTR_POLL_CNTL,
 						       ENABLE, 1);
-		else
+		} else
 			wptr_poll_cntl = REG_SET_FIELD(wptr_poll_cntl,
 						       SDMA0_GFX_RB_WPTR_POLL_CNTL,
 						       ENABLE, 0);
Signature · 6 lines
2.7.4

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): 1520327844-23228-1-git-send-email-Emily.Deng-5C7GfCeVMHo@public.gmane.org

Reviewed-by Xiangliang Yu
#2 lore raw

Better to add comment above the code.

Quoted 48 lines

-----Original Message-----
From: amd-gfx [mailto:[email protected]] On Behalf Of Emily Deng
Sent: Tuesday, March 06, 2018 5:17 PM
To: [email protected]
Cc: Deng, Emily <[email protected]>
Subject: [PATCH] drm/amdgpu: Clean sdma wptr register when only enable wptr polling

The sdma wptr polling memory is not fast enough, then the sdma wptr register will be random, and not equal to sdma rptr, which will cause sdma engine hang when load driver, so clean up the sdma wptr directly to fix this issue.

---
 drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c +2 -1
index 521978c..2a27928 100644
@@ -719,11 +719,12 @@ static int sdma_v3_0_gfx_resume(struct
 amdgpu_device *adev)
 		WREG32(mmSDMA0_GFX_RB_WPTR_POLL_ADDR_HI +
 sdma_offsets[i],
 		       upper_32_bits(wptr_gpu_addr));
 		wptr_poll_cntl =
 RREG32(mmSDMA0_GFX_RB_WPTR_POLL_CNTL + sdma_offsets[i]);
-		if (ring->use_pollmem)
+		if (ring->use_pollmem) {
+			WREG32(mmSDMA0_GFX_RB_WPTR +
 sdma_offsets[i], 0);
 			wptr_poll_cntl = REG_SET_FIELD(wptr_poll_cntl,
 
 SDMA0_GFX_RB_WPTR_POLL_CNTL,
drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c +1 -1
 						       ENABLE, 1);
-		else
+		} else
 			wptr_poll_cntl = REG_SET_FIELD(wptr_poll_cntl,

SDMA0_GFX_RB_WPTR_POLL_CNTL,
ENABLE, 0);
--
2.7.4

Quoted 4 lines

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx