Skip to content

Commit d1d4c0b

Browse files
Tao Zhoualexdeucher
authored andcommitted
drm/amdgpu: check RAS supported first in ras_reset_error_count
Not all platforms support RAS. Fixes: 73582be ("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>
1 parent 6318080 commit d1d4c0b

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1229,15 +1229,15 @@ int amdgpu_ras_reset_error_count(struct amdgpu_device *adev,
12291229
return -EOPNOTSUPP;
12301230
}
12311231

1232+
if (!amdgpu_ras_is_supported(adev, block) ||
1233+
!amdgpu_ras_get_mca_debug_mode(adev))
1234+
return -EOPNOTSUPP;
1235+
12321236
/* skip ras error reset in gpu reset */
12331237
if ((amdgpu_in_reset(adev) || atomic_read(&ras->in_recovery)) &&
12341238
mca_funcs && mca_funcs->mca_set_debug_mode)
12351239
return -EOPNOTSUPP;
12361240

1237-
if (!amdgpu_ras_is_supported(adev, block) ||
1238-
!amdgpu_ras_get_mca_debug_mode(adev))
1239-
return -EOPNOTSUPP;
1240-
12411241
if (block_obj->hw_ops->reset_ras_error_count)
12421242
block_obj->hw_ops->reset_ras_error_count(adev);
12431243

0 commit comments

Comments
 (0)