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

From: Dan Williams
Date: Sat Sep 14 2024 - 00:33:37 EST


Gregory Price wrote:
> 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).

I want to make sure this is not papering over some other issue. Can you
post the final topology when this works (cxl list -BPET)? My working
theory is that you have 2 devices that share an intermediate port.
Otherwise, I am having a hard time understanding why the
cxl_bus_rescan() in cxl_acpi_probe() does not obviate the explicit
EPROBE_DEFER.

So, devA is dependendent on devB to create a common port, but devA loses
that race after cxl_bus_rescan() has already run. Then EBPROBE_DEFER is
the right answer to trigger devA to try again.