Skip to contentSkip to conversation

EDAC, ghes: Do not register instance if platform is not whitelisted

DISCUSSION Toshi Kani 1 participant 1 message Apr 27, 2018 EDAC-core

lore
Share & tools
lore

Toshi Kani

author
#0 lore raw
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 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.

I guess. Although an even right-er fix would be to not call ghes_edac_report_mem_error() at all, if there's no ghes_edac module 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 how ghes_edac is grafted onto ghes.c

Actually, 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.c can register ghes_edac as the last thing it does and the outcome of that registration should not have any influence on GHES itself because ghes_edac does 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