aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcel Apfelbaum <marcel@redhat.com>2015-12-07 14:05:14 +0200
committerKevin O'Connor <kevin@koconnor.net>2015-12-20 14:40:06 -0500
commit76327b9f32a009245c215f4a3c5d58a01b5310ae (patch)
treec7eb1d58ff784f3e7e1f17a1e77424384be40fde
parent320df85010401c6d3ee189a54c63b937d1dcade9 (diff)
downloadseabios-hppa-76327b9f32a009245c215f4a3c5d58a01b5310ae.zip
seabios-hppa-76327b9f32a009245c215f4a3c5d58a01b5310ae.tar.gz
seabios-hppa-76327b9f32a009245c215f4a3c5d58a01b5310ae.tar.bz2
fw/pci: do not automatically allocate IO region for PCIe bridges
PCIe downstream ports (Root Ports and switches Downstream Ports) appear to firmware as PCI-PCI bridges and a 4K IO space is allocated for them even if there is no device behind them requesting IO space, all that for hotplug purpose. However, PCIe devices can work without IO, so there is no need to allocate IO space for hotplug. Acked-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Marcel Apfelbaum <marcel@redhat.com>
-rw-r--r--src/fw/pciinit.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/fw/pciinit.c b/src/fw/pciinit.c
index 7b8aab7..c31c2fa 100644
--- a/src/fw/pciinit.c
+++ b/src/fw/pciinit.c
@@ -645,9 +645,8 @@ pci_region_create_entry(struct pci_bus *bus, struct pci_device *dev,
return entry;
}
-static int pci_bus_hotplug_support(struct pci_bus *bus)
+static int pci_bus_hotplug_support(struct pci_bus *bus, u8 pcie_cap)
{
- u8 pcie_cap = pci_find_capability(bus->bus_dev, PCI_CAP_ID_EXP, 0);
u8 shpc_cap;
if (pcie_cap) {
@@ -727,7 +726,8 @@ static int pci_bios_check_devices(struct pci_bus *busses)
*/
parent = &busses[0];
int type;
- int hotplug_support = pci_bus_hotplug_support(s);
+ u8 pcie_cap = pci_find_capability(s->bus_dev, PCI_CAP_ID_EXP, 0);
+ int hotplug_support = pci_bus_hotplug_support(s, pcie_cap);
for (type = 0; type < PCI_REGION_TYPE_COUNT; type++) {
u64 align = (type == PCI_REGION_TYPE_IO) ?
PCI_BRIDGE_IO_MIN : PCI_BRIDGE_MEM_MIN;
@@ -736,7 +736,8 @@ static int pci_bios_check_devices(struct pci_bus *busses)
if (pci_region_align(&s->r[type]) > align)
align = pci_region_align(&s->r[type]);
u64 sum = pci_region_sum(&s->r[type]);
- if (!sum && hotplug_support)
+ int resource_optional = pcie_cap && (type == PCI_REGION_TYPE_IO);
+ if (!sum && hotplug_support && !resource_optional)
sum = align; /* reserve min size for hot-plug */
u64 size = ALIGN(sum, align);
int is64 = pci_bios_bridge_region_is64(&s->r[type],