Commit a200034b authored by John Clements's avatar John Clements Committed by Alex Deucher

drm/amdgpu: update RAS error handling

Parse return status from TA to determine error severity
Reviewed-by: default avatarHawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: default avatarJohn Clements <john.clements@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 3f12acc8
...@@ -502,6 +502,29 @@ struct ras_manager *amdgpu_ras_find_obj(struct amdgpu_device *adev, ...@@ -502,6 +502,29 @@ struct ras_manager *amdgpu_ras_find_obj(struct amdgpu_device *adev,
} }
/* obj end */ /* obj end */
void amdgpu_ras_parse_status_code(struct amdgpu_device* adev,
const char* invoke_type,
const char* block_name,
enum ta_ras_status ret)
{
switch (ret) {
case TA_RAS_STATUS__SUCCESS:
return;
case TA_RAS_STATUS__ERROR_RAS_NOT_AVAILABLE:
dev_warn(adev->dev,
"RAS WARN: %s %s currently unavailable\n",
invoke_type,
block_name);
break;
default:
dev_err(adev->dev,
"RAS ERROR: %s %s error failed ret 0x%X\n",
invoke_type,
block_name,
ret);
}
}
/* feature ctl begin */ /* feature ctl begin */
static int amdgpu_ras_is_feature_allowed(struct amdgpu_device *adev, static int amdgpu_ras_is_feature_allowed(struct amdgpu_device *adev,
struct ras_common_if *head) struct ras_common_if *head)
...@@ -592,11 +615,10 @@ int amdgpu_ras_feature_enable(struct amdgpu_device *adev, ...@@ -592,11 +615,10 @@ int amdgpu_ras_feature_enable(struct amdgpu_device *adev,
if (!amdgpu_ras_intr_triggered()) { if (!amdgpu_ras_intr_triggered()) {
ret = psp_ras_enable_features(&adev->psp, &info, enable); ret = psp_ras_enable_features(&adev->psp, &info, enable);
if (ret) { if (ret) {
dev_err(adev->dev, "RAS ERROR: %s %s feature " amdgpu_ras_parse_status_code(adev,
"failed ret %d\n", enable ? "enable":"disable",
enable ? "enable":"disable", ras_block_str(head->block),
ras_block_str(head->block), (enum ta_ras_status)ret);
ret);
if (ret == TA_RAS_STATUS__RESET_NEEDED) if (ret == TA_RAS_STATUS__RESET_NEEDED)
return -EAGAIN; return -EAGAIN;
return -EINVAL; return -EINVAL;
...@@ -821,10 +843,10 @@ int amdgpu_ras_error_inject(struct amdgpu_device *adev, ...@@ -821,10 +843,10 @@ int amdgpu_ras_error_inject(struct amdgpu_device *adev,
ret = -EINVAL; ret = -EINVAL;
} }
if (ret) amdgpu_ras_parse_status_code(adev,
dev_err(adev->dev, "RAS ERROR: inject %s error failed ret %d\n", "inject",
ras_block_str(info->head.block), ras_block_str(info->head.block),
ret); (enum ta_ras_status)ret);
return ret; return ret;
} }
......
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