Commit 18807ddb authored by Yazen Ghannam's avatar Yazen Ghannam Committed by Thomas Gleixner

x86/mce/AMD: Reset Threshold Limit after logging error

The error count field in MCA_MISC does not get reset by hardware when the
threshold has been reached. Software is expected to reset it. Currently,
the threshold limit only gets reset during init or when a user writes to

If the user is not monitoring threshold interrupts and resetting
the limit then the user will only see 1 interrupt when the limit is first
hit. So if, for example, the limit is set to 10 then only 1 interrupt will
be recorded after 10 errors even if 100 errors have occurred. The user may
then assume that only 10 errors have occurred.
Signed-off-by: default avatarYazen Ghannam <>
Cc: Aravind Gopalakrishnan <>
Cc: linux-edac <>
Cc: x86-ml <>
Link: default avatarBorislav Petkov <>
Signed-off-by: default avatarThomas Gleixner <>
parent 859af13a
......@@ -665,6 +665,7 @@ static void amd_threshold_interrupt(void)
u32 low = 0, high = 0, address = 0;
unsigned int bank, block, cpu = smp_processor_id();
struct thresh_restart tr;
/* assume first bank caused it */
for (bank = 0; bank < mca_cfg.banks; ++bank) {
......@@ -701,6 +702,11 @@ static void amd_threshold_interrupt(void)
__log_error(bank, false, true, ((u64)high << 32) | low);
/* Reset threshold block after logging error. */
memset(&tr, 0, sizeof(tr));
tr.b = &per_cpu(threshold_banks, cpu)[bank]->blocks[block];
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