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 --- drivers/edac/ghes_edac.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'drivers/edac/ghes_edac.c') diff --git a/drivers/edac/ghes_edac.c b/drivers/edac/ghes_edac.c index 68b6ee18bea6..7fdbfe871f5c 100644 --- a/drivers/edac/ghes_edac.c +++ b/drivers/edac/ghes_edac.c @@ -183,10 +183,8 @@ void ghes_edac_report_mem_error(struct ghes *ghes, int sev, char *p; u8 grain_bits; - if (!pvt) { - pr_err("Internal error: Can't find EDAC structure\n"); + if (!pvt) return; - } /* * We can do the locking below because GHES defers error processing @@ -439,7 +437,7 @@ int ghes_edac_register(struct ghes *ghes, struct device *dev) /* Check if safe to enable on this system */ idx = acpi_match_platform_list(plat_list); if (!force_load && idx < 0) - return 0; + return -ENODEV; /* * We have only one logical memory controller to which all DIMMs belong. -- cgit v1.2.3