From 6a0ca65b28bdc8a4ddde752602cc36d4b825464a Mon Sep 17 00:00:00 2001 From: Marcel Apfelbaum Date: Wed, 24 Jun 2015 13:45:13 +0200 Subject: [PATCH 2/2] fw/pci: map memory and IO regions for multiple pci root buses Message-id: <1435153513-25431-3-git-send-email-marcel@redhat.com> Patchwork-id: 66383 O-Subject: [RHEL-7.2 seabios PATCH 2/2] fw/pci: map memory and IO regions for multiple pci root buses Bugzilla: 1235381 RH-Acked-by: Miroslav Rezanina RH-Acked-by: Gerd Hoffmann RH-Acked-by: Laszlo Ersek 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 Signed-off-by: Marcel Apfelbaum Signed-off-by: Gerd Hoffmann (cherry picked from commit 0fe4c9ee7af5f6bb3a1fcbf1d39116a894600c90) Signed-off-by: Miroslav Rezanina --- src/fw/pciinit.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/fw/pciinit.c b/src/fw/pciinit.c index b2fd659..0ce7325 100644 --- a/src/fw/pciinit.c +++ b/src/fw/pciinit.c @@ -655,6 +655,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) && @@ -685,6 +690,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; u8 shpc_cap = pci_find_capability(s->bus_dev, PCI_CAP_ID_SHPC); for (type = 0; type < PCI_REGION_TYPE_COUNT; type++) { -- 1.8.3.1