summaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorYinghai Lu <yinghai@kernel.org>2009-11-24 18:05:12 -0800
committerJesse Barnes <jbarnes@virtuousgeek.org>2009-12-04 16:00:17 -0800
commit575939cf548951dde8df0786899ea5a91bb669b2 (patch)
tree827fd5a0645d83e87879d7e62f53f51e59f7c54d /arch
parentf9f45604edcf87ac86a9d68ca54106c5fb743719 (diff)
downloadlinux-575939cf548951dde8df0786899ea5a91bb669b2.tar.gz
linux-575939cf548951dde8df0786899ea5a91bb669b2.tar.bz2
linux-575939cf548951dde8df0786899ea5a91bb669b2.zip
x86/PCI: claim SR-IOV BARs in pcibios_allocate_resource
This allows us to use the BIOS SR-IOV allocations rather than assigning our own later on. Signed-off-by: Yinghai Lu <yinghai@kernel.org> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/x86/pci/i386.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/arch/x86/pci/i386.c b/arch/x86/pci/i386.c
index b73c09f45210..5dc9e8c63fcd 100644
--- a/arch/x86/pci/i386.c
+++ b/arch/x86/pci/i386.c
@@ -146,16 +146,29 @@ static void __init pcibios_allocate_bus_resources(struct list_head *bus_list)
}
}
+struct pci_check_idx_range {
+ int start;
+ int end;
+};
+
static void __init pcibios_allocate_resources(int pass)
{
struct pci_dev *dev = NULL;
- int idx, disabled;
+ int idx, disabled, i;
u16 command;
struct resource *r;
+ struct pci_check_idx_range idx_range[] = {
+ { PCI_STD_RESOURCES, PCI_STD_RESOURCE_END },
+#ifdef CONFIG_PCI_IOV
+ { PCI_IOV_RESOURCES, PCI_IOV_RESOURCE_END },
+#endif
+ };
+
for_each_pci_dev(dev) {
pci_read_config_word(dev, PCI_COMMAND, &command);
- for (idx = 0; idx < PCI_ROM_RESOURCE; idx++) {
+ for (i = 0; i < ARRAY_SIZE(idx_range); i++)
+ for (idx = idx_range[i].start; idx <= idx_range[i].end; idx++) {
r = &dev->resource[idx];
if (r->parent) /* Already allocated */
continue;