* [PATCH 0/2] ACPI/PCI/CXL: Enforce _DEP ordering between ACPI0016 and ACPI0017
@ 2026-05-26 2:51 Chen Pei
2026-05-26 2:51 ` [PATCH 1/2] ACPI: PCI: Clear _DEP dependencies after PCI root bridge attach Chen Pei
` (3 more replies)
0 siblings, 4 replies; 7+ messages in thread
From: Chen Pei @ 2026-05-26 2:51 UTC (permalink / raw)
To: dave.jiang, alison.schofield, djbw, icheng, bhelgaas, rafael,
lenb, guoren
Cc: linux-pci, linux-cxl, linux-acpi, linux-kernel, Chen Pei
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
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 1/2] ACPI: PCI: Clear _DEP dependencies after PCI root bridge attach
2026-05-26 2:51 [PATCH 0/2] ACPI/PCI/CXL: Enforce _DEP ordering between ACPI0016 and ACPI0017 Chen Pei
@ 2026-05-26 2:51 ` Chen Pei
2026-05-26 2:51 ` [PATCH 2/2] ACPI: scan: Honor _DEP for ACPI0016 PCI/CXL host bridge Chen Pei
` (2 subsequent siblings)
3 siblings, 0 replies; 7+ messages in thread
From: Chen Pei @ 2026-05-26 2:51 UTC (permalink / raw)
To: dave.jiang, alison.schofield, djbw, icheng, bhelgaas, rafael,
lenb, guoren
Cc: linux-pci, linux-cxl, linux-acpi, linux-kernel, Chen Pei
PCI root bridges enumerated by acpi_pci_root_add() can be the _DEP
supplier for other ACPI consumers, most notably ACPI0017 CXL root
devices whose probe path depends on acpi_pci_find_root() succeeding.
Once the root bus has been added, those consumers can safely be
enumerated, so notify them by clearing the dependency.
Call acpi_dev_clear_dependencies() at the end of acpi_pci_root_add(),
after pci_bus_add_devices(), following the same pattern used by other
ACPI suppliers such as the EC (drivers/acpi/ec.c) and the ACPI PCI
Link device (drivers/acpi/pci_link.c). The clear is intentionally
done only on the success path; on the error paths the supplier did
not attach and consumers must keep dep_unmet set.
This is a prerequisite for honoring _DEP on ACPI0016 host bridges,
which matters on architectures where the probe order of acpi_pci_root
relative to cxl_acpi is not guaranteed (e.g. RISC-V).
Signed-off-by: Chen Pei <cp0613@linux.alibaba.com>
Suggested-by: Dan Williams (nvidia) <djbw@kernel.org>
---
drivers/acpi/pci_root.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/acpi/pci_root.c b/drivers/acpi/pci_root.c
index a0ba64e45e8a..4c06c3ffd0cb 100644
--- a/drivers/acpi/pci_root.c
+++ b/drivers/acpi/pci_root.c
@@ -755,6 +755,10 @@ static int acpi_pci_root_add(struct acpi_device *device,
pci_lock_rescan_remove();
pci_bus_add_devices(root->bus);
pci_unlock_rescan_remove();
+
+ /* Clear _DEP dependencies to allow consumers to enumerate */
+ acpi_dev_clear_dependencies(device);
+
return 1;
remove_dmar:
--
2.50.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 2/2] ACPI: scan: Honor _DEP for ACPI0016 PCI/CXL host bridge
2026-05-26 2:51 [PATCH 0/2] ACPI/PCI/CXL: Enforce _DEP ordering between ACPI0016 and ACPI0017 Chen Pei
2026-05-26 2:51 ` [PATCH 1/2] ACPI: PCI: Clear _DEP dependencies after PCI root bridge attach Chen Pei
@ 2026-05-26 2:51 ` Chen Pei
2026-05-27 11:38 ` Rafael J. Wysocki
2026-05-26 15:01 ` [PATCH 0/2] ACPI/PCI/CXL: Enforce _DEP ordering between ACPI0016 and ACPI0017 Dave Jiang
2026-05-27 1:14 ` Alison Schofield
3 siblings, 1 reply; 7+ messages in thread
From: Chen Pei @ 2026-05-26 2:51 UTC (permalink / raw)
To: dave.jiang, alison.schofield, djbw, icheng, bhelgaas, rafael,
lenb, guoren
Cc: linux-pci, linux-cxl, linux-acpi, linux-kernel, Chen Pei
CXL root devices (ACPI0017) declare _DEP on their parent ACPI0016
PCI/CXL host bridge so that cxl_acpi probes only after acpi_pci_root
has attached the PCI root and registered it for acpi_pci_find_root().
However, acpi_dev_ready_for_enumeration() only consults dep_unmet
when the supplier's HID is on acpi_honor_dep_ids[]; otherwise the
dependency is silently ignored.
Without honoring the dependency, cxl_acpi can probe before the PCI
root is ready. The resulting CXL topology is broken: decoder targets
read as 0 and no port/endpoint devices appear under
/sys/bus/cxl/devices/.
Add ACPI0016 to acpi_honor_dep_ids[] so the _DEP declared by ACPI0017
is enforced. This relies on the preceding patch ("ACPI: PCI: clear
_DEP dependencies after PCI root bridge attach"), which releases the
dependency once the PCI root is fully enumerated; the two patches
must be applied together.
Signed-off-by: Chen Pei <cp0613@linux.alibaba.com>
---
drivers/acpi/scan.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c
index 530547cda8b2..5f20e7748f36 100644
--- a/drivers/acpi/scan.c
+++ b/drivers/acpi/scan.c
@@ -866,6 +866,7 @@ static const char * const acpi_honor_dep_ids[] = {
"RSCV0005", /* RISC-V SBI MPXY MBOX */
"RSCV0006", /* RISC-V RPMI SYSMSI */
"PNP0C0F", /* PCI Link Device */
+ "ACPI0016", /* CXL/PCIe host bridge: CXL root (ACPI0017) depends on PCI root attach */
NULL
};
--
2.50.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH 0/2] ACPI/PCI/CXL: Enforce _DEP ordering between ACPI0016 and ACPI0017
2026-05-26 2:51 [PATCH 0/2] ACPI/PCI/CXL: Enforce _DEP ordering between ACPI0016 and ACPI0017 Chen Pei
2026-05-26 2:51 ` [PATCH 1/2] ACPI: PCI: Clear _DEP dependencies after PCI root bridge attach Chen Pei
2026-05-26 2:51 ` [PATCH 2/2] ACPI: scan: Honor _DEP for ACPI0016 PCI/CXL host bridge Chen Pei
@ 2026-05-26 15:01 ` Dave Jiang
2026-05-27 1:14 ` Alison Schofield
3 siblings, 0 replies; 7+ messages in thread
From: Dave Jiang @ 2026-05-26 15:01 UTC (permalink / raw)
To: Chen Pei, alison.schofield, djbw, icheng, bhelgaas, rafael, lenb,
guoren
Cc: linux-pci, linux-cxl, linux-acpi, linux-kernel
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?
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 0/2] ACPI/PCI/CXL: Enforce _DEP ordering between ACPI0016 and ACPI0017
2026-05-26 2:51 [PATCH 0/2] ACPI/PCI/CXL: Enforce _DEP ordering between ACPI0016 and ACPI0017 Chen Pei
` (2 preceding siblings ...)
2026-05-26 15:01 ` [PATCH 0/2] ACPI/PCI/CXL: Enforce _DEP ordering between ACPI0016 and ACPI0017 Dave Jiang
@ 2026-05-27 1:14 ` Alison Schofield
2026-06-01 17:27 ` Rafael J. Wysocki
3 siblings, 1 reply; 7+ messages in thread
From: Alison Schofield @ 2026-05-27 1:14 UTC (permalink / raw)
To: Chen Pei
Cc: dave.jiang, djbw, icheng, bhelgaas, rafael, lenb, guoren,
linux-pci, linux-cxl, linux-acpi, linux-kernel
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>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 2/2] ACPI: scan: Honor _DEP for ACPI0016 PCI/CXL host bridge
2026-05-26 2:51 ` [PATCH 2/2] ACPI: scan: Honor _DEP for ACPI0016 PCI/CXL host bridge Chen Pei
@ 2026-05-27 11:38 ` Rafael J. Wysocki
0 siblings, 0 replies; 7+ messages in thread
From: Rafael J. Wysocki @ 2026-05-27 11:38 UTC (permalink / raw)
To: Chen Pei
Cc: dave.jiang, alison.schofield, djbw, icheng, bhelgaas, guoren,
linux-pci, linux-cxl, linux-acpi, linux-kernel, Ira Weiny
On Tue, May 26, 2026 at 4:51 AM Chen Pei <cp0613@linux.alibaba.com> wrote:
>
> CXL root devices (ACPI0017) declare _DEP on their parent ACPI0016
> PCI/CXL host bridge so that cxl_acpi probes only after acpi_pci_root
> has attached the PCI root and registered it for acpi_pci_find_root().
> However, acpi_dev_ready_for_enumeration() only consults dep_unmet
> when the supplier's HID is on acpi_honor_dep_ids[]; otherwise the
> dependency is silently ignored.
>
> Without honoring the dependency, cxl_acpi can probe before the PCI
> root is ready. The resulting CXL topology is broken: decoder targets
> read as 0 and no port/endpoint devices appear under
> /sys/bus/cxl/devices/.
>
> Add ACPI0016 to acpi_honor_dep_ids[] so the _DEP declared by ACPI0017
> is enforced. This relies on the preceding patch ("ACPI: PCI: clear
> _DEP dependencies after PCI root bridge attach"), which releases the
> dependency once the PCI root is fully enumerated; the two patches
> must be applied together.
>
> Signed-off-by: Chen Pei <cp0613@linux.alibaba.com>
> ---
> drivers/acpi/scan.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c
> index 530547cda8b2..5f20e7748f36 100644
> --- a/drivers/acpi/scan.c
> +++ b/drivers/acpi/scan.c
> @@ -866,6 +866,7 @@ static const char * const acpi_honor_dep_ids[] = {
> "RSCV0005", /* RISC-V SBI MPXY MBOX */
> "RSCV0006", /* RISC-V RPMI SYSMSI */
> "PNP0C0F", /* PCI Link Device */
> + "ACPI0016", /* CXL/PCIe host bridge: CXL root (ACPI0017) depends on PCI root attach */
> NULL
> };
>
> --
If anyone has any objections or comments on this one, please let me
know. In the absence of any, it will be queued up (as 7.2 material)
next week.
Thanks!
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 0/2] ACPI/PCI/CXL: Enforce _DEP ordering between ACPI0016 and ACPI0017
2026-05-27 1:14 ` Alison Schofield
@ 2026-06-01 17:27 ` Rafael J. Wysocki
0 siblings, 0 replies; 7+ messages in thread
From: Rafael J. Wysocki @ 2026-06-01 17:27 UTC (permalink / raw)
To: Alison Schofield, Chen Pei
Cc: dave.jiang, djbw, icheng, bhelgaas, guoren, linux-pci, linux-cxl,
linux-acpi, linux-kernel
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!
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2026-06-01 17:27 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-26 2:51 [PATCH 0/2] ACPI/PCI/CXL: Enforce _DEP ordering between ACPI0016 and ACPI0017 Chen Pei
2026-05-26 2:51 ` [PATCH 1/2] ACPI: PCI: Clear _DEP dependencies after PCI root bridge attach Chen Pei
2026-05-26 2:51 ` [PATCH 2/2] ACPI: scan: Honor _DEP for ACPI0016 PCI/CXL host bridge Chen Pei
2026-05-27 11:38 ` Rafael J. Wysocki
2026-05-26 15:01 ` [PATCH 0/2] ACPI/PCI/CXL: Enforce _DEP ordering between ACPI0016 and ACPI0017 Dave Jiang
2026-05-27 1:14 ` Alison Schofield
2026-06-01 17:27 ` Rafael J. Wysocki
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox