Skip to content

Commit 3bba4bc

Browse files
Yang Wangalexdeucher
authored andcommitted
drm/amdgpu: add RAS error info support for umc_v12_0
add RAS error info support for umc_v12_0. Signed-off-by: Yang Wang <[email protected]> Reviewed-by: Tao Zhou <[email protected]> Reviewed-by: Hawking Zhang <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent 8736d17 commit 3bba4bc

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed

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

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -137,15 +137,23 @@ static int umc_v12_0_query_error_count(struct amdgpu_device *adev,
137137
uint32_t ch_inst, void *data)
138138
{
139139
struct ras_err_data *err_data = (struct ras_err_data *)data;
140+
unsigned long ue_count = 0, ce_count = 0;
141+
142+
/* NOTE: node_inst is converted by adev->umc.active_mask and the range is [0-3],
143+
* which can be used as die ID directly */
144+
struct amdgpu_smuio_mcm_config_info mcm_info = {
145+
.socket_id = adev->smuio.funcs->get_socket_id(adev),
146+
.die_id = node_inst,
147+
};
148+
140149
uint64_t umc_reg_offset =
141150
get_umc_v12_0_reg_offset(adev, node_inst, umc_inst, ch_inst);
142151

143-
umc_v12_0_query_correctable_error_count(adev,
144-
umc_reg_offset,
145-
&(err_data->ce_count));
146-
umc_v12_0_query_uncorrectable_error_count(adev,
147-
umc_reg_offset,
148-
&(err_data->ue_count));
152+
umc_v12_0_query_correctable_error_count(adev, umc_reg_offset, &ce_count);
153+
umc_v12_0_query_uncorrectable_error_count(adev, umc_reg_offset, &ue_count);
154+
155+
amdgpu_ras_error_statistic_ue_count(err_data, &mcm_info, ue_count);
156+
amdgpu_ras_error_statistic_ce_count(err_data, &mcm_info, ce_count);
149157

150158
return 0;
151159
}

0 commit comments

Comments
 (0)