Skip to content

Commit

Permalink
edac, mce: Fix wrong mask and macro usage
Browse files Browse the repository at this point in the history
Correct two mishaps which prevented reporting error type (CECC vs UECC)
and extended error description.

Cc: <stable@kernel.org> # 32.x,  33.x
Signed-off-by: Borislav Petkov <borislav.petkov@amd.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Borislav Petkov authored and Linus Torvalds committed Apr 30, 2010
1 parent 12b1b32 commit 35d824b
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions drivers/edac/edac_mce_amd.c
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,6 @@ static void amd_decode_ls_mce(u64 mc3_status)
void amd_decode_nb_mce(int node_id, struct err_regs *regs, int handle_errors)
{
u32 ec = ERROR_CODE(regs->nbsl);
u32 xec = EXT_ERROR_CODE(regs->nbsl);

if (!handle_errors)
return;
Expand Down Expand Up @@ -324,7 +323,7 @@ void amd_decode_nb_mce(int node_id, struct err_regs *regs, int handle_errors)
pr_cont("\n");
}

pr_emerg("%s.\n", EXT_ERR_MSG(xec));
pr_emerg("%s.\n", EXT_ERR_MSG(regs->nbsl));

if (BUS_ERROR(ec) && nb_bus_decoder)
nb_bus_decoder(node_id, regs);
Expand Down Expand Up @@ -374,7 +373,7 @@ static int amd_decode_mce(struct notifier_block *nb, unsigned long val,
((m->status & MCI_STATUS_PCC) ? "yes" : "no"));

/* do the two bits[14:13] together */
ecc = m->status & (3ULL << 45);
ecc = (m->status >> 45) & 0x3;
if (ecc)
pr_cont(", %sECC Error", ((ecc == 2) ? "C" : "U"));

Expand Down

0 comments on commit 35d824b

Please sign in to comment.