[PATCH 0/2] ACPI/PCI/CXL: Enforce _DEP ordering between ACPI0016 and ACPI0017

Chen Pei posted 2 patches 1 week, 6 days ago
drivers/acpi/pci_root.c | 4 ++++
drivers/acpi/scan.c     | 1 +
2 files changed, 5 insertions(+)
[PATCH 0/2] ACPI/PCI/CXL: Enforce _DEP ordering between ACPI0016 and ACPI0017
Posted by Chen Pei 1 week, 6 days ago
On platforms whose ACPI namespace exposes a CXL host bridge (ACPI0016)
with an ACPI0017 CXL root device declaring _DEP on the host bridge,
cxl_acpi can probe before acpi_pci_root has attached the PCI root.
acpi_pci_find_root() then returns NULL, decoder targets read as 0,
and no port/endpoint device shows up under /sys/bus/cxl/devices/.

The root cause is twofold:

  1. acpi_pci_root_add() never calls acpi_dev_clear_dependencies(),
     so _DEP suppliers downstream of a PCI root are never released.

  2. ACPI0016 is not on acpi_honor_dep_ids[], so even when ACPI0017
     declares _DEP on it, acpi_dev_ready_for_enumeration() bypasses
     the dep_unmet check and lets cxl_acpi probe early.

On x86 the bug is usually masked by link order (acpi_pci_root is
built in and probed before cxl_acpi). On architectures like RISC-V
that ordering is not guaranteed, so the standard ACPI _DEP mechanism
must actually work.

This series fixes both sides and the two patches must be applied
together; applying only patch 2 would prevent cxl_acpi from ever
probing on ACPI0016 systems, because the supplier would never clear
the dependency.

  Patch 1 makes acpi_pci_root_add() clear _DEP on the supplier once
          the PCI root bus has been added.
  Patch 2 adds ACPI0016 to acpi_honor_dep_ids[] so the dependency
          declared by ACPI0017 is enforced.

The approach in this series follows the discussion of an earlier
posting:
https://lore.kernel.org/linux-cxl/20260514023238.49984-1-cp0613@linux.alibaba.com/

Chen Pei (2):
  ACPI: PCI: clear _DEP dependencies after PCI root bridge attach
  ACPI: scan: honor _DEP for ACPI0016 PCI/CXL host bridge

 drivers/acpi/pci_root.c | 4 ++++
 drivers/acpi/scan.c     | 1 +
 2 files changed, 5 insertions(+)

-- 
2.50.1
Re: [PATCH 0/2] ACPI/PCI/CXL: Enforce _DEP ordering between ACPI0016 and ACPI0017
Posted by Alison Schofield 1 week, 5 days ago
On Tue, May 26, 2026 at 10:51:16AM +0800, Chen Pei wrote:
> On platforms whose ACPI namespace exposes a CXL host bridge (ACPI0016)
> with an ACPI0017 CXL root device declaring _DEP on the host bridge,
> cxl_acpi can probe before acpi_pci_root has attached the PCI root.
> acpi_pci_find_root() then returns NULL, decoder targets read as 0,
> and no port/endpoint device shows up under /sys/bus/cxl/devices/.
> 
> The root cause is twofold:
> 
>   1. acpi_pci_root_add() never calls acpi_dev_clear_dependencies(),
>      so _DEP suppliers downstream of a PCI root are never released.
> 
>   2. ACPI0016 is not on acpi_honor_dep_ids[], so even when ACPI0017
>      declares _DEP on it, acpi_dev_ready_for_enumeration() bypasses
>      the dep_unmet check and lets cxl_acpi probe early.
> 
> On x86 the bug is usually masked by link order (acpi_pci_root is
> built in and probed before cxl_acpi). On architectures like RISC-V
> that ordering is not guaranteed, so the standard ACPI _DEP mechanism
> must actually work.
> 
> This series fixes both sides and the two patches must be applied
> together; applying only patch 2 would prevent cxl_acpi from ever
> probing on ACPI0016 systems, because the supplier would never clear
> the dependency.
> 
>   Patch 1 makes acpi_pci_root_add() clear _DEP on the supplier once
>           the PCI root bus has been added.
>   Patch 2 adds ACPI0016 to acpi_honor_dep_ids[] so the dependency
>           declared by ACPI0017 is enforced.
> 
> The approach in this series follows the discussion of an earlier
> posting:
> https://lore.kernel.org/linux-cxl/20260514023238.49984-1-cp0613@linux.alibaba.com/
> 
> Chen Pei (2):
>   ACPI: PCI: clear _DEP dependencies after PCI root bridge attach
>   ACPI: scan: honor _DEP for ACPI0016 PCI/CXL host bridge

For the set:
	Tested-by: Alison Schofield <alison.schofield@intel.com>
	Reviewed-by: Alison Schofield <alison.schofield@intel.com>
