Skip to contentSkip to conversation

drm/amdgpu: Direct ret in ras_reset_err_cnt on VF

PATCH In review Ellen Pan 2 participants 2 messages Apr 3, 2025 – Apr 10, 2025

Subsystems (2)
lore
Share & tools
lore

Ellen Pan

author
#0 lore raw

PATCH 1/1 drm/amdgpu: Direct ret in ras_reset_err_cnt on VF

With adding sriov_vf check, we directly return EOPNOTSUPP in ras_reset_error_count as we should not do anything on VF to reset RAS error count.

This also fixes the issue that loading guest driver causes register violations.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c +3 -0
index ebf1f63d0442..f8cf9621097f 100644
@@ -1498,6 +1498,9 @@ int amdgpu_ras_reset_error_count(struct amdgpu_device *adev,
 	    !amdgpu_ras_get_aca_debug_mode(adev))
 		return -EOPNOTSUPP;
 
+	if (amdgpu_sriov_vf(adev))
+		return -EOPNOTSUPP;
+
 	/* skip ras error reset in gpu reset */
 	if ((amdgpu_in_reset(adev) || amdgpu_ras_in_recovery(adev)) &&
 	    ((smu_funcs && smu_funcs->set_debug_mode) ||
Signature · 1 line
2.34.1
Reviewed-by on v1 1/1
#1 lore raw

[AMD Official Use Only - AMD Internal Distribution Only]

Thanks,
Ahmad

-----Original Message-----
From: Pan, Ellen <[email protected]>
Sent: Thursday, April 3, 2025 10:40 AM
To: [email protected]
Cc: Skvortsov, Victor <[email protected]>; Rehman, Ahmad <[email protected]>; Gande, Shravan kumar <[email protected]>; Pan, Ellen <[email protected]>
Subject: [PATCH] drm/amdgpu: Direct ret in ras_reset_err_cnt on VF

With adding sriov_vf check, we directly return EOPNOTSUPP in ras_reset_error_count as we should not do anything on VF to reset RAS error count.

This also fixes the issue that loading guest driver causes register violations.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c +3 -0
index ebf1f63d0442..f8cf9621097f 100644
@@ -1498,6 +1498,9 @@ int amdgpu_ras_reset_error_count(struct amdgpu_device *adev,
            !amdgpu_ras_get_aca_debug_mode(adev))
                return -EOPNOTSUPP;
 
+       if (amdgpu_sriov_vf(adev))
+               return -EOPNOTSUPP;
+
        /* skip ras error reset in gpu reset */
        if ((amdgpu_in_reset(adev) || amdgpu_ras_in_recovery(adev)) &&
            ((smu_funcs && smu_funcs->set_debug_mode) ||

--
2.34.1