From b6a9501658530d8b8374e37f1edb549039a8a260 Mon Sep 17 00:00:00 2001 From: Huang Ying Date: Wed, 13 Jul 2011 13:14:19 +0800 Subject: [PATCH] ACPI, APEI, GHES, Support disable GHES at boot time Some machine may have broken firmware so that GHES and firmware first mode should be disabled. This patch adds support to that. Signed-off-by: Huang Ying Reviewed-by: Andi Kleen Reviewed-by: Matthew Garrett Signed-off-by: Len Brown --- drivers/acpi/apei/ghes.c | 8 ++++++++ drivers/acpi/apei/hest.c | 17 +++++++++-------- include/acpi/apei.h | 1 + 3 files changed, 18 insertions(+), 8 deletions(-) diff --git a/drivers/acpi/apei/ghes.c b/drivers/acpi/apei/ghes.c index f339c0f8369..b142b94bf8b 100644 --- a/drivers/acpi/apei/ghes.c +++ b/drivers/acpi/apei/ghes.c @@ -77,6 +77,9 @@ struct ghes { }; }; +int ghes_disable; +module_param_named(disable, ghes_disable, bool, 0); + static int ghes_panic_timeout __read_mostly = 30; /* @@ -665,6 +668,11 @@ static int __init ghes_init(void) return -EINVAL; } + if (ghes_disable) { + pr_info(GHES_PFX "GHES is not enabled!\n"); + return -EINVAL; + } + rc = ghes_ioremap_init(); if (rc) goto err; diff --git a/drivers/acpi/apei/hest.c b/drivers/acpi/apei/hest.c index 181bc2f7bb7..05fee06f4d6 100644 --- a/drivers/acpi/apei/hest.c +++ b/drivers/acpi/apei/hest.c @@ -231,16 +231,17 @@ void __init acpi_hest_init(void) goto err; } - rc = apei_hest_parse(hest_parse_ghes_count, &ghes_count); - if (rc) - goto err; - - rc = hest_ghes_dev_register(ghes_count); - if (!rc) { - pr_info(HEST_PFX "Table parsing has been initialized.\n"); - return; + if (!ghes_disable) { + rc = apei_hest_parse(hest_parse_ghes_count, &ghes_count); + if (rc) + goto err; + rc = hest_ghes_dev_register(ghes_count); + if (rc) + goto err; } + pr_info(HEST_PFX "Table parsing has been initialized.\n"); + return; err: hest_disable = 1; } diff --git a/include/acpi/apei.h b/include/acpi/apei.h index e67b523a50e..d40bc5521fc 100644 --- a/include/acpi/apei.h +++ b/include/acpi/apei.h @@ -18,6 +18,7 @@ extern int hest_disable; extern int erst_disable; +extern int ghes_disable; #ifdef CONFIG_ACPI_APEI void __init acpi_hest_init(void); -- 2.41.0