@@ -1355,6 +1355,8 @@ static void pdev_assign_fixed_resources(struct pci_dev *dev)
while (b && !r->parent) {
assign_fixed_resource_on_bus(b, r);
b = b->parent;
+ if (!r->parent && pci_can_move_bars)
+ break;
}
}
}
@@ -298,6 +298,18 @@ static int _pci_assign_resource(struct pci_dev *dev, int resno,
bus = dev->bus;
while ((ret = __pci_assign_resource(bus, dev, resno, size, min_align))) {
+ if (pci_can_move_bars) {
+ if (resno >= PCI_BRIDGE_RESOURCES &&
+ resno <= PCI_BRIDGE_RESOURCE_END) {
+ struct resource *res = dev->resource + resno;
+
+ res->start = 0;
+ res->end = 0;
+ res->flags = 0;
+ }
+ break;
+ }
+
if (!bus->parent || !bus->self->transparent)
break;
bus = bus->parent;
When movable BARs are enabled, the feature of resource relocating from commit 2bbc6942273b5 ("PCI : ability to relocate assigned pci-resources") is not used. Instead, inability to assign a resource is used as a signal to retry BAR assignment with other configuration of bridge windows. Signed-off-by: Sergey Miroshnichenko <s.miroshnichenko@yadro.com> --- drivers/pci/setup-bus.c | 2 ++ drivers/pci/setup-res.c | 12 ++++++++++++ 2 files changed, 14 insertions(+)