From: Manish Honap <[email protected]> The CXL provider .init() can return -EPROBE_DEFER when the device is not ready yet, for example when its CXL port has not enumerated. Handle that return separately from other init failures and propagate it, so the bind is retried later.
This keeps the deferred path distinct from the general failure path that a following patch makes non-fatal: an -EPROBE_DEFER must retry, not fall back to plain vfio-pci. Assisted-by: LLM Signed-off-by: Manish Honap <[email protected]> --- drivers/vfio/pci/vfio_pci_core.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/vfio/pci/vfio_pci_core.c b/drivers/vfio/pci/vfio_pci_core.c index 9eede1e56ab5..a63a4f5228b8 100644 --- a/drivers/vfio/pci/vfio_pci_core.c +++ b/drivers/vfio/pci/vfio_pci_core.c @@ -2262,6 +2262,15 @@ static int vfio_pci_core_cxl_init(struct vfio_pci_core_device *vdev) return IS_BUILTIN(CONFIG_VFIO_CXL) ? -EPROBE_DEFER : 0; ret = ops->init(vdev); + /* + * A provider that is not ready yet (for example its CXL port has not + * enumerated) returns -EPROBE_DEFER. Propagate it so the bind retries + * rather than falling back to plain vfio-pci. + */ + if (ret == -EPROBE_DEFER) { + vfio_pci_put_cxl_ops(ops); + return ret; + } if (ret) { vfio_pci_put_cxl_ops(ops); return ret; -- 2.25.1

