RE: [PATCH] EDAC/i10nm: shift exponent is negative

From: Luck, Tony
Date: Wed Jun 28 2023 - 12:40:11 EST


> ranks = numrank(mtr);
> rows = numrow(mtr);
> cols = imc->hbm_mc ? 6 : numcol(mtr);
> + if (ranks == -EINVAL || rows == -EINVAL || cols == -EINVAL)
> + return 0;

This seems to be just hiding the real problem that a DIMM was found
with some number of ranks, rows, or columns that the EDAC driver
didn't expect to see. Your fix makes the driver skip over this DIMM.

Can you build your kernel with CONFIG_EDAC_DEBUG=y and see
what messages you get from this code:

static int skx_get_dimm_attr(u32 reg, int lobit, int hibit, int add,
int minval, int maxval, const char *name)
{
u32 val = GET_BITFIELD(reg, lobit, hibit);

if (val < minval || val > maxval) {
edac_dbg(2, "bad %s = %d (raw=0x%x)\n", name, val, reg);
return -EINVAL;
}

-Tony