diff options
author | Bjorn Helgaas <bhelgaas@google.com> | 2015-03-25 16:23:42 +0800 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2015-03-31 13:02:35 +1100 |
commit | 68f8e9fa56ce6b5cb18323e8d8fa536fee0f89ca (patch) | |
tree | b4cd2a2baf1b1053d1f49fcb668063aa04b8cd4a /drivers/pci | |
parent | c6406d8fbb014bebdfb5bf3c244548958aec7379 (diff) | |
download | linux-68f8e9fa56ce6b5cb18323e8d8fa536fee0f89ca.tar.bz2 |
PCI: Print more info in sriov_enable() error message
If we don't have space for all the bus numbers required to enable VFs,
print the largest bus number required and the range available.
No functional change; improved error message only.
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Wei Yang <weiyang@linux.vnet.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'drivers/pci')
-rw-r--r-- | drivers/pci/iov.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/pci/iov.c b/drivers/pci/iov.c index 4b3a4eaad996..c4c33ead03bc 100644 --- a/drivers/pci/iov.c +++ b/drivers/pci/iov.c @@ -180,6 +180,7 @@ static int sriov_enable(struct pci_dev *dev, int nr_virtfn) struct pci_dev *pdev; struct pci_sriov *iov = dev->sriov; int bars = 0; + u8 bus; if (!nr_virtfn) return 0; @@ -216,8 +217,10 @@ static int sriov_enable(struct pci_dev *dev, int nr_virtfn) iov->offset = offset; iov->stride = stride; - if (virtfn_bus(dev, nr_virtfn - 1) > dev->bus->busn_res.end) { - dev_err(&dev->dev, "SR-IOV: bus number out of range\n"); + bus = virtfn_bus(dev, nr_virtfn - 1); + if (bus > dev->bus->busn_res.end) { + dev_err(&dev->dev, "can't enable %d VFs (bus %02x out of range of %pR)\n", + nr_virtfn, bus, &dev->bus->busn_res); return -ENOMEM; } |