Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ACPI: APEI: move edac_init ahead of ghes platform drv register
Commit dc4e8c0 ("ACPI: APEI: explicit init of HEST and GHES in apci_init()") introduced a bug that invoking ghes_edac_register() before edac_init(). Because at that time, the bus "edac" hasn't been registered, this created sysfs /devices/mc0 instead of /sys/devices/system/edac/mc/mc0 and caused a sysfs dup splat on an Ampere eMag server: sysfs: cannot create duplicate filename '/devices/mc0' CPU: 19 PID: 1 Comm: swapper/0 Not tainted 5.19.0+ torvalds#138 random: crng init done Hardware name: MiTAC RAPTOR EV-883832-X3-0001/RAPTOR, BIOS 0.14 02/22/2019 Call trace: sysfs_warn_dup+0x6c/0x88 sysfs_create_dir_ns+0xec/0x108 kobject_add_internal+0xc0/0x328 kobject_add+0x94/0x108 device_add+0x104/0x8b0 pmu_dev_alloc+0xb4/0x128 perf_pmu_register+0x308/0x438 xgene_pmu_dev_add+0x168/0x2c8 acpi_pmu_dev_add+0x1f0/0x370 acpi_ns_walk_namespace+0x16c/0x1ec acpi_walk_namespace+0xb0/0xf8 xgene_pmu_probe+0x6b8/0x8a0 platform_probe+0x70/0xe0 really_probe+0x164/0x3b0 __driver_probe_device+0x11c/0x190 driver_probe_device+0x44/0xf8 __driver_attach+0xc4/0x1b8 bus_for_each_dev+0x78/0xd0 driver_attach+0x2c/0x38 bus_add_driver+0x150/0x240 driver_register+0x6c/0x128 __platform_driver_register+0x30/0x40 xgene_pmu_driver_init+0x24/0x30 do_one_initcall+0x50/0x248 kernel_init_freeable+0x284/0x328 kernel_init+0x2c/0x140 ret_from_fork+0x10/0x20 kobject_add_internal failed for mc0 with -EEXIST, don't try to register things with the same name in the same This patch fixes it by moving edac_init() into acpi_ghes_init() and ahead of platform_driver_register(). Fixes: dc4e8c0 ("ACPI: APEI: explicit init of HEST and GHES in apci_init()") Signed-off-by: Jia He <justin.he@arm.com> Cc: Shuai Xue <xueshuai@linux.alibaba.com>
- Loading branch information