ACPI / APEI: Suppress message if HEST not present
authorPunit Agrawal <punit.agrawal@arm.com>
Tue, 29 Aug 2017 13:20:20 +0000 (14:20 +0100)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Wed, 30 Aug 2017 01:11:21 +0000 (03:11 +0200)
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: Borislav Petkov <bp@suse.de>
Signed-off-by: Punit Agrawal <punit.agrawal@arm.com>
Reviewed-by: Borislav Petkov <bp@suse.de>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/acpi/apei/ghes.c
drivers/acpi/apei/hest.c
include/acpi/apei.h

index eed09fc664e84233948535dd42f824974ef3b41f..077f9bad6f44a57bd01e930f9dd740001eadcd76 100644 (file)
@@ -1266,9 +1266,14 @@ static int __init ghes_init(void)
        if (acpi_disabled)
                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");
                return -EINVAL;
+       default:
+               break;
        }
 
        if (ghes_disable) {
index 456b488eb1df5bf016606cc2ba412b6335613eea..9cb74115a43d76bbfa845feb57ef779bf320f0ad 100644 (file)
@@ -37,7 +37,7 @@
 
 #define HEST_PFX "HEST: "
 
-bool hest_disable;
+int hest_disable;
 EXPORT_SYMBOL_GPL(hest_disable);
 
 /* HEST table parsing */
@@ -213,7 +213,7 @@ err:
 
 static int __init setup_hest_disable(char *str)
 {
-       hest_disable = 1;
+       hest_disable = HEST_DISABLED;
        return 0;
 }
 
@@ -232,9 +232,10 @@ void __init acpi_hest_init(void)
 
        status = acpi_get_table(ACPI_SIG_HEST, 0,
                                (struct acpi_table_header **)&hest_tab);
-       if (status == AE_NOT_FOUND)
-               goto err;
-       else if (ACPI_FAILURE(status)) {
+       if (status == AE_NOT_FOUND) {
+               hest_disable = HEST_NOT_FOUND;
+               return;
+       } else if (ACPI_FAILURE(status)) {
                const char *msg = acpi_format_exception(status);
                pr_err(HEST_PFX "Failed to get table, %s\n", msg);
                rc = -EINVAL;
@@ -257,5 +258,5 @@ void __init acpi_hest_init(void)
        pr_info(HEST_PFX "Table parsing has been initialized.\n");
        return;
 err:
-       hest_disable = 1;
+       hest_disable = HEST_DISABLED;
 }
index 76284bb560a6cd36e7a09253aa67e7363a74be6b..c46694abea28846509f222a613e3e20d8eb799c2 100644 (file)
 
 #ifdef __KERNEL__
 
-extern bool hest_disable;
+enum hest_status {
+       HEST_ENABLED,
+       HEST_DISABLED,
+       HEST_NOT_FOUND,
+};
+
+extern int hest_disable;
 extern int erst_disable;
 #ifdef CONFIG_ACPI_APEI_GHES
 extern bool ghes_disable;