Skip to contentSkip to conversation

drm/amdgpu: add UTCL2 RAS poison query for gfx 9.4.3

PATCH In review Tao Zhou 2 participants 2 messages Feb 18, 2024 – Feb 19, 2024

Subsystems (2)
lore
Share & tools
lore

Tao Zhou

author
#0 lore raw

PATCH 1/1 drm/amdgpu: add UTCL2 RAS poison query for gfx 9.4.3

Add help function to query and reset RAS UTCL2 poison status.

---
 drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c +14 -0
index aace4594a603..de04006f8db1 100644
@@ -4329,10 +4329,24 @@ static int gfx_v9_4_3_ras_late_init(struct amdgpu_device *adev, struct ras_commo
 	return r;
 }
 
+static bool gfx_v9_4_3_query_uctl2_poison_status(struct amdgpu_device *adev)
+{
+	u32 status = 0;
+	struct amdgpu_vmhub *hub;
+
+	hub = &adev->vmhub[AMDGPU_GFXHUB(0)];
+	status = RREG32(hub->vm_l2_pro_fault_status);
+	/* reset page fault status */
+	WREG32_P(hub->vm_l2_pro_fault_cntl, 1, ~1);
+
+	return REG_GET_FIELD(status, VM_L2_PROTECTION_FAULT_STATUS, FED);
+}
+
 struct amdgpu_gfx_ras gfx_v9_4_3_ras = {
 	.ras_block = {
 		.hw_ops = &gfx_v9_4_3_ras_ops,
 		.ras_late_init = &gfx_v9_4_3_ras_late_init,
 	},
 	.enable_watchdog_timer = &gfx_v9_4_3_enable_watchdog_timer,
+	.query_utcl2_poison_status = &gfx_v9_4_3_query_uctl2_poison_status,
 };
Signature · 1 line
2.34.1
#1 lore raw
Quoted 12 lines · Tao Zhou

Add help function to query and reset RAS UTCL2 poison status.

---
 drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c +0 -0
index aace4594a603..de04006f8db1 100644

drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c static int gfx_v9_4_3_ras_late_init(struct amdgpu_device *adev, struct ras_commo · line 4337

Quoted 9 lines
drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c +6 -0
@@ -4329,10 +4329,24 @@ static int gfx_v9_4_3_ras_late_init(struct amdgpu_device *adev, struct ras_commo
 	return r;
 }
 
+static bool gfx_v9_4_3_query_uctl2_poison_status(struct amdgpu_device *adev)
+{
+	u32 status = 0;
+	struct amdgpu_vmhub *hub;
+
+	hub = &adev->vmhub[AMDGPU_GFXHUB(0)];

This only take care of the first instance. What about others?

Thanks,
Lijo

Quoted 15 lines
drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c +8 -0
+	status = RREG32(hub->vm_l2_pro_fault_status);
+	/* reset page fault status */
+	WREG32_P(hub->vm_l2_pro_fault_cntl, 1, ~1);
+
+	return REG_GET_FIELD(status, VM_L2_PROTECTION_FAULT_STATUS, FED);
+}
+
 struct amdgpu_gfx_ras gfx_v9_4_3_ras = {
 	.ras_block = {
 		.hw_ops = &gfx_v9_4_3_ras_ops,
 		.ras_late_init = &gfx_v9_4_3_ras_late_init,
 	},
 	.enable_watchdog_timer = &gfx_v9_4_3_enable_watchdog_timer,
+	.query_utcl2_poison_status = &gfx_v9_4_3_query_uctl2_poison_status,
 };