Skip to contentSkip to conversation

drm/amdgpu: disable SDMA WPTR_POLL_ENABLE for SR-IOV

PATCH In review Horace Chen 2 participants 2 messages Apr 27, 2023

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

PATCH 1/1 drm/amdgpu: disable SDMA WPTR_POLL_ENABLE for SR-IOV

[Why]
This WPTR_POLL_ENABLE is a hardware contigious polling which will cause FCLK and UCLK to keep on a high level.
Mostly its case can be covered by F32_WPTR_POLL_ENABLE which polls by firmware.
So to save power, SR-IOV also needs to disable this bit

---
 drivers/gpu/drm/amd/amdgpu/sdma_v6_0.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/gpu/drm/amd/amdgpu/sdma_v6_0.c +1 -4
index eb722830531f..3d9a80511a45 100644
@@ -510,10 +510,7 @@ static int sdma_v6_0_gfx_resume(struct amdgpu_device *adev)
 		       lower_32_bits(ring->rptr_gpu_addr) & 0xFFFFFFFC);
 
 		rb_cntl = REG_SET_FIELD(rb_cntl, SDMA0_QUEUE0_RB_CNTL, RPTR_WRITEBACK_ENABLE, 1);
-		if (amdgpu_sriov_vf(adev))
-			rb_cntl = REG_SET_FIELD(rb_cntl, SDMA0_QUEUE0_RB_CNTL, WPTR_POLL_ENABLE, 1);
-		else
-			rb_cntl = REG_SET_FIELD(rb_cntl, SDMA0_QUEUE0_RB_CNTL, WPTR_POLL_ENABLE, 0);
+		rb_cntl = REG_SET_FIELD(rb_cntl, SDMA0_QUEUE0_RB_CNTL, WPTR_POLL_ENABLE, 0);
 		rb_cntl = REG_SET_FIELD(rb_cntl, SDMA0_QUEUE0_RB_CNTL, F32_WPTR_POLL_ENABLE, 1);
 
 		WREG32_SOC15_IP(GC, sdma_v6_0_get_reg_offset(adev, i, regSDMA0_QUEUE0_RB_BASE), ring->gpu_addr >> 8);
Signature · 1 line
2.34.1
maintainer Acked-by on v1 1/1
#1 lore raw

[AMD Official Use Only - General]

Quoted 13 lines

-----Original Message-----
From: Horace Chen <[email protected]>
Sent: Thursday, April 27, 2023 2:24 AM
To: [email protected]
Cc: Andrey Grodzovsky <[email protected]>; Quan, Evan <[email protected]>; Chen, Horace <[email protected]>; Koenig, Christian <[email protected]>; Deucher, Alexander <[email protected]>; Xiao, Jack <[email protected]>; Zhang, Hawking <[email protected]>; Liu, Monk <[email protected]>; Xu, Feifei <[email protected]>; Chang, HaiJun <[email protected]>
Subject: [PATCH] drm/amdgpu: disable SDMA WPTR_POLL_ENABLE for SR- IOV

Quoted 8 lines

[Why]
This WPTR_POLL_ENABLE is a hardware contigious polling which will cause FCLK and UCLK to keep on a high level.
Mostly its case can be covered by F32_WPTR_POLL_ENABLE which polls by firmware.
So to save power, SR-IOV also needs to disable this bit

Quoted 31 lines
---
 drivers/gpu/drm/amd/amdgpu/sdma_v6_0.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/gpu/drm/amd/amdgpu/sdma_v6_0.c +0 -4
index eb722830531f..3d9a80511a45 100644
@@ -510,10 +510,7 @@ static int sdma_v6_0_gfx_resume(struct
 amdgpu_device *adev)
 		       lower_32_bits(ring->rptr_gpu_addr) & 0xFFFFFFFC);
 
 		rb_cntl = REG_SET_FIELD(rb_cntl,
 SDMA0_QUEUE0_RB_CNTL, RPTR_WRITEBACK_ENABLE, 1);
-		if (amdgpu_sriov_vf(adev))
-			rb_cntl = REG_SET_FIELD(rb_cntl,
 SDMA0_QUEUE0_RB_CNTL, WPTR_POLL_ENABLE, 1);
-		else
-			rb_cntl = REG_SET_FIELD(rb_cntl,

SDMA0_QUEUE0_RB_CNTL, WPTR_POLL_ENABLE, 0);

drivers/gpu/drm/amd/amdgpu/sdma_v6_0.c +1 -0
+		rb_cntl = REG_SET_FIELD(rb_cntl,

SDMA0_QUEUE0_RB_CNTL,

drivers/gpu/drm/amd/amdgpu/sdma_v6_0.c +1 -0
+WPTR_POLL_ENABLE, 0);
 		rb_cntl = REG_SET_FIELD(rb_cntl,

SDMA0_QUEUE0_RB_CNTL, F32_WPTR_POLL_ENABLE, 1);

WREG32_SOC15_IP(GC, sdma_v6_0_get_reg_offset(adev, i,
regSDMA0_QUEUE0_RB_BASE), ring->gpu_addr >> 8);
--
2.34.1