[SeaBIOS] [PATCH] fw/pci: do not automatically allocate IO region for PCIe bridges
Gerd Hoffmann
kraxel at redhat.com
Mon Dec 7 10:46:28 CET 2015
Hi,
> However, PCIe devices can work without IO, so there is no need
> to allocate IO space for hotplug.
Makes sense.
> diff --git a/src/fw/pciinit.c b/src/fw/pciinit.c
> index 7b8aab7..4b37792 100644
> --- a/src/fw/pciinit.c
> +++ b/src/fw/pciinit.c
> @@ -736,7 +736,9 @@ 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 res_opt = (type == PCI_REGION_TYPE_IO) &&
> + pci_find_capability(s->bus_dev, PCI_CAP_ID_EXP, 0);
I'd make the variable names longer and more descriptive. Also move the
pcie check out of the loop. Note that pci_bus_hotplug_support() looks
for the pcie capability too, so we probably should turn that into
something like pci_bridge_get_props(), so we have to look at the bridge
capabilities only once.
cheers,
Gerd
More information about the SeaBIOS
mailing list