ACPI: extlog: Clear Extended Error Log status when RAS_CEC handled the error
authorTony Luck <tony.luck@intel.com>
Tue, 12 Dec 2023 21:22:39 +0000 (13:22 -0800)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Wed, 13 Dec 2023 12:50:00 +0000 (13:50 +0100)
When both CONFIG_RAS_CEC and CONFIG_ACPI_EXTLOG are enabled, Linux does
not clear the status word of the BIOS supplied error record for corrected
errors. This may prevent logging of subsequent uncorrected errors.

Fix by clearing the status.

Fixes: 23ba710a0864 ("x86/mce: Fix all mce notifiers to update the mce->kflags bitmask")
Reported-by: Erwin Tsaur <erwin.tsaur@intel.com>
Signed-off-by: Tony Luck <tony.luck@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/acpi/acpi_extlog.c

index 193147769146eae5aafad66d3146456892646281..ca87a093913599ea4681c0179ea2c6a85e18bfb3 100644 (file)
@@ -145,9 +145,14 @@ static int extlog_print(struct notifier_block *nb, unsigned long val,
        static u32 err_seq;
 
        estatus = extlog_elog_entry_check(cpu, bank);
-       if (estatus == NULL || (mce->kflags & MCE_HANDLED_CEC))
+       if (!estatus)
                return NOTIFY_DONE;
 
+       if (mce->kflags & MCE_HANDLED_CEC) {
+               estatus->block_status = 0;
+               return NOTIFY_DONE;
+       }
+
        memcpy(elog_buf, (void *)estatus, ELOG_ENTRY_LEN);
        /* clear record status to enable BIOS to update it again */
        estatus->block_status = 0;