Commit a83f2bf1 authored by Stanley.Yang's avatar Stanley.Yang Committed by Alex Deucher

drm/amdgpu: Fix false positive error log

It should first check block ras obj whether be set, it should
return 0 directly if block ras obj or hw_ops is not set.
If block doesn't support RAS just return 0 is fine.

Changed from V1:
	return 0 directly if block ras obj or hw ops is not set
Signed-off-by: default avatarStanley.Yang <Stanley.Yang@amd.com>
Reviewed-by: default avatarTao Zhou <tao.zhou1@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 8c95cda3
...@@ -1102,15 +1102,15 @@ int amdgpu_ras_reset_error_status(struct amdgpu_device *adev, ...@@ -1102,15 +1102,15 @@ int amdgpu_ras_reset_error_status(struct amdgpu_device *adev,
{ {
struct amdgpu_ras_block_object *block_obj = amdgpu_ras_get_ras_block(adev, block, 0); struct amdgpu_ras_block_object *block_obj = amdgpu_ras_get_ras_block(adev, block, 0);
if (!amdgpu_ras_is_supported(adev, block)) if (!block_obj || !block_obj->hw_ops) {
return -EINVAL;
if (!block_obj || !block_obj->hw_ops) {
dev_dbg_once(adev->dev, "%s doesn't config RAS function\n", dev_dbg_once(adev->dev, "%s doesn't config RAS function\n",
ras_block_str(block)); ras_block_str(block));
return -EINVAL; return 0;
} }
if (!amdgpu_ras_is_supported(adev, block))
return 0;
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);
......
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