Re: [PATCH 0/2] ACPI/PCI/CXL: Enforce _DEP ordering between ACPI0016 and ACPI0017
Posted by Rafael J. Wysocki 1 week ago
On Wed, May 27, 2026 at 3:15 AM Alison Schofield
<alison.schofield@intel.com> wrote:
>
> On Tue, May 26, 2026 at 10:51:16AM +0800, Chen Pei wrote:
> > On platforms whose ACPI namespace exposes a CXL host bridge (ACPI0016)
> > with an ACPI0017 CXL root device declaring _DEP on the host bridge,
> > cxl_acpi can probe before acpi_pci_root has attached the PCI root.
> > acpi_pci_find_root() then returns NULL, decoder targets read as 0,
> > and no port/endpoint device shows up under /sys/bus/cxl/devices/.
> >
> > The root cause is twofold:
> >
> >   1. acpi_pci_root_add() never calls acpi_dev_clear_dependencies(),
> >      so _DEP suppliers downstream of a PCI root are never released.
> >
> >   2. ACPI0016 is not on acpi_honor_dep_ids[], so even when ACPI0017
> >      declares _DEP on it, acpi_dev_ready_for_enumeration() bypasses
> >      the dep_unmet check and lets cxl_acpi probe early.
> >
> > On x86 the bug is usually masked by link order (acpi_pci_root is
> > built in and probed before cxl_acpi). On architectures like RISC-V
> > that ordering is not guaranteed, so the standard ACPI _DEP mechanism
> > must actually work.
> >
> > This series fixes both sides and the two patches must be applied
> > together; applying only patch 2 would prevent cxl_acpi from ever
> > probing on ACPI0016 systems, because the supplier would never clear
> > the dependency.
> >
> >   Patch 1 makes acpi_pci_root_add() clear _DEP on the supplier once
> >           the PCI root bus has been added.
> >   Patch 2 adds ACPI0016 to acpi_honor_dep_ids[] so the dependency
> >           declared by ACPI0017 is enforced.
> >
> > The approach in this series follows the discussion of an earlier
> > posting:
> > https://lore.kernel.org/linux-cxl/20260514023238.49984-1-cp0613@linux.alibaba.com/
> >
> > Chen Pei (2):
> >   ACPI: PCI: clear _DEP dependencies after PCI root bridge attach
> >   ACPI: scan: honor _DEP for ACPI0016 PCI/CXL host bridge
>
> For the set:
>         Tested-by: Alison Schofield <alison.schofield@intel.com>
>         Reviewed-by: Alison Schofield <alison.schofield@intel.com>

And so applied as 7.2 material, thanks!
Re: [PATCH 0/2] ACPI/PCI/CXL: Enforce _DEP ordering between ACPI0016 and ACPI0017
Posted by Dave Jiang 1 week, 6 days ago

On 5/25/26 7:51 PM, Chen Pei wrote:
> On platforms whose ACPI namespace exposes a CXL host bridge (ACPI0016)
> with an ACPI0017 CXL root device declaring _DEP on the host bridge,
> cxl_acpi can probe before acpi_pci_root has attached the PCI root.
> acpi_pci_find_root() then returns NULL, decoder targets read as 0,
> and no port/endpoint device shows up under /sys/bus/cxl/devices/.
> 
> The root cause is twofold:
> 
>   1. acpi_pci_root_add() never calls acpi_dev_clear_dependencies(),
>      so _DEP suppliers downstream of a PCI root are never released.
> 
>   2. ACPI0016 is not on acpi_honor_dep_ids[], so even when ACPI0017
>      declares _DEP on it, acpi_dev_ready_for_enumeration() bypasses
>      the dep_unmet check and lets cxl_acpi probe early.
> 
> On x86 the bug is usually masked by link order (acpi_pci_root is
> built in and probed before cxl_acpi). On architectures like RISC-V
> that ordering is not guaranteed, so the standard ACPI _DEP mechanism
> must actually work.
> 
> This series fixes both sides and the two patches must be applied
> together; applying only patch 2 would prevent cxl_acpi from ever
> probing on ACPI0016 systems, because the supplier would never clear
> the dependency.
> 
>   Patch 1 makes acpi_pci_root_add() clear _DEP on the supplier once
>           the PCI root bus has been added.
>   Patch 2 adds ACPI0016 to acpi_honor_dep_ids[] so the dependency
>           declared by ACPI0017 is enforced.
> 
> The approach in this series follows the discussion of an earlier
> posting:
> https://lore.kernel.org/linux-cxl/20260514023238.49984-1-cp0613@linux.alibaba.com/
> 
> Chen Pei (2):
>   ACPI: PCI: clear _DEP dependencies after PCI root bridge attach
>   ACPI: scan: honor _DEP for ACPI0016 PCI/CXL host bridge
> 
>  drivers/acpi/pci_root.c | 4 ++++
>  drivers/acpi/scan.c     | 1 +
>  2 files changed, 5 insertions(+)
> 

For the series

Reviewed-by: Dave Jiang <dave.jiang@intel.com>

Are Fixes tags needed?