Commit 6dc36b37 authored by Borislav Petkov's avatar Borislav Petkov Committed by Greg Kroah-Hartman

edac, mce: Fix wrong mask and macro usage

commit 35d824b2 upstream.

Correct two mishaps which prevented reporting error type (CECC vs UECC)
and extended error description.
Signed-off-by: default avatarBorislav Petkov <borislav.petkov@amd.com>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 9121999d
...@@ -295,7 +295,6 @@ static void amd_decode_ls_mce(u64 mc3_status) ...@@ -295,7 +295,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) void amd_decode_nb_mce(int node_id, struct err_regs *regs, int handle_errors)
{ {
u32 ec = ERROR_CODE(regs->nbsl); u32 ec = ERROR_CODE(regs->nbsl);
u32 xec = EXT_ERROR_CODE(regs->nbsl);
if (!handle_errors) if (!handle_errors)
return; return;
...@@ -319,7 +318,7 @@ void amd_decode_nb_mce(int node_id, struct err_regs *regs, int handle_errors) ...@@ -319,7 +318,7 @@ void amd_decode_nb_mce(int node_id, struct err_regs *regs, int handle_errors)
pr_cont("\n"); 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) if (BUS_ERROR(ec) && nb_bus_decoder)
nb_bus_decoder(node_id, regs); nb_bus_decoder(node_id, regs);
...@@ -382,7 +381,7 @@ static void amd_decode_mce(struct mce *m) ...@@ -382,7 +381,7 @@ static void amd_decode_mce(struct mce *m)
((m->status & MCI_STATUS_PCC) ? "yes" : "no")); ((m->status & MCI_STATUS_PCC) ? "yes" : "no"));
/* do the two bits[14:13] together */ /* do the two bits[14:13] together */
ecc = m->status & (3ULL << 45); ecc = (m->status >> 45) & 0x3;
if (ecc) if (ecc)
pr_cont(", %sECC Error", ((ecc == 2) ? "C" : "U")); pr_cont(", %sECC Error", ((ecc == 2) ? "C" : "U"));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment