From: Ellen Pan Date: Fri, 11 Apr 2025 02:12:24 +0000 (-0400) Subject: drm/amdgpu: Direct ret in ras_reset_err_cnt on VF X-Git-Tag: v6.16-rc1~144^2~10^2~224 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5045c6c69872b9dd145e9ecbc9731d81a5954be1;p=thirdparty%2Fkernel%2Flinux.git 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. Reviewed-by: Ahmad Rehman Signed-off-by: Ellen Pan Signed-off-by: Alex Deucher --- diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c index 5bb7673fd28ee..17f0911ee7e91 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c @@ -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) ||