edac, mce: correct corenum reporting
authorBorislav Petkov <borislav.petkov@amd.com>
Mon, 14 Dec 2009 18:34:35 +0000 (19:34 +0100)
committerBorislav Petkov <borislav.petkov@amd.com>
Tue, 15 Dec 2009 14:52:13 +0000 (15:52 +0100)
Fix core number reporting with NB MCEs.

Signed-off-by: Borislav Petkov <borislav.petkov@amd.com>
drivers/edac/edac_mce_amd.c

index c693fcc2213c67181126df50168071f1b0210413..9965b8daca742baaf59f4ed27ccf32632e8a2c46 100644 (file)
@@ -310,10 +310,9 @@ void amd_decode_nb_mce(int node_id, struct err_regs *regs, int handle_errors)
                if (regs->nbsh & K8_NBSH_ERR_CPU_VAL)
                        pr_cont(", core: %u\n", (u8)(regs->nbsh & 0xf));
        } else {
-               pr_cont(", core: %d\n", ilog2((regs->nbsh & 0xf)));
+               pr_cont(", core: %d\n", fls((regs->nbsh & 0xf) - 1));
        }
 
-
        pr_emerg("%s.\n", EXT_ERR_MSG(xec));
 
        if (BUS_ERROR(ec) && nb_bus_decoder)