Skip to content

Commit fe2ccc7

Browse files
YiPeng Chaialexdeucher
authored andcommitted
drm/amdgpu: query block error count of ras module
Query block error count of ras module. Signed-off-by: YiPeng Chai <YiPeng.Chai@amd.com> Reviewed-by: Tao Zhou <tao.zhou1@amd.com> Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
1 parent 91da591 commit fe2ccc7

1 file changed

Lines changed: 28 additions & 1 deletion

File tree

drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1543,9 +1543,36 @@ static int amdgpu_ras_query_error_status_with_event(struct amdgpu_device *adev,
15431543
return ret;
15441544
}
15451545

1546+
static int amdgpu_uniras_query_block_ecc(struct amdgpu_device *adev,
1547+
struct ras_query_if *info)
1548+
{
1549+
struct ras_cmd_block_ecc_info_req req = {0};
1550+
struct ras_cmd_block_ecc_info_rsp rsp = {0};
1551+
int ret;
1552+
1553+
if (!info)
1554+
return -EINVAL;
1555+
1556+
req.block_id = info->head.block;
1557+
req.subblock_id = info->head.sub_block_index;
1558+
1559+
ret = amdgpu_ras_mgr_handle_ras_cmd(adev, RAS_CMD__GET_BLOCK_ECC_STATUS,
1560+
&req, sizeof(req), &rsp, sizeof(rsp));
1561+
if (!ret) {
1562+
info->ce_count = rsp.ce_count;
1563+
info->ue_count = rsp.ue_count;
1564+
info->de_count = rsp.de_count;
1565+
}
1566+
1567+
return ret;
1568+
}
1569+
15461570
int amdgpu_ras_query_error_status(struct amdgpu_device *adev, struct ras_query_if *info)
15471571
{
1548-
return amdgpu_ras_query_error_status_with_event(adev, info, RAS_EVENT_TYPE_INVALID);
1572+
if (amdgpu_uniras_enabled(adev))
1573+
return amdgpu_uniras_query_block_ecc(adev, info);
1574+
else
1575+
return amdgpu_ras_query_error_status_with_event(adev, info, RAS_EVENT_TYPE_INVALID);
15491576
}
15501577

15511578
int amdgpu_ras_reset_error_count(struct amdgpu_device *adev,

0 commit comments

Comments
 (0)