[PATCH v2] pci: correct PCI device enumeration to include all functions on device 0

Simon Glass sjg at chromium.org
Wed Apr 22 00:48:29 CEST 2026


Hi Maximilian,

On 2026-04-20T12:03:35, Maximilian Brune <maximilian.brune at 9elements.com> wrote:
> pci: correct PCI device enumeration to include all functions on device 0
>
> Currently the implementation does not just skip all devices beside
> device 0, it also skips all functions (besides 0) on device 0. This
> broke basically all AMD platforms, since they have a lot of internal SOC
> devices behind these functions.
>
> This was detected, because the XHCI controller and therefore the USB
> devices were not found by u-boot on AMD/crater platform.
>
> PCI_MASK_BUS() returns both device and function bits, so it skipps any
> bdf where either device > 0 or function > 0. Using PCI_DEV() extracts
> only the device number, matching the intent in only_one_child().
> It therefore now checks all functions on device 0 (Linux does the same).
>
> I build tested u-boot as coreboot payload and run it on a recent x86 AMD
> platform. Devices like the XHCI controller are now found again.
>
> Fixes: fbde868ba4aa ("pci: skip unnecessary PCIe scanning")
> Signed-off-by: Maximilian Brune <maximilian.brune at 9elements.com>
> [...]
>
> drivers/pci/pci-uclass.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

> diff --git a/drivers/pci/pci-uclass.c b/drivers/pci/pci-uclass.c
> @@ -927,7 +927,7 @@ int pci_bind_bus_devices(struct udevice *bus)

Nit: "skipps" should be "skips" in the commit message.

Reviewed-by: Simon Glass <sjg at chromium.org>


More information about the U-Boot mailing list