[PATCH 07/12] ghes: prepare estatus hooks for shared handling
Ahmed Tiba
ahmed.tiba at arm.com
Wed Dec 17 03:28:40 PST 2025
Introduce struct estatus_source inside struct ghes and export thin
wrappers around the existing GHES estatus helpers. These helpers are
not ACPI-specific, so moving them behind a common interface is the
first step toward reusing the logic for other firmware providers.
Behaviour stays the same for GHES in this patch.
Signed-off-by: Ahmed Tiba <ahmed.tiba at arm.com>
---
drivers/acpi/apei/Kconfig | 1 +
drivers/firmware/efi/estatus.c | 3 +--
include/acpi/ghes.h | 17 +++++++++++++----
3 files changed, 15 insertions(+), 6 deletions(-)
diff --git a/drivers/acpi/apei/Kconfig b/drivers/acpi/apei/Kconfig
index 070c07d68dfb..90cb8360988b 100644
--- a/drivers/acpi/apei/Kconfig
+++ b/drivers/acpi/apei/Kconfig
@@ -24,6 +24,7 @@ config ACPI_APEI_GHES
select IRQ_WORK
select GENERIC_ALLOCATOR
select ARM_SDE_INTERFACE if ARM64
+ select RAS_ESTATUS_CORE
help
Generic Hardware Error Source provides a way to report
platform hardware errors (such as that from chipset). It
diff --git a/drivers/firmware/efi/estatus.c b/drivers/firmware/efi/estatus.c
index 8043d68f907b..259122730303 100644
--- a/drivers/firmware/efi/estatus.c
+++ b/drivers/firmware/efi/estatus.c
@@ -654,9 +654,8 @@ static bool estatus_handle_arm_hw_error(estatus_generic_data *gdata, int sev, bo
int sec_sev, i;
char *p;
- log_arm_hw_error(err);
-
sec_sev = estatus_severity(gdata->error_severity);
+ log_arm_hw_error(err, sec_sev);
if (sev != ESTATUS_SEV_RECOVERABLE || sec_sev != ESTATUS_SEV_RECOVERABLE)
return false;
diff --git a/include/acpi/ghes.h b/include/acpi/ghes.h
index 022c0325f1e0..7dc6acde3e2e 100644
--- a/include/acpi/ghes.h
+++ b/include/acpi/ghes.h
@@ -5,6 +5,7 @@
#include <acpi/apei.h>
#include <acpi/hed.h>
#include <linux/estatus.h>
+#include <linux/notifier.h>
/*
* One struct ghes is created for each generic hardware error source.
@@ -22,6 +23,7 @@ struct ghes {
struct acpi_hest_generic_v2 *generic_v2;
};
struct acpi_hest_generic_status *estatus;
+ struct estatus_source estatus_src;
unsigned long flags;
union {
struct list_head list;
@@ -30,6 +32,7 @@ struct ghes {
};
struct device *dev;
struct list_head elist;
+ char name[32];
};
struct ghes_estatus_node {
@@ -47,10 +50,10 @@ struct ghes_estatus_cache {
};
enum {
- GHES_SEV_NO = 0x0,
- GHES_SEV_CORRECTED = 0x1,
- GHES_SEV_RECOVERABLE = 0x2,
- GHES_SEV_PANIC = 0x3,
+ GHES_SEV_NO = ESTATUS_SEV_NO,
+ GHES_SEV_CORRECTED = ESTATUS_SEV_CORRECTED,
+ GHES_SEV_RECOVERABLE = ESTATUS_SEV_RECOVERABLE,
+ GHES_SEV_PANIC = ESTATUS_SEV_PANIC,
};
#ifdef CONFIG_ACPI_APEI_GHES
@@ -73,6 +76,12 @@ void ghes_unregister_vendor_record_notifier(struct notifier_block *nb);
struct list_head *ghes_get_devices(void);
void ghes_estatus_pool_region_free(unsigned long addr, u32 size);
+int ghes_register_vendor_record_notifier(struct notifier_block *nb);
+void ghes_unregister_vendor_record_notifier(struct notifier_block *nb);
+void ghes_register_report_chain(struct notifier_block *nb);
+void ghes_unregister_report_chain(struct notifier_block *nb);
+
+void estatus_pool_region_free(unsigned long addr, u32 size);
#else
static inline struct list_head *ghes_get_devices(void) { return NULL; }
--
2.43.0
More information about the linux-arm-kernel
mailing list