Re: [PATCH] cxl/acpi: Defer probe when ACPI0016 PCI root bridge is not ready
From: Chen Pei
Date: Mon May 18 2026 - 21:50:35 EST
On Fri, 15 May 2026 08:38:01 -0700, Dave Jiang wrote:
> I would leave the assignment of 'hb' as is above and just what's below
> after looking at to_cxl_host_bridge() function.
>
> if (!hb) {
> if (!acpi_pci_find_root(adev->handle)) {
> ...
> return -EPROBE_DEFER;
> }
> return 0;
> }
Hi Dave,
Thanks for the review and the code structure suggestion. I agree that
nesting the check under `if (!hb)` is cleaner.
> I am concerned of other failure cases that causes acpi_pci_find_root()
> to fail beyond the driver not being attached. Will cxl_acpi probe() be
> stuck permanently in the defer probe queue when that happens? This is
> also something that Sashiko raised. Is there no way to adjust the
> RISCV ACPI setup to go around subsys_initcall()? That would be
> preferred solution.
You raise a valid concern. The EPROBE_DEFER approach indeed risks
infinite deferral if acpi_pci_find_root() fails for reasons other
than the driver not being attached yet. This is a fundamental
limitation of this approach.
After considering the feedback from you, Sashiko, and Dan Williams,
I plan to abandon the EPROBE_DEFER approach and instead use the
ACPI _DEP mechanism as Dan suggested. This is the proper ACPI
standard way to declare device dependencies:
1. Firmware side (DSDT): Add a _DEP package to the ACPI0017 device
pointing to all ACPI0016 host bridges it depends on.
2. Kernel side: Add acpi_dev_clear_dependencies() in acpi_pci_root_add()
so that ACPI0017 will naturally wait for all ACPI0016 devices to
be ready before probing.
This eliminates the permanent defer risk since the dependency is
explicitly declared by firmware and resolved by the ACPI core,
rather than relying on runtime probing heuristics.
I'll send a new patch series for this approach.
Thanks,
Pei