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

From: Koba Ko
Date: Wed Jun 28 2023 - 23:56:00 EST


hi Luck,
I agree with your points
is it expected to shift with negative?

Thanks
Koba Ko

On Thu, Jun 29, 2023 at 12:41 AM Luck, Tony <tony.luck@xxxxxxxxx> wrote:
>
> > 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
>
>