diff options
author | 2023-09-15 18:44:17 +0800 | |
---|---|---|
committer | 2023-09-20 16:24:09 -0400 | |
commit | a83f2bf1f4d95582cadb0136f0e1bd5b398b5c90 (patch) | |
tree | a5e3c5759e91d962d2e45f923108a7abeeefe913 /drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | |
parent | drm/amdgpu/jpeg: skip set pg for sriov (diff) | |
download | linux-a83f2bf1f4d95582cadb0136f0e1bd5b398b5c90.tar.gz linux-a83f2bf1f4d95582cadb0136f0e1bd5b398b5c90.tar.bz2 linux-a83f2bf1f4d95582cadb0136f0e1bd5b398b5c90.zip |
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: Stanley.Yang <Stanley.Yang@amd.com>
Reviewed-by: Tao Zhou <tao.zhou1@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c index 62dca5d80fb6..9c8203e87859 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c @@ -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); - if (!amdgpu_ras_is_supported(adev, block)) - return -EINVAL; - - if (!block_obj || !block_obj->hw_ops) { + if (!block_obj || !block_obj->hw_ops) { dev_dbg_once(adev->dev, "%s doesn't config RAS function\n", 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) block_obj->hw_ops->reset_ras_error_count(adev); |