EDAC/amd64: Adjust UMC channel for Hygon family 18h model 6h

Hygon family 18h model 6h has 2 cs mapped to 1 umc, so adjust for it.

Fixes: 6cf6141e
 ("EDAC/amd64: Add support for Hygon family 18h model 6h")

Signed-off-by: fuhao <fuh@hygon.cn>
Signed-off-by: Jinliang Zheng <alexjlzheng@tencent.com>
Reviewed-by: Bin Lai <robinlai@tencent.com>
Signed-off-by: Jinliang Zheng <alexjlzheng@tencent.com>
Reviewed-by: caelli <caelli@tencent.com>
Signed-off-by: Jianping Liu <frankjpliu@tencent.com>
This commit is contained in:
fuhao 2024-02-01 17:34:35 +08:00 committed by Jianping Liu
parent af62cfaf8b
commit 768858da65
1 changed files with 7 additions and 1 deletions

View File

@ -2751,6 +2751,7 @@ static void decode_umc_error(int node_id, struct mce *m)
struct amd64_pvt *pvt;
struct err_info err;
u64 sys_addr;
u8 umc;
mci = edac_mc_find(node_id);
if (!mci)
@ -2781,7 +2782,12 @@ static void decode_umc_error(int node_id, struct mce *m)
err.csrow = m->synd & 0x7;
if (umc_normaddr_to_sysaddr(m->addr, pvt->mc_node_id, err.channel, &sys_addr)) {
if (hygon_f18h_m4h() && boot_cpu_data.x86_model == 0x6)
umc = err.channel << 1;
else
umc = err.channel;
if (umc_normaddr_to_sysaddr(m->addr, pvt->mc_node_id, umc, &sys_addr)) {
err.err_code = ERR_NORM_ADDR;
goto log_error;
}