diff options
| author | Arnd Bergmann <arnd@arndb.de> | 2012-01-04 00:27:45 +0400 |
|---|---|---|
| committer | Arnd Bergmann <arnd@arndb.de> | 2012-01-04 00:27:45 +0400 |
| commit | 5d3cb0ffdd0c8987dc17a2ef4529b246198ceb72 (patch) | |
| tree | c60bdca0529cbd44d32b3918b78d14e182ef57cd /drivers/pci/iov.c | |
| parent | 3b0d597139efddfd8960b44249b4a4c977d172f1 (diff) | |
| parent | 5f0a6e2d503896062f641639dacfe5055c2f593b (diff) | |
| download | linux-5d3cb0ffdd0c8987dc17a2ef4529b246198ceb72.tar.xz | |
Merge branch 'v3.2-rc7' into next/pm
Conflicts:
arch/arm/kernel/setup.c
arch/arm/mach-shmobile/board-kota2.c
Diffstat (limited to 'drivers/pci/iov.c')
| -rw-r--r-- | drivers/pci/iov.c | 7 |
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) |
