From f514b8ae82ab73dfc2a7e57f75861c6d9ee2a7eb Mon Sep 17 00:00:00 2001 From: Nico Huber Date: Fri, 25 Feb 2022 14:25:57 +0100 Subject: device/pci_device: Fix PCIe bridge detection PCI bus 0 is not below any PCI device. In case of pci_domain_scan_bus(), it's our virtual `domain` device. Expecting a PCI device above bus 0 resulted in undefined behavior for all boards with PCI. Only boards with a PCI device 00:00.0 that looked like a PCIe bridge showed issues, though (e.g. OCP/DeltaLake). Change-Id: I1fd68b9dc0d2e388ec2bbba4adbadd33e14f0171 Signed-off-by: Nico Huber Fixes: commit 777ffff442 (device/pci_device.c: Scan only one device for PCIe) Reviewed-on: https://review.coreboot.org/c/coreboot/+/62376 Reviewed-by: Angel Pons Reviewed-by: Paul Menzel Reviewed-by: Arthur Heymans Tested-by: build bot (Jenkins) --- src/device/pci_device.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') diff --git a/src/device/pci_device.c b/src/device/pci_device.c index 2acc517804..82494b9830 100644 --- a/src/device/pci_device.c +++ b/src/device/pci_device.c @@ -1352,6 +1352,9 @@ static bool pci_bus_only_one_child(struct bus *bus) if (!bridge) return false; + if (bridge->path.type != DEVICE_PATH_PCI) + return false; + pcie_pos = pci_find_capability(bridge, PCI_CAP_ID_PCIE); if (!pcie_pos) return false; -- cgit v1.2.3