Commit e931d0da authored by Punit Agrawal's avatar Punit Agrawal Committed by Rafael J. Wysocki

ACPI / APEI: Suppress message if HEST not present

According to the ACPI specification, firmware is not required to provide
the Hardware Error Source Table (HEST). When HEST is not present, the
following superfluous message is printed to the kernel boot log -

[    3.460067] GHES: HEST is not enabled!

Extend hest_disable variable to track whether the firmware provides this
table and if it is not present skip any log output. The existing
behaviour is preserved in all other cases.
Suggested-by: default avatarBorislav Petkov <bp@suse.de>
Signed-off-by: default avatarPunit Agrawal <punit.agrawal@arm.com>
Reviewed-by: default avatarBorislav Petkov <bp@suse.de>
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent 1d5d820b
...@@ -1266,9 +1266,14 @@ static int __init ghes_init(void) ...@@ -1266,9 +1266,14 @@ static int __init ghes_init(void)
if (acpi_disabled) if (acpi_disabled)
return -ENODEV; return -ENODEV;
if (hest_disable) { switch (hest_disable) {
case HEST_NOT_FOUND:
return -ENODEV;
case HEST_DISABLED:
pr_info(GHES_PFX "HEST is not enabled!\n"); pr_info(GHES_PFX "HEST is not enabled!\n");
return -EINVAL; return -EINVAL;
default:
break;
} }
if (ghes_disable) { if (ghes_disable) {
......
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
#define HEST_PFX "HEST: " #define HEST_PFX "HEST: "
bool hest_disable; int hest_disable;
EXPORT_SYMBOL_GPL(hest_disable); EXPORT_SYMBOL_GPL(hest_disable);
/* HEST table parsing */ /* HEST table parsing */
...@@ -213,7 +213,7 @@ static int __init hest_ghes_dev_register(unsigned int ghes_count) ...@@ -213,7 +213,7 @@ static int __init hest_ghes_dev_register(unsigned int ghes_count)
static int __init setup_hest_disable(char *str) static int __init setup_hest_disable(char *str)
{ {
hest_disable = 1; hest_disable = HEST_DISABLED;
return 0; return 0;
} }
...@@ -232,9 +232,10 @@ void __init acpi_hest_init(void) ...@@ -232,9 +232,10 @@ void __init acpi_hest_init(void)
status = acpi_get_table(ACPI_SIG_HEST, 0, status = acpi_get_table(ACPI_SIG_HEST, 0,
(struct acpi_table_header **)&hest_tab); (struct acpi_table_header **)&hest_tab);
if (status == AE_NOT_FOUND) if (status == AE_NOT_FOUND) {
goto err; hest_disable = HEST_NOT_FOUND;
else if (ACPI_FAILURE(status)) { return;
} else if (ACPI_FAILURE(status)) {
const char *msg = acpi_format_exception(status); const char *msg = acpi_format_exception(status);
pr_err(HEST_PFX "Failed to get table, %s\n", msg); pr_err(HEST_PFX "Failed to get table, %s\n", msg);
rc = -EINVAL; rc = -EINVAL;
...@@ -257,5 +258,5 @@ void __init acpi_hest_init(void) ...@@ -257,5 +258,5 @@ void __init acpi_hest_init(void)
pr_info(HEST_PFX "Table parsing has been initialized.\n"); pr_info(HEST_PFX "Table parsing has been initialized.\n");
return; return;
err: err:
hest_disable = 1; hest_disable = HEST_DISABLED;
} }
...@@ -16,7 +16,13 @@ ...@@ -16,7 +16,13 @@
#ifdef __KERNEL__ #ifdef __KERNEL__
extern bool hest_disable; enum hest_status {
HEST_ENABLED,
HEST_DISABLED,
HEST_NOT_FOUND,
};
extern int hest_disable;
extern int erst_disable; extern int erst_disable;
#ifdef CONFIG_ACPI_APEI_GHES #ifdef CONFIG_ACPI_APEI_GHES
extern bool ghes_disable; extern bool ghes_disable;
......
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