acpi, apei, HEST table parsing
Subsystems (3)
PATCH 2/4 acpi, apei, HEST table parsing
HEST describes error sources in detail; communicating operational parameters (i.e. severity levels, masking bits, and threshold values) to OS as necessary. It also allows the platform to report error sources for which OS would typically not implement support (for example, chipset-specific error registers).
HEST information may be needed by other subsystems. For example, HEST PCIE AER error source information describes whether a PCIE root port works in "firmware first" mode, this is needed by general PCIE AER error subsystem. So a public HEST tabling parsing interface is provided.
Signed-off-by Huang Ying <[email protected]>
--- drivers/acpi/apei/Makefile | 2 drivers/acpi/apei/apei-base.c | 20 +++++ drivers/acpi/apei/apei-internal.h | 3 drivers/acpi/apei/hest.c | 151 ++++++++++++++++++++++++++++++++++++++ include/acpi/apei.h | 13 +++ 5 files changed, 188 insertions(+), 1 deletion(-) create mode 100644 drivers/acpi/apei/hest.c create mode 100644 include/acpi/apei.h
drivers/acpi/apei/Makefile +1 -1
@@ -1,3 +1,3 @@ obj-$(CONFIG_ACPI_APEI) += apei.o -apei-y := apei-base.o +apei-y := apei-base.o hest.o
drivers/acpi/apei/apei-base.c +20 -0
@@ -55,6 +55,9 @@ EXPORT_SYMBOL_GPL(apei_debug_dir);* handler. */ +int hest_disable; +EXPORT_SYMBOL (hest_disable); +static LIST_HEAD (apei_iomaps);/* * Used for mutual exclusion between writers of apei_iomaps list, for
@@ -878,15 +881,30 @@ EXPORT_SYMBOL_GPL(apei_exec_collect_resostatic int __init apei_init (void ) { +int rc; + apei_debug_dir =debugfs_create_dir ("apei" ,NULL );if (!apei_debug_dir)return -ENOMEM ; +if (!hest_disable) { + rc =hest_init (); +if (rc) { + hest_disable =1 ; +if (rc != -ENODEV ) +pr_err ( +"ACPI: APEI: Failed to initialize Hardware " +"Error Source Table (HEST) subsystem\n" ); + } + }return 0 ; } static void __exit apei_exit(void) { +if (!hest_disable) +hest_exit (); +debugfs_remove_recursive (apei_debug_dir);WARN_ON (!list_empty (&apei_iomaps)); }
@@ -894,6 +912,8 @@ static void __exit apei_exit(void)module_init (apei_init);module_exit (apei_exit); +module_param (hest_disable, int,0444 ); +MODULE_AUTHOR ("Huang Ying" );MODULE_DESCRIPTION ("ACPI Platform Error Interface support" );MODULE_LICENSE ("GPL" );
drivers/acpi/apei/apei-internal.h +3 -0
@@ -6,6 +6,9 @@#ifndef APEI_INTERNAL_H #define APEI_INTERNAL_H +int hest_init (void ); +void hest_exit (void ); +int apei_ioremap_gar (struct acpi_generic_address *reg);int apei_iounmap_gar (struct acpi_generic_address *reg);
drivers/acpi/apei/hest.c new file +151 -0
151 lines not on this page · raw message
include/acpi/apei.h new file +13 -0
@@ -0,0 +1,13 @@ +/* +* apei.h - ACPI Platform Error Interface +*/ + +#ifndef ACPI_APEI_H +#define ACPI_APEI_H + +extern int hest_disable; + +typedef int (*apei_hest_func_t )(struct acpi_hest_header *hest_hdr,void *data); +int apei_hest_parse (apei_hest_func_t func,void *data); + +#endif