[PATCH] cxl/core/port: defer probe when memdev fails to find correct port

From: Gregory Price
Date: Fri Sep 13 2024 - 14:33:29 EST


Depending on device/hierarchy readiness, it can be possible for the
async probe process to attempt to register an endpoint before the
entire port hierarchy is ready. This currently fails with -ENXIO.

Return -EPROBE_DEFER to try again later automatically (which is
what the local comments already say we should do anyway).

Signed-off-by: Gregory Price <gourry@xxxxxxxxxx>
---
drivers/cxl/core/port.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/cxl/core/port.c b/drivers/cxl/core/port.c
index 1d5007e3795a..d6bebf70d142 100644
--- a/drivers/cxl/core/port.c
+++ b/drivers/cxl/core/port.c
@@ -1553,7 +1553,7 @@ static int add_port_attach_ep(struct cxl_memdev *cxlmd,
*/
dev_dbg(&cxlmd->dev, "%s is a root dport\n",
dev_name(dport_dev));
- return -ENXIO;
+ return -EPROBE_DEFER;
}

parent_port = find_cxl_port(dparent, &parent_dport);
--
2.43.0