Skip to content

Commit 73582be

Browse files
Tao Zhoualexdeucher
authored andcommitted
drm/amdgpu: bypass RAS error reset in some conditions
PMFW is responsible for RAS error reset in some conditions, driver can skip the operation. v2: add check for ras->in_recovery, it's set earlier than amdgpu_in_reset. v3: fix error in gpu reset check. Signed-off-by: Tao Zhou <[email protected]> Reviewed-by: Hawking Zhang <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent f3a3bbf commit 73582be

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

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

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1220,14 +1220,22 @@ int amdgpu_ras_reset_error_count(struct amdgpu_device *adev,
12201220
enum amdgpu_ras_block block)
12211221
{
12221222
struct amdgpu_ras_block_object *block_obj = amdgpu_ras_get_ras_block(adev, block, 0);
1223+
struct amdgpu_ras *ras = amdgpu_ras_get_context(adev);
1224+
const struct amdgpu_mca_smu_funcs *mca_funcs = adev->mca.mca_funcs;
12231225

12241226
if (!block_obj || !block_obj->hw_ops) {
12251227
dev_dbg_once(adev->dev, "%s doesn't config RAS function\n",
12261228
ras_block_str(block));
12271229
return -EOPNOTSUPP;
12281230
}
12291231

1230-
if (!amdgpu_ras_is_supported(adev, block))
1232+
/* skip ras error reset in gpu reset */
1233+
if ((amdgpu_in_reset(adev) || atomic_read(&ras->in_recovery)) &&
1234+
mca_funcs && mca_funcs->mca_set_debug_mode)
1235+
return -EOPNOTSUPP;
1236+
1237+
if (!amdgpu_ras_is_supported(adev, block) ||
1238+
!amdgpu_ras_get_mca_debug_mode(adev))
12311239
return -EOPNOTSUPP;
12321240

12331241
if (block_obj->hw_ops->reset_ras_error_count)

0 commit comments

Comments
 (0)