Re: 回复: [PATCH] ACPI: APEI: move edac_init ahead of ghes platform drv register

Borislav Petkov
2022-08-09T17:15:53Z

On Tue, Aug 09, 2022 at 04:51:45PM +0000, Justin He wrote:
> Let me summarize it before sending v2 (maybe tomorrow):
> 1. implement a ghes_edac_driver_is_preferred() to replace the old ghes_edac_register()
> and move it to ghes.c together with plat_list

No, not replace.

In ghes.c:

- add ghes_edac_driver_is_preferred()
- remove ghes_edac_register() and _unregister() calls from there. Make them proper module
init/exit functions.
- Make ghes_edac.c a proper module - i.e., get rid of this thing:

config EDAC_GHES
bool "Output ACPI APEI/GHES BIOS detected errors via EDAC"
depends on ACPI_APEI_GHES && (EDAC=y)
^^^^^^^^

> 2. save the ghes and dev to a global structure and pass it to the new module_init

Not at all...

> 3.move the remain logic of old ghes_edac_register() to a new XX_init() which is under the
> module_init path.
> 4. introduce a stub ghes_edac_driver_is_preferred() for sb_edac, skx_edac and amd64_edac
> to check.
> 5. add the check condition in the XXX_init of sb_edac, skx_edac and amd64_edac
>
> Please let me know if I missed anything above.

Yes, I think you do. Lemme write something and you can finish it/test
it.

Thx.

--
Regards/Gruss,
Boris.