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. Changelog: v2: - add acked-by tag of Patch 1 from Ard - split the notifier patch - add 2 patch to get regular drivers selected when ghes edac is not loaded - fix an errno in igen6 driver - add a patch to fix the sparse warning of ghes - refine the commit logs Jia He (7): efi/cper: export several helpers for ghes edac to use EDAC/ghes: Add notifier to report ghes_edac mem error EDAC/ghes: Modularize ghes_edac driver to remove the dependency on ghes EDAC: Get chipset-specific edac drivers selected only when ghes_edac is not enabled EDAC/ghes: Prevent chipset-specific edac from loading after ghes_edac is registered apei/ghes: Use unrcu_pointer for cmpxchg EDAC/igen6: Keep returned errno consistent when edac mc has been enabled drivers/acpi/apei/ghes.c | 72 ++++++++++++++++++++++++++++++++--- drivers/edac/Kconfig | 4 +- drivers/edac/amd64_edac.c | 3 ++ drivers/edac/ghes_edac.c | 76 ++++++++++++++++++++++++++----------- drivers/edac/igen6_edac.c | 2 +- drivers/edac/pnd2_edac.c | 3 ++ drivers/edac/sb_edac.c | 3 ++ drivers/edac/skx_base.c | 3 ++ drivers/firmware/efi/cper.c | 3 ++ include/acpi/ghes.h | 37 ++++++------------ 10 files changed, 150 insertions(+), 56 deletions(-) -- 2.25.1