Skip to content

Commit dccbe20

Browse files
committed
Merge tag 'edac_urgent_for_v6.13_rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/ras/ras
Pull EDAC fix from Borislav Petkov: - Make sure amd64_edac loads successfully on certain Zen4 memory configurations * tag 'edac_urgent_for_v6.13_rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/ras/ras: EDAC/amd64: Simplify ECC check on unified memory controllers
2 parents f7c7a1b + 7473673 commit dccbe20

File tree

1 file changed

+10
-22
lines changed

1 file changed

+10
-22
lines changed

drivers/edac/amd64_edac.c

Lines changed: 10 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -3362,36 +3362,24 @@ static bool dct_ecc_enabled(struct amd64_pvt *pvt)
33623362

33633363
static bool umc_ecc_enabled(struct amd64_pvt *pvt)
33643364
{
3365-
u8 umc_en_mask = 0, ecc_en_mask = 0;
3366-
u16 nid = pvt->mc_node_id;
33673365
struct amd64_umc *umc;
3368-
u8 ecc_en = 0, i;
3366+
bool ecc_en = false;
3367+
int i;
33693368

3369+
/* Check whether at least one UMC is enabled: */
33703370
for_each_umc(i) {
33713371
umc = &pvt->umc[i];
33723372

3373-
/* Only check enabled UMCs. */
3374-
if (!(umc->sdp_ctrl & UMC_SDP_INIT))
3375-
continue;
3376-
3377-
umc_en_mask |= BIT(i);
3378-
3379-
if (umc->umc_cap_hi & UMC_ECC_ENABLED)
3380-
ecc_en_mask |= BIT(i);
3373+
if (umc->sdp_ctrl & UMC_SDP_INIT &&
3374+
umc->umc_cap_hi & UMC_ECC_ENABLED) {
3375+
ecc_en = true;
3376+
break;
3377+
}
33813378
}
33823379

3383-
/* Check whether at least one UMC is enabled: */
3384-
if (umc_en_mask)
3385-
ecc_en = umc_en_mask == ecc_en_mask;
3386-
else
3387-
edac_dbg(0, "Node %d: No enabled UMCs.\n", nid);
3388-
3389-
edac_dbg(3, "Node %d: DRAM ECC %s.\n", nid, (ecc_en ? "enabled" : "disabled"));
3380+
edac_dbg(3, "Node %d: DRAM ECC %s.\n", pvt->mc_node_id, (ecc_en ? "enabled" : "disabled"));
33903381

3391-
if (!ecc_en)
3392-
return false;
3393-
else
3394-
return true;
3382+
return ecc_en;
33953383
}
33963384

33973385
static inline void

0 commit comments

Comments
 (0)