On Fri, 2019-08-16 at 19:50 +0300, Sergey Miroshnichenko wrote: > A hotplugged bridge with many hotplug-capable ports may request > reserving more IO space than the machine has. This could be overridden > with the "hpiosize=" kernel argument though. > > But when BARs are movable, there are no need to reserve space anymore: > new BARs are allocated not from reserved gaps, but via rearranging the > existing BARs. Requesting a precise amount of space for bridge windows > increases the chances of adding the new bridge successfully. It wouldn't hurt to reserve some memory space to prevent unnecessary BAR shuffling at runtime. If it turns out that we need more space then we can always fall back to re-assigning the whole tree. > Signed-off-by: Sergey Miroshnichenko <s.miroshnichenko@xxxxxxxxx> > --- > drivers/pci/setup-bus.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/pci/setup-bus.c b/drivers/pci/setup-bus.c > index c7b7e30c6284..7d64ec8e7088 100644 > --- a/drivers/pci/setup-bus.c > +++ b/drivers/pci/setup-bus.c > @@ -1287,7 +1287,7 @@ void __pci_bus_size_bridges(struct pci_bus *bus, struct list_head *realloc_head) > > case PCI_HEADER_TYPE_BRIDGE: > pci_bridge_check_ranges(bus); > - if (bus->self->is_hotplug_bridge) { > + if (bus->self->is_hotplug_bridge && !pci_movable_bars_enabled()) { > additional_io_size = pci_hotplug_io_size; > additional_mem_size = pci_hotplug_mem_size; > }