summaryrefslogtreecommitdiffstats
path: root/drivers/pci/iov.c
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2012-01-07 21:53:13 +0100
committerArnd Bergmann <arnd@arndb.de>2012-01-07 21:53:13 +0100
commit23c4c1c7b0dd2ebeb90bb6851478c0e80fe9e6b8 (patch)
tree60ab5e96f1e6e0ddd46eadf34d8a83ae2d8db72a /drivers/pci/iov.c
parentMerge branch 'tegra/soc' into next/soc (diff)
parentMerge branch 'restart' into for-linus (diff)
downloadlinux-23c4c1c7b0dd2ebeb90bb6851478c0e80fe9e6b8.tar.xz
linux-23c4c1c7b0dd2ebeb90bb6851478c0e80fe9e6b8.zip
Merge branch 'depends/rmk/for-linus' into next/soc
Conflicts: arch/arm/mach-tegra/board-dt-tegra20.c arch/arm/mach-tegra/common.c
Diffstat (limited to 'drivers/pci/iov.c')
-rw-r--r--drivers/pci/iov.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/pci/iov.c b/drivers/pci/iov.c
index b82c155d7b37..1969a3ee3058 100644
--- a/drivers/pci/iov.c
+++ b/drivers/pci/iov.c
@@ -283,6 +283,7 @@ static int sriov_enable(struct pci_dev *dev, int nr_virtfn)
struct resource *res;
struct pci_dev *pdev;
struct pci_sriov *iov = dev->sriov;
+ int bars = 0;
if (!nr_virtfn)
return 0;
@@ -307,6 +308,7 @@ static int sriov_enable(struct pci_dev *dev, int nr_virtfn)
nres = 0;
for (i = 0; i < PCI_SRIOV_NUM_BARS; i++) {
+ bars |= (1 << (i + PCI_IOV_RESOURCES));
res = dev->resource + PCI_IOV_RESOURCES + i;
if (res->parent)
nres++;
@@ -324,6 +326,11 @@ static int sriov_enable(struct pci_dev *dev, int nr_virtfn)
return -ENOMEM;
}
+ if (pci_enable_resources(dev, bars)) {
+ dev_err(&dev->dev, "SR-IOV: IOV BARS not allocated\n");
+ return -ENOMEM;
+ }
+
if (iov->link != dev->devfn) {
pdev = pci_get_slot(dev->bus, iov->link);
if (!pdev)