For resource sizing and mapping purposes treat devices on extra root buses as if they are on the default root bus (bus 0).
Signed-off-by: Kevin O'Connor kevin@koconnor.net Signed-off-by: Marcel Apfelbaum marcel@redhat.com --- src/fw/pciinit.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
diff --git a/src/fw/pciinit.c b/src/fw/pciinit.c index a5f6505..701a6e0 100644 --- a/src/fw/pciinit.c +++ b/src/fw/pciinit.c @@ -686,6 +686,11 @@ static int pci_bios_check_devices(struct pci_bus *busses) busses[pci->secondary_bus].bus_dev = pci;
struct pci_bus *bus = &busses[pci_bdf_to_bus(pci->bdf)]; + if (!bus->bus_dev) + /* + * Resources for all root busses go in busses[0] + */ + bus = &busses[0]; int i; for (i = 0; i < PCI_NUM_REGIONS; i++) { if ((pci->class == PCI_CLASS_BRIDGE_PCI) && @@ -716,6 +721,11 @@ static int pci_bios_check_devices(struct pci_bus *busses) if (!s->bus_dev) continue; struct pci_bus *parent = &busses[pci_bdf_to_bus(s->bus_dev->bdf)]; + if (!parent->bus_dev) + /* + * Resources for all root busses go in busses[0] + */ + parent = &busses[0]; int type; int hotplug_support = pci_bus_hotplug_support(s); for (type = 0; type < PCI_REGION_TYPE_COUNT; type++) {