Skip to content

Commit 42139eb

Browse files
Chen, Gongsuryasaimadhu
authored andcommitted
ACPI, eMCA: Combine eMCA/EDAC event reporting priority
eMCA has higher H/W event reporting priority. Once it is loaded, EDAC event reporting should be disabled, unless EDAC overrides eMCA priority via command line parameter "edac_report=force". Signed-off-by: Chen, Gong <gong.chen@linux.intel.com> Acked-by: Tony Luck <tony.luck@intel.com> Link: http://lkml.kernel.org/r/1386310630-12529-4-git-send-email-gong.chen@linux.intel.com [ Boris: massage printk message. ] Signed-off-by: Borislav Petkov <bp@suse.de>
1 parent fd52103 commit 42139eb

1 file changed

Lines changed: 16 additions & 2 deletions

File tree

‎drivers/acpi/acpi_extlog.c‎

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#include <acpi/acpi_bus.h>
1313
#include <linux/cper.h>
1414
#include <linux/ratelimit.h>
15+
#include <linux/edac.h>
1516
#include <asm/cpu.h>
1617
#include <asm/mce.h>
1718

@@ -43,6 +44,8 @@ struct extlog_l1_head {
4344
u8 rev1[12];
4445
};
4546

47+
static int old_edac_report_status;
48+
4649
static u8 extlog_dsm_uuid[] = "663E35AF-CC10-41A4-88EA-5470AF055295";
4750

4851
/* L1 table related physical address */
@@ -150,7 +153,7 @@ static int extlog_print(struct notifier_block *nb, unsigned long val,
150153

151154
rc = print_extlog_rcd(NULL, (struct acpi_generic_status *)elog_buf, cpu);
152155

153-
return NOTIFY_DONE;
156+
return NOTIFY_STOP;
154157
}
155158

156159
static int extlog_get_dsm(acpi_handle handle, int rev, int func, u64 *ret)
@@ -231,8 +234,12 @@ static int __init extlog_init(void)
231234
u64 cap;
232235
int rc;
233236

234-
rc = -ENODEV;
237+
if (get_edac_report_status() == EDAC_REPORTING_FORCE) {
238+
pr_warn("Not loading eMCA, error reporting force-enabled through EDAC.\n");
239+
return -EPERM;
240+
}
235241

242+
rc = -ENODEV;
236243
rdmsrl(MSR_IA32_MCG_CAP, cap);
237244
if (!(cap & MCG_ELOG_P))
238245
return rc;
@@ -287,6 +294,12 @@ static int __init extlog_init(void)
287294
if (elog_buf == NULL)
288295
goto err_release_elog;
289296

297+
/*
298+
* eMCA event report method has higher priority than EDAC method,
299+
* unless EDAC event report method is mandatory.
300+
*/
301+
old_edac_report_status = get_edac_report_status();
302+
set_edac_report_status(EDAC_REPORTING_DISABLED);
290303
mce_register_decode_chain(&extlog_mce_dec);
291304
/* enable OS to be involved to take over management from BIOS */
292305
((struct extlog_l1_head *)extlog_l1_addr)->flags |= FLAG_OS_OPTIN;
@@ -308,6 +321,7 @@ static int __init extlog_init(void)
308321

309322
static void __exit extlog_exit(void)
310323
{
324+
set_edac_report_status(old_edac_report_status);
311325
mce_unregister_decode_chain(&extlog_mce_dec);
312326
((struct extlog_l1_head *)extlog_l1_addr)->flags &= ~FLAG_OS_OPTIN;
313327
if (extlog_l1_addr)

0 commit comments

Comments
 (0)