From cc7f3f132658289b6661ab8294ab08a9d32ea026 Mon Sep 17 00:00:00 2001 From: Borislav Petkov Date: Mon, 23 Apr 2018 14:16:46 +0200 Subject: ghes, EDAC: Fix ghes_edac registration Tony reported seeing "Internal error: Can't find EDAC structure" when injecting correctable errors due to the fact that ghes_edac would still load even if the whitelist won't hit. Drop the pr_err() in ghes_edac_report_mem_error() for now due to the hacky way how ghes_edac depends on ghes.c. While at it, make ghes_edac_register() return an error if it doesn't hit in the whitelist as it is the only sensible thing to do in that situation. Furthermore, move the call to it to happen last in ghes_probe() so that GHES initializing properly does not depend on ghes_edac init at all as latter is only reporting errors and not required for GHES's proper functioning. Reviewed-by: Toshi Kani Tested-by: Sughosh Ganu Signed-off-by: Borislav Petkov Cc: "Rafael J. Wysocki" Cc: Tony Luck Link: https://lkml.kernel.org/r/20180420182015.zao3olss4tvvlxki@agluck-desk --- include/acpi/ghes.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/acpi') diff --git a/include/acpi/ghes.h b/include/acpi/ghes.h index 8feb0c866ee0..4fc92289f7f8 100644 --- a/include/acpi/ghes.h +++ b/include/acpi/ghes.h @@ -70,7 +70,7 @@ static inline void ghes_edac_report_mem_error(struct ghes *ghes, int sev, static inline int ghes_edac_register(struct ghes *ghes, struct device *dev) { - return 0; + return -ENODEV; } static inline void ghes_edac_unregister(struct ghes *ghes) -- cgit v1.2.3 From 305d0e006a1736fbfec25e7a2d1e813694f82ed0 Mon Sep 17 00:00:00 2001 From: Alexandru Gagniuc Date: Mon, 30 Apr 2018 16:33:50 -0500 Subject: EDAC, ghes: Remove unused argument to ghes_edac_report_mem_error() The use of the @ghes argument was removed in a previous commit, but function signature was not updated to reflect this. Signed-off-by: Alexandru Gagniuc Acked-by: "Rafael J. Wysocki" Cc: linux-acpi@vger.kernel.org Cc: linux-edac Link: http://lkml.kernel.org/r/20180430213358.8319-1-mr.nuke.me@gmail.com Signed-off-by: Borislav Petkov --- include/acpi/ghes.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'include/acpi') diff --git a/include/acpi/ghes.h b/include/acpi/ghes.h index 4fc92289f7f8..1624e2be485c 100644 --- a/include/acpi/ghes.h +++ b/include/acpi/ghes.h @@ -55,15 +55,14 @@ enum { /* From drivers/edac/ghes_edac.c */ #ifdef CONFIG_EDAC_GHES -void ghes_edac_report_mem_error(struct ghes *ghes, int sev, - struct cper_sec_mem_err *mem_err); +void ghes_edac_report_mem_error(int sev, struct cper_sec_mem_err *mem_err); int ghes_edac_register(struct ghes *ghes, struct device *dev); void ghes_edac_unregister(struct ghes *ghes); #else -static inline void ghes_edac_report_mem_error(struct ghes *ghes, int sev, +static inline void ghes_edac_report_mem_error(int sev, struct cper_sec_mem_err *mem_err) { } -- cgit v1.2.3