Skip to contentSkip to conversation

cxl/pmem: Defer nvdimm bridge attachment failures

PATCH In review Li Chen 2 participants 2 messages Mar 25 – Apr 11 CXL

lore
Share & tools
lore

Li Chen

author
#0 lore raw

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
index 68462e38a977..a213eb074814 100644
@@ -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
maintainer
#1 lore raw
Quoted 1 line · Li Chen

cxl_acpi is initialized before cxl_pmem registers

Should be fixed since:

be5c5280cf2b cxl: Adjust the startup priority of cxl_pmem to be higher than that of cxl_acpi