Skip to contentSkip to conversation

drm/amdgpu/gfx11: program some additional registers for resets

PATCH In review Alex Deucher 2 participants 3 messages Jan 12 – Jan 30

Subsystems (2)
lore
Share & tools
lore

Alex Deucher

author maintainer
#0 lore raw

PATCH 1/2 drm/amdgpu/gfx11: program some additional registers for resets

The first change prevents the hw from overwriting the ring with NOOPs after a reset. This is helpful for debugging user queues since the contents will be retained. The second change disables conversion of XNACK to XACK during a queue reset.

---
 drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c +11 -1
index 624929473b136..6145cfc0334b2 100644
@@ -3616,14 +3616,24 @@ static int gfx_v11_0_cp_gfx_start(struct amdgpu_device *adev)
 	struct amdgpu_ring *ring;
 	const struct cs_section_def *sect = NULL;
 	const struct cs_extent_def *ext = NULL;
-	int r, i;
 	int ctx_reg_offset;
+	int r, i;
+	u32 val;
 
 	/* init the CP */
 	WREG32_SOC15(GC, 0, regCP_MAX_CONTEXT,
 		     adev->gfx.config.max_hw_contexts - 1);
 	WREG32_SOC15(GC, 0, regCP_DEVICE_ID, 1);
 
+	if (!amdgpu_sriov_vf(adev)) {
+		val = RREG32_SOC15(GC, 0, regCP_DEBUG_2);
+		val = REG_SET_FIELD(val, CP_DEBUG_2, RB_PACKET_INJECTOR_DISABLE, 1);
+		WREG32_SOC15(GC, 0, regCP_DEBUG_2, val);
+		val = RREG32_SOC15(GC, 0, regCPF_UTCL1_CNTL);
+		val = REG_SET_FIELD(val, CPF_UTCL1_CNTL, VMID_RESET_MODE, 1);
+		WREG32_SOC15(GC, 0, regCPF_UTCL1_CNTL, val);
+	}
+
 	if (!amdgpu_async_gfx_ring)
 		gfx_v11_0_cp_gfx_enable(adev, true);
 
Signature · 1 line
2.52.0
author maintainer
#1 lore raw

PATCH 2/2 drm/amdgpu/gfx12: program some additional registers for resets

The first change prevents the hw from overwriting the ring with NOOPs after a reset. This is helpful for debugging user queues since the contents will be retained. The second change disables conversion of XNACK to XACK during a queue reset.

---
 drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c | 11 +++++++++++
 1 file changed, 11 insertions(+)
drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c +11 -0
index c68f297ce7995..a30af12752e6c 100644
@@ -2666,11 +2666,22 @@ static int gfx_v12_0_cp_gfx_load_microcode(struct amdgpu_device *adev)
 
 static int gfx_v12_0_cp_gfx_start(struct amdgpu_device *adev)
 {
+	u32 val;
+
 	/* init the CP */
 	WREG32_SOC15(GC, 0, regCP_MAX_CONTEXT,
 		     adev->gfx.config.max_hw_contexts - 1);
 	WREG32_SOC15(GC, 0, regCP_DEVICE_ID, 1);
 
+	if (!amdgpu_sriov_vf(adev)) {
+		val = RREG32_SOC15(GC, 0, regCP_DEBUG_2);
+		val = REG_SET_FIELD(val, CP_DEBUG_2, RB_PACKET_INJECTOR_DISABLE, 1);
+		WREG32_SOC15(GC, 0, regCP_DEBUG_2, val);
+		val = RREG32_SOC15(GC, 0, regCPF_UTCL1_CNTL);
+		val = REG_SET_FIELD(val, CPF_UTCL1_CNTL, VMID_RESET_MODE, 1);
+		WREG32_SOC15(GC, 0, regCPF_UTCL1_CNTL, val);
+	}
+
 	if (!amdgpu_async_gfx_ring)
 		gfx_v12_0_cp_gfx_enable(adev, true);
 
Signature · 1 line
2.52.0
#2 lore raw
In reply to Alex Deucher

Ping on this series.

Alex

Quoted 44 lines · Alex Deucher

The first change prevents the hw from overwriting the ring with NOOPs after a reset. This is helpful for debugging user queues since the contents will be retained. The second change disables conversion of XNACK to XACK during a queue reset.

---
 drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c +11 -2
index 624929473b136..6145cfc0334b2 100644
@@ -3616,14 +3616,24 @@ static int gfx_v11_0_cp_gfx_start(struct amdgpu_device *adev)
        struct amdgpu_ring *ring;
        const struct cs_section_def *sect = NULL;
        const struct cs_extent_def *ext = NULL;
-       int r, i;
        int ctx_reg_offset;
+       int r, i;
+       u32 val;
 
        /* init the CP */
        WREG32_SOC15(GC, 0, regCP_MAX_CONTEXT,
                     adev->gfx.config.max_hw_contexts - 1);
        WREG32_SOC15(GC, 0, regCP_DEVICE_ID, 1);
 
+       if (!amdgpu_sriov_vf(adev)) {
+               val = RREG32_SOC15(GC, 0, regCP_DEBUG_2);
+               val = REG_SET_FIELD(val, CP_DEBUG_2, RB_PACKET_INJECTOR_DISABLE, 1);
+               WREG32_SOC15(GC, 0, regCP_DEBUG_2, val);
+               val = RREG32_SOC15(GC, 0, regCPF_UTCL1_CNTL);
+               val = REG_SET_FIELD(val, CPF_UTCL1_CNTL, VMID_RESET_MODE, 1);
+               WREG32_SOC15(GC, 0, regCPF_UTCL1_CNTL, val);
+       }
+
        if (!amdgpu_async_gfx_ring)
                gfx_v11_0_cp_gfx_enable(adev, true);
 
--

2.52.0