cxl/pmem: Defer nvdimm bridge attachment failures
PATCH 1/1 cxl/pmem: Defer nvdimm bridge attachment failures
cxl_acpi is initialized before cxl_pmem registers cxl_nvdimm_bridge_driver when both are built in. __devm_cxl_add_nvdimm_bridge() creates the nvdimm bridge device and immediately checks whether a driver bound to it. At that point the device may already exist while the bridge driver is not registered, or has not bound yet, so
dev->driver == NULL
is only a temporary state rather than a permanent -ENODEV failure.
Treating that state as fatal makes cxl_acpi probe fail, so the root CXL topology never becomes visible to userspace and region creation later reports no active memdevs.
Return -EPROBE_DEFER instead so cxl_acpi retries after cxl_nvdimm_bridge_driver is registered.
--- drivers/cxl/core/pmem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/cxl/core/pmem.c +1 -1
@@ -149,7 +149,7 @@ struct cxl_nvdimm_bridge *__devm_cxl_add_nvdimm_bridge(struct device *host,if (cxl_nvdimm_bridge_failed_attach (cxl_nvb)) {unregister_nvb (cxl_nvb); -return ERR_PTR (-ENODEV ); +return ERR_PTR (-EPROBE_DEFER ); } rc =devm_add_action_or_reset (host, unregister_nvb, cxl_nvb);
Signature · 1 line
2.52.0
Dan Williams
maintainerQuoted 1 line · Li Chen
cxl_acpiis initialized beforecxl_pmemregisters
Should be fixed since:
be5c5280cf2b cxl: Adjust the startup priority of cxl_pmem to be higher than that of cxl_acpi