diff options
author | 2023-10-25 11:03:24 +0800 | |
---|---|---|
committer | 2023-10-31 16:40:15 -0400 | |
commit | d1d4c0b7b65b7fab2bc6f97af9e823b1c42ccdb0 (patch) | |
tree | 4d0405f3133474ac46991eca57e963817f7807e9 /drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | |
parent | Merge tag 'amd-drm-next-6.7-2023-10-27' of https://gitlab.freedesktop.org/agd... (diff) | |
download | linux-d1d4c0b7b65b7fab2bc6f97af9e823b1c42ccdb0.tar.gz linux-d1d4c0b7b65b7fab2bc6f97af9e823b1c42ccdb0.tar.bz2 linux-d1d4c0b7b65b7fab2bc6f97af9e823b1c42ccdb0.zip |
drm/amdgpu: check RAS supported first in ras_reset_error_count
Not all platforms support RAS.
Fixes: 73582be11ac8 ("drm/amdgpu: bypass RAS error reset in some conditions")
Signed-off-by: Tao Zhou <tao.zhou1@amd.com>
Reviewed-by: Yang Wang <kevinyang.wang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c index 303fbb6a48b6..3af50754800d 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c @@ -1229,15 +1229,15 @@ int amdgpu_ras_reset_error_count(struct amdgpu_device *adev, return -EOPNOTSUPP; } + if (!amdgpu_ras_is_supported(adev, block) || + !amdgpu_ras_get_mca_debug_mode(adev)) + return -EOPNOTSUPP; + /* skip ras error reset in gpu reset */ if ((amdgpu_in_reset(adev) || atomic_read(&ras->in_recovery)) && mca_funcs && mca_funcs->mca_set_debug_mode) return -EOPNOTSUPP; - if (!amdgpu_ras_is_supported(adev, block) || - !amdgpu_ras_get_mca_debug_mode(adev)) - return -EOPNOTSUPP; - if (block_obj->hw_ops->reset_ras_error_count) block_obj->hw_ops->reset_ras_error_count(adev); |