aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci
diff options
context:
space:
mode:
authorYinghai Lu <yinghai@kernel.org>2011-07-25 16:08:40 -0400
committerJesse Barnes <jbarnes@virtuousgeek.org>2011-08-01 14:50:31 -0400
commit2aceefcbd5a73059e5f52831817ec277e987440d (patch)
tree37b1a0f36a0cde11ab73d5ca2108ab94a1eb10f6 /drivers/pci
parent2bbc6942273b5b3097bd265d82227bdd84b351b2 (diff)
PCI: make SRIOV resources optional
From: Yinghai Lu <yinghai@kernel.org> Allocate resources to SRIOV BARs only after all other required resource-requests are satisfied. Dont retry if resource allocation for SRIOV BARs fail. Signed-off-by: Ram Pai <linuxram@us.ibm.com> Signed-off-by: Yinghai Lu <yinghai@kernel.org> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Diffstat (limited to 'drivers/pci')
-rw-r--r--drivers/pci/setup-bus.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/pci/setup-bus.c b/drivers/pci/setup-bus.c
index 1796c6ffe91c..1c19b9f4019a 100644
--- a/drivers/pci/setup-bus.c
+++ b/drivers/pci/setup-bus.c
@@ -673,6 +673,16 @@ static int pbus_size_mem(struct pci_bus *bus, unsigned long mask,
673 if (r->parent || (r->flags & mask) != type) 673 if (r->parent || (r->flags & mask) != type)
674 continue; 674 continue;
675 r_size = resource_size(r); 675 r_size = resource_size(r);
676#ifdef CONFIG_PCI_IOV
677 /* put SRIOV requested res to the optional list */
678 if (add_head && i >= PCI_IOV_RESOURCES &&
679 i <= PCI_IOV_RESOURCE_END) {
680 r->end = r->start - 1;
681 add_to_list(add_head, dev, r, r_size, 1);
682 children_add_size += r_size;
683 continue;
684 }
685#endif
676 /* For bridges size != alignment */ 686 /* For bridges size != alignment */
677 align = pci_resource_alignment(dev, r); 687 align = pci_resource_alignment(dev, r);
678 order = __ffs(align) - 20; 688 order = __ffs(align) - 20;