Commit b6a9501658530d8b8374e37f1edb549039a8a260

Authored by Huang Ying
Committed by Len Brown
1 parent 86cd47334b

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 <ying.huang@intel.com>
Reviewed-by: Andi Kleen <ak@linux.intel.com>
Reviewed-by: Matthew Garrett <mjg@redhat.com>
Signed-off-by: Len Brown <len.brown@intel.com>

Showing 3 changed files with 18 additions and 8 deletions Side-by-side Diff

drivers/acpi/apei/ghes.c
... ... @@ -77,6 +77,9 @@
77 77 };
78 78 };
79 79  
  80 +int ghes_disable;
  81 +module_param_named(disable, ghes_disable, bool, 0);
  82 +
80 83 static int ghes_panic_timeout __read_mostly = 30;
81 84  
82 85 /*
... ... @@ -662,6 +665,11 @@
662 665  
663 666 if (hest_disable) {
664 667 pr_info(GHES_PFX "HEST is not enabled!\n");
  668 + return -EINVAL;
  669 + }
  670 +
  671 + if (ghes_disable) {
  672 + pr_info(GHES_PFX "GHES is not enabled!\n");
665 673 return -EINVAL;
666 674 }
667 675  
drivers/acpi/apei/hest.c
... ... @@ -231,16 +231,17 @@
231 231 goto err;
232 232 }
233 233  
234   - rc = apei_hest_parse(hest_parse_ghes_count, &ghes_count);
235   - if (rc)
236   - goto err;
237   -
238   - rc = hest_ghes_dev_register(ghes_count);
239   - if (!rc) {
240   - pr_info(HEST_PFX "Table parsing has been initialized.\n");
241   - return;
  234 + if (!ghes_disable) {
  235 + rc = apei_hest_parse(hest_parse_ghes_count, &ghes_count);
  236 + if (rc)
  237 + goto err;
  238 + rc = hest_ghes_dev_register(ghes_count);
  239 + if (rc)
  240 + goto err;
242 241 }
243 242  
  243 + pr_info(HEST_PFX "Table parsing has been initialized.\n");
  244 + return;
244 245 err:
245 246 hest_disable = 1;
246 247 }
... ... @@ -18,6 +18,7 @@
18 18  
19 19 extern int hest_disable;
20 20 extern int erst_disable;
  21 +extern int ghes_disable;
21 22  
22 23 #ifdef CONFIG_ACPI_APEI
23 24 void __init acpi_hest_init(void);