When mmio64_mask is not used, overall size should not bigger than 2G for single bridge. Get out early, so we could have chance to have some child resources get assigned instead of failing all of them, as bridge resource assigned is too small when overflow happens. Signed-off-by: Yinghai Lu <yinghai@xxxxxxxxxx> --- drivers/pci/setup-bus.c | 10 ++++++++++ 1 file changed, 10 insertions(+) Index: linux-2.6/drivers/pci/setup-bus.c =================================================================== --- linux-2.6.orig/drivers/pci/setup-bus.c +++ linux-2.6/drivers/pci/setup-bus.c @@ -957,6 +957,16 @@ static int pbus_size_mem(struct pci_bus (r->flags & mask) != type3)) continue; r_size = resource_size(r); + + /* reject oversize early */ + if (!mem64_mask && + ((unsigned long long)size + r_size > (1ULL<<31))) { + dev_warn(&dev->dev, "disabling BAR %d: %pR size %#llx overflow bridge's)\n", + i, r, (unsigned long long)size); + r->flags = 0; + continue; + } + #ifdef CONFIG_PCI_IOV /* put SRIOV requested res to the optional list */ if (realloc_head && i >= PCI_IOV_RESOURCES && -- To unsubscribe from this list: send the line "unsubscribe linux-pci" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html