Commit dc4e8c07e9e2 ("ACPI: APEI: explicit init of HEST and GHES in apci_init()") introduced a bug that ghes_edac_register() would be invoked before edac_init(). Because at that time, the bus "edac" hasn't been even registered, this created sysfs /devices/mc0 instead of /sys/devices/system/edac/mc/mc0 on an Ampere eMag server. The solution is modularizing the ghes_edac driver. I tested the cases as follows: 1. build test with ghes_edac built-in and module on Aarch64 2. build test with ghes_edac built-in and module on x86_64 3. boot test with ghes_edac built-in and module on Aarch64 4. modprobe and -r for multiple times on Aarch64. Jia He (2): efi/cper: export several helpers for ghes edac to use EDAC/ghes: Modularize ghes_edac driver to remove the dependency on ghes drivers/acpi/apei/ghes.c | 49 ++++++++++++++++++++++-- drivers/edac/Kconfig | 4 +- drivers/edac/ghes_edac.c | 74 ++++++++++++++++++++++++++----------- drivers/firmware/efi/cper.c | 3 ++ include/acpi/ghes.h | 33 ++++------------- 5 files changed, 110 insertions(+), 53 deletions(-) -- 2.25.1