Commit 7389a5b8 authored by yipechai's avatar yipechai Committed by Alex Deucher

drm/amdgpu: Removed redundant ras code

Removed redundant ras code.
Signed-off-by: default avataryipechai <YiPeng.Chai@amd.com>
Reviewed-by: default avatarHawking Zhang <Hawking.Zhang@amd.com>
Reviewed-by: default avatarJohn Clements <john.clements@amd.com>
Reviewed-by: default avatarTao Zhou <tao.zhou1@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 22d4ba53
...@@ -946,40 +946,25 @@ int amdgpu_ras_query_error_status(struct amdgpu_device *adev, ...@@ -946,40 +946,25 @@ int amdgpu_ras_query_error_status(struct amdgpu_device *adev,
if (!obj) if (!obj)
return -EINVAL; return -EINVAL;
block_obj = amdgpu_ras_get_ras_block(adev, info->head.block, 0); if (info->head.block == AMDGPU_RAS_BLOCK__UMC) {
switch (info->head.block) {
case AMDGPU_RAS_BLOCK__UMC:
amdgpu_ras_get_ecc_info(adev, &err_data); amdgpu_ras_get_ecc_info(adev, &err_data);
break; } else {
case AMDGPU_RAS_BLOCK__SDMA: block_obj = amdgpu_ras_get_ras_block(adev, info->head.block, 0);
case AMDGPU_RAS_BLOCK__GFX:
case AMDGPU_RAS_BLOCK__MMHUB:
if (!block_obj || !block_obj->hw_ops) { if (!block_obj || !block_obj->hw_ops) {
dev_info(adev->dev, "%s doesn't config ras function \n", dev_info(adev->dev, "%s doesn't config ras function \n",
get_ras_block_str(&info->head)); get_ras_block_str(&info->head));
return -EINVAL; return -EINVAL;
} }
if (block_obj->hw_ops->query_ras_error_count)
block_obj->hw_ops->query_ras_error_count(adev, &err_data);
if (block_obj->hw_ops->query_ras_error_status)
block_obj->hw_ops->query_ras_error_status(adev);
break;
case AMDGPU_RAS_BLOCK__PCIE_BIF:
case AMDGPU_RAS_BLOCK__XGMI_WAFL:
case AMDGPU_RAS_BLOCK__HDP:
case AMDGPU_RAS_BLOCK__MCA:
if (!block_obj || !block_obj->hw_ops) {
dev_info(adev->dev, "%s doesn't config ras function \n",
get_ras_block_str(&info->head));
return -EINVAL;
}
if (block_obj->hw_ops->query_ras_error_count) if (block_obj->hw_ops->query_ras_error_count)
block_obj->hw_ops->query_ras_error_count(adev, &err_data); block_obj->hw_ops->query_ras_error_count(adev, &err_data);
break;
default: if ((info->head.block == AMDGPU_RAS_BLOCK__SDMA) ||
break; (info->head.block == AMDGPU_RAS_BLOCK__GFX) ||
(info->head.block == AMDGPU_RAS_BLOCK__MMHUB)) {
if (block_obj->hw_ops->query_ras_error_status)
block_obj->hw_ops->query_ras_error_status(adev);
}
} }
obj->err_data.ue_count += err_data.ue_count; obj->err_data.ue_count += err_data.ue_count;
...@@ -1041,32 +1026,18 @@ int amdgpu_ras_reset_error_status(struct amdgpu_device *adev, ...@@ -1041,32 +1026,18 @@ int amdgpu_ras_reset_error_status(struct amdgpu_device *adev,
if (!amdgpu_ras_is_supported(adev, block)) if (!amdgpu_ras_is_supported(adev, block))
return -EINVAL; return -EINVAL;
switch (block) { if (!block_obj || !block_obj->hw_ops) {
case AMDGPU_RAS_BLOCK__GFX: dev_info(adev->dev, "%s doesn't config ras function \n", ras_block_str(block));
case AMDGPU_RAS_BLOCK__MMHUB: return -EINVAL;
if (!block_obj || !block_obj->hw_ops) { }
dev_info(adev->dev, "%s doesn't config ras function \n", ras_block_str(block));
return -EINVAL;
}
if (block_obj->hw_ops->reset_ras_error_count) if (block_obj->hw_ops->reset_ras_error_count)
block_obj->hw_ops->reset_ras_error_count(adev); block_obj->hw_ops->reset_ras_error_count(adev);
if ((block == AMDGPU_RAS_BLOCK__GFX) ||
(block == AMDGPU_RAS_BLOCK__MMHUB)) {
if (block_obj->hw_ops->reset_ras_error_status) if (block_obj->hw_ops->reset_ras_error_status)
block_obj->hw_ops->reset_ras_error_status(adev); block_obj->hw_ops->reset_ras_error_status(adev);
break;
case AMDGPU_RAS_BLOCK__SDMA:
case AMDGPU_RAS_BLOCK__HDP:
if (!block_obj || !block_obj->hw_ops) {
dev_info(adev->dev, "%s doesn't config ras function \n", ras_block_str(block));
return -EINVAL;
}
if (block_obj->hw_ops->reset_ras_error_count)
block_obj->hw_ops->reset_ras_error_count(adev);
break;
default:
break;
} }
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment