Skip to contentSkip to conversation

drm/amdgpu: Reset IH OVERFLOW_EN bit for IH 7.0

PATCH In review Friedrich Vock 2 participants 2 messages Mar 10, 2024 – Mar 11, 2024

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

PATCH 1/1 drm/amdgpu: Reset IH OVERFLOW_EN bit for IH 7.0

IH 7.0 support landed shortly after the original patch for resetting the bit on all other generations, but without that patch applied.

Cc Christian König <[email protected]>
Cc Alex Deucher <[email protected]>
---
 drivers/gpu/drm/amd/amdgpu/ih_v7_0.c | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/gpu/drm/amd/amdgpu/ih_v7_0.c +6 -0
index 16fe428c0722d..7aed96fa10a9d 100644
@@ -418,6 +418,12 @@ static u32 ih_v7_0_get_wptr(struct amdgpu_device *adev,
 	tmp = RREG32_NO_KIQ(ih_regs->ih_rb_cntl);
 	tmp = REG_SET_FIELD(tmp, IH_RB_CNTL, WPTR_OVERFLOW_CLEAR, 1);
 	WREG32_NO_KIQ(ih_regs->ih_rb_cntl, tmp);
+
+	/* Unset the CLEAR_OVERFLOW bit immediately so new overflows
+	 * can be detected.
+	 */
+	tmp = REG_SET_FIELD(tmp, IH_RB_CNTL, WPTR_OVERFLOW_CLEAR, 0);
+	WREG32_NO_KIQ(ih_regs->ih_rb_cntl, tmp);
 out:
 	return (wptr & ih->ptr_mask);
 }

--
2.44.0

maintainer Reviewed-by on v1 1/1
#1 lore raw

Am 10.03.24 um 06:40 schrieb Friedrich Vock:

Quoted 7 lines

IH 7.0 support landed shortly after the original patch for resetting the bit on all other generations, but without that patch applied.

Cc Christian König <[email protected]>
Cc Alex Deucher <[email protected]>

I'm going to pick that up Alex.

Regards,
Christian.

Quoted 24 lines
---
  drivers/gpu/drm/amd/amdgpu/ih_v7_0.c | 6 ++++++
  1 file changed, 6 insertions(+)
drivers/gpu/drm/amd/amdgpu/ih_v7_0.c +6 -1
index 16fe428c0722d..7aed96fa10a9d 100644
@@ -418,6 +418,12 @@ static u32 ih_v7_0_get_wptr(struct amdgpu_device *adev,
  	tmp = RREG32_NO_KIQ(ih_regs->ih_rb_cntl);
  	tmp = REG_SET_FIELD(tmp, IH_RB_CNTL, WPTR_OVERFLOW_CLEAR, 1);
  	WREG32_NO_KIQ(ih_regs->ih_rb_cntl, tmp);
+
+	/* Unset the CLEAR_OVERFLOW bit immediately so new overflows
+	 * can be detected.
+	 */
+	tmp = REG_SET_FIELD(tmp, IH_RB_CNTL, WPTR_OVERFLOW_CLEAR, 0);
+	WREG32_NO_KIQ(ih_regs->ih_rb_cntl, tmp);
  out:
  	return (wptr & ih->ptr_mask);
  }
--

2.44.0