EDAC, ghes: Do not register instance if platform is not whitelisted
Quoted 29 lines · Borislav Petkov
Quoted 15 lines · Toshi
Quoted 14 lines · Borislav Petkov
Quoted 8 lines · Toshi
Umm..., I do not think this change is correct. This causes an error to
ghes_probe(), which disables GHES itself. ghes andghes_edacare separate modules. That is,ghes_edacworks 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_GHESdisabled. Please seeinclude/acpi/ghes.h.I guess. Although an even right-er fix would be to not call
ghes_edac_report_mem_error()at all, if there's noghes_edacmodule registered.Quoted 5 lines
Quoted 1 line
That would need more dissecting though....
That's cleaner, but will lead to a module ordering issue... For now, I'd simply fix
ghes_edac_report_mem_error()to handle the !pvt case as a normal case.Well, the !pvt case is not a normal case. The only justification for removing the
pr_err()because of the hack howghes_edacis grafted ontoghes.cActually, what I'm thinking is the below along with taking Sughosh's patch here:
Quoted 8 lines
https://marc.info/?l=linux-edac&m=152473783708615
Also,
ghes_edac_register()needs to return an error when it does not hit the whitelist - there's no other way to see it.Which means,
ghes.ccan registerghes_edacas the last thing it does and the outcome of that registration should not have any influence on GHES itself becauseghes_edacdoes only reporting.
I haven't had chance to test your change, but it looks good to me. Please also change ghes_edac_register() in include/acpi/ghes.h to return -ENODEV as well.
Thanks,
-Toshi