drm/amdgpu: normalize error return of RAS command wrapper functions
Subsystems (2)
PATCH v2 2/2 drm/amdgpu: normalize error return of RAS command wrapper functions
normalize error return of RAS command wrapper functions
Signed-off-by Ce Sun <[email protected]>
--- drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 5 +++-- drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c +3 -2
@@ -1436,7 +1436,7 @@ static int amdgpu_uniras_clear_badpages_info(struct amdgpu_device *adev) &req, sizeof(req), NULL, 0);if (ret) {dev_err (adev->dev,"Failed to clear bad pages info, ret: %d\n" , ret); -return ret; +return -EINVAL ; }return 0 ;
@@ -1457,6 +1457,7 @@ static int amdgpu_uniras_query_block_ecc(struct amdgpu_device *adev, ret =amdgpu_ras_mgr_handle_ras_cmd (adev,RAS_CMD__GET_BLOCK_ECC_STATUS , &req,sizeof (req), &rsp,sizeof (rsp)); +if (!ret) { info->ce_count = rsp.ce_count; info->ue_count = rsp.ue_count;
@@ -1536,7 +1537,7 @@ static int amdgpu_uniras_error_inject(struct amdgpu_device *adev, inject_req.method = info->value;return amdgpu_ras_mgr_handle_ras_cmd (adev,RAS_CMD__INJECT_ERROR , - &inject_req,sizeof (inject_req), &rsp,sizeof (rsp)); + &inject_req,sizeof (inject_req), &rsp,sizeof (rsp)) ? -EINVAL :0 ; }/* wrapper of psp_ras_trigger_error */
drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c +2 -2
@@ -526,7 +526,7 @@ static ssize_t amdgpu_ras_cper_debugfs_read(struct file *f, char __user *buf, snapshot_req,sizeof (struct ras_cmd_cper_snapshot_req ), snapshot_rsp, sizeof(struct ras_cmd_cper_snapshot_rsp));if (r) -return r; +return -EINVAL ;if (!snapshot_rsp->total_cper_num) {if (!read_header)
@@ -568,7 +568,7 @@ static ssize_t amdgpu_ras_cper_debugfs_read(struct file *f, char __user *buf, record_rsp, sizeof(struct ras_cmd_cper_record_rsp));if (r) -return r; +return -EINVAL ;if (!record_rsp->real_data_size || !record_rsp->real_cper_num)break ;
Signature · 1 line
2.34.1