From e77737e896343fce9df6d8edd9e3c95db3e26828 Mon Sep 17 00:00:00 2001 From: Zhang Zekun Date: Sat, 4 Mar 2023 07:24:37 +0000 Subject: [PATCH] driver: Add CONFIG_ACPI_APEI_GHES_TS_CORE for code isolation hulk inclusion category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I6HRGK ------------------------------------------------- Add CONFIG_ACPI_APEI_GHES_TS_CORE to isolate code introduced in 01dbadfe7fcbfcca5ce5a974daaef4e9ff5eedfe. Signed-off-by: Zhang Zekun --- arch/arm64/configs/openeuler_defconfig | 1 + drivers/acpi/apei/Kconfig | 7 +++++++ drivers/acpi/apei/ghes.c | 4 ++++ include/acpi/ghes.h | 2 ++ include/linux/cper.h | 3 +++ 5 files changed, 17 insertions(+) diff --git a/arch/arm64/configs/openeuler_defconfig b/arch/arm64/configs/openeuler_defconfig index 1dc6638a8305..9faa3934c7c2 100644 --- a/arch/arm64/configs/openeuler_defconfig +++ b/arch/arm64/configs/openeuler_defconfig @@ -721,6 +721,7 @@ CONFIG_ACPI_HMAT=y CONFIG_HAVE_ACPI_APEI=y CONFIG_ACPI_APEI=y CONFIG_ACPI_APEI_GHES=y +CONFIG_ACPI_APEI_GHES_TS_CORE=y CONFIG_ACPI_APEI_PCIEAER=y CONFIG_ACPI_APEI_SEA=y CONFIG_ACPI_APEI_MEMORY_FAILURE=y diff --git a/drivers/acpi/apei/Kconfig b/drivers/acpi/apei/Kconfig index 6b18f8bc7be3..f33c23062471 100644 --- a/drivers/acpi/apei/Kconfig +++ b/drivers/acpi/apei/Kconfig @@ -33,6 +33,13 @@ config ACPI_APEI_GHES by firmware to produce more valuable hardware error information for Linux. +config ACPI_APEI_GHES_TS_CORE + bool "Support ts core ras process for ascend" + depends on ARM64 && ACPI_APEI_GHES + default n + help + Enable the support for ts core ras process for ascend. + config ACPI_APEI_PCIEAER bool "APEI PCIe AER logging/recovering support" depends on ACPI_APEI && PCIEAER diff --git a/drivers/acpi/apei/ghes.c b/drivers/acpi/apei/ghes.c index 9c38c2cdd2fd..316648e09571 100644 --- a/drivers/acpi/apei/ghes.c +++ b/drivers/acpi/apei/ghes.c @@ -118,8 +118,10 @@ module_param_named(disable, ghes_disable, bool, 0); static LIST_HEAD(ghes_hed); static DEFINE_MUTEX(ghes_list_mutex); +#ifdef CONFIG_ACPI_APEI_GHES_TS_CORE BLOCKING_NOTIFIER_HEAD(ghes_ts_err_chain); EXPORT_SYMBOL(ghes_ts_err_chain); +#endif /* * Because the memory area used to transfer hardware error information @@ -657,10 +659,12 @@ static bool ghes_do_proc(struct ghes *ghes, } else if (guid_equal(sec_type, &CPER_SEC_PROC_ARM)) { queued = ghes_handle_arm_hw_error(gdata, sev); +#ifdef CONFIG_ACPI_APEI_GHES_TS_CORE } else if (guid_equal(sec_type, &CPER_SEC_TS_CORE)) { blocking_notifier_call_chain(&ghes_ts_err_chain, 0, acpi_hest_get_payload(gdata)); +#endif } else { void *err = acpi_hest_get_payload(gdata); diff --git a/include/acpi/ghes.h b/include/acpi/ghes.h index 89330e4872c0..ca054bf08ee9 100644 --- a/include/acpi/ghes.h +++ b/include/acpi/ghes.h @@ -145,6 +145,8 @@ int ghes_notify_sea(void); static inline int ghes_notify_sea(void) { return -ENOENT; } #endif +#ifdef CONFIG_ACPI_APEI_GHES_TS_CORE extern struct blocking_notifier_head ghes_ts_err_chain; +#endif #endif /* GHES_H */ diff --git a/include/linux/cper.h b/include/linux/cper.h index 78cf8a0b05a5..4dbf03678cc6 100644 --- a/include/linux/cper.h +++ b/include/linux/cper.h @@ -197,10 +197,13 @@ enum { #define CPER_SEC_DMAR_IOMMU \ GUID_INIT(0x036F84E1, 0x7F37, 0x428c, 0xA7, 0x9E, 0x57, 0x5F, \ 0xDF, 0xAA, 0x84, 0xEC) + +#ifdef CONFIG_ACPI_APEI_GHES_TS_CORE /* HISI ts core */ #define CPER_SEC_TS_CORE \ GUID_INIT(0xeb4c71f8, 0xbc76, 0x4c46, 0xbd, 0x9, 0xd0, 0xd3, \ 0x45, 0x0, 0x5a, 0x92) +#endif #define CPER_PROC_VALID_TYPE 0x0001 #define CPER_PROC_VALID_ISA 0x0002 -- GitLab