drm/amdgpu: check recovery status of xgmi hive in ras_reset_error_count
Subsystems (2)
PATCH 1/1 drm/amdgpu: check recovery status of xgmi hive in ras_reset_error_count
Handle xgmi hive case.
Suggested-by Hawking Zhang <[email protected]>
Signed-off-by Tao Zhou <[email protected]>
--- drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c +10 -1
@@ -1226,6 +1226,8 @@ int amdgpu_ras_reset_error_count(struct amdgpu_device *adev,struct amdgpu_ras_block_object *block_obj =amdgpu_ras_get_ras_block (adev, block,0 );struct amdgpu_ras *ras =amdgpu_ras_get_context (adev);const struct amdgpu_mca_smu_funcs *mca_funcs = adev->mca.mca_funcs; +struct amdgpu_hive_info *hive; +int hive_ras_recovery =0 ;if (!block_obj || !block_obj->hw_ops) { dev_dbg_once(adev->dev, "%s doesn't config RAS function\n",
@@ -1237,8 +1239,15 @@ int amdgpu_ras_reset_error_count(struct amdgpu_device *adev, !amdgpu_ras_get_mca_debug_mode(adev))return -EOPNOTSUPP ; + hive =amdgpu_get_xgmi_hive (adev); +if (hive) { + hive_ras_recovery =atomic_read (&hive->ras_recovery); +amdgpu_put_xgmi_hive (hive); + } +/* skip ras error reset in gpu reset */ -if ((amdgpu_in_reset (adev) ||atomic_read (&ras->in_recovery)) && +if ((amdgpu_in_reset (adev) ||atomic_read (&ras->in_recovery) || + hive_ras_recovery) && mca_funcs && mca_funcs->mca_set_debug_mode)return -EOPNOTSUPP ;
Signature · 1 line
2.35.1
[AMD Official Use Only - General]
Reviewed-by Stanley.Yang <[email protected]>
Regards,
Stanley
Quoted 55 lines
-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Tao Zhou
Sent: Tuesday, October 31, 2023 3:13 PM
To: [email protected]
Cc: Zhou1, Tao <[email protected]>; Zhang, Hawking <[email protected]>
Subject: [PATCH] drm/amdgpu: check recovery status of xgmi hive inras_reset_error_countHandle xgmi hive case.
Suggested-by Hawking Zhang <[email protected]>Signed-off-by Tao Zhou <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-)drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c +2
-0@@ -1226,6 +1226,8 @@ int amdgpu_ras_reset_error_count(structamdgpu_device *adev, struct amdgpu_ras_block_object *block_obj =amdgpu_ras_get_ras_block (adev, block,0 );struct amdgpu_ras *ras =amdgpu_ras_get_context (adev);const struct amdgpu_mca_smu_funcs *mca_funcs = adev- >mca.mca_funcs; +struct amdgpu_hive_info *hive; +int hive_ras_recovery =0 ;if (!block_obj || !block_obj->hw_ops) { dev_dbg_once(adev->dev, "%s doesn't config RAS function\n", @@ -1237,8 +1239,15 @@ int amdgpu_ras_reset_error_count(struct amdgpu_device *adev, !amdgpu_ras_get_mca_debug_mode(adev)) return -EOPNOTSUPP;drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c +8
-2+ hive =amdgpu_get_xgmi_hive (adev); +if (hive) { + hive_ras_recovery =atomic_read (&hive->ras_recovery); +amdgpu_put_xgmi_hive (hive); + } +/* skip ras error reset in gpu reset */ -if ((amdgpu_in_reset (adev) ||atomic_read (&ras->in_recovery)) && +if ((amdgpu_in_reset (adev) ||atomic_read (&ras->in_recovery) || + hive_ras_recovery) && mca_funcs && mca_funcs->mca_set_debug_mode)return -EOPNOTSUPP ; --2.35.1