Skip to contentSkip to conversation

acpi, apei, HEST table parsing

PATCH In review Huang Ying 2 participants 3 messages Dec 10, 2009 – Dec 24, 2009

Subsystems (3)
lore
Share & tools
lore

Huang Ying

author
#0 lore raw

PATCH 3/5 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.

---
 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
@@ -48,6 +48,9 @@
 struct dentry *apei_debug_dir;
 EXPORT_SYMBOL_GPL(apei_debug_dir);
 
+int hest_disable;
+EXPORT_SYMBOL(hest_disable);
+
 /*
  * APEI ERST (Error Record Serialization Table) and EINJ (Error
  * INJection) interpreter framework.
@@ -546,21 +549,38 @@ EXPORT_SYMBOL_GPL(apei_exec_collect_reso
 
 static 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);
 }
 
 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);
+
 struct apei_exec_context;
 
 typedef int (*apei_exec_ins_func_t)(struct apei_exec_context *ctx,
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
#1 lore raw
Quoted 11 lines · Huang Ying

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.

Perhaps you can remove unused hest_exit()?

Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
author
#2 lore raw
Quoted 7 lines · Pavel Machek
Quoted 6 lines · Huang Ying

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).

Quoted 7 lines
Quoted 5 lines

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.

Perhaps you can remove unused hest_exit()?

OK. I will remove it.

Best Regards,
Huang Ying