EDAC, ghes: Do not register instance if platform is not whitelisted
Quoted 28 lines · Borislav Petkov
Lemme write an official patch:
---
Tony reported seeing"Internal error: Can't find EDAC structure"
when injecting correctable errors.
The problem is that we should exit registration when platform doesn't match the whitelisted ones.
Do that.
Reviewed-by Tony Luck <[email protected]>Signed-off-by Borislav Petkov <[email protected]>Cc Toshi Kani <[email protected]>Fixes 5deed6b6a479 ("EDAC, ghes: Add platform check")--- drivers/edac/ghes_edac.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/edac/ghes_edac.c +0
-0
drivers/edac/ghes_edac.c int ghes_edac_register(struct ghes *ghes, struct device *dev) · line 443
Quoted 6 lines
drivers/edac/ghes_edac.c +1
-1@@ -439,7 +439,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 ;
Umm..., I do not think this change is correct. This causes an error to ghes_probe(), which disables GHES itself. ghes and ghes_edac are separate modules. That is, ghes_edac works on top of ghes as an optional module.
I think the right fix is to simply remove the error message. This will make it consistent with the case of CONFIG_EDAC_GHES disabled. Please see include/acpi/ghes.h.
Thanks,
-Toshi