Skip to content

Commit

Permalink
PCI/MSI: Return -ENOSPC if pci_enable_msi_range() can't get enough ve…
Browse files Browse the repository at this point in the history
…ctors

If device doesn't support as many MSI vectors as the driver requested, we
previously returned -EINVAL from __pci_enable_msi_range() and
pci_enable_msi_range().  In other similar situations in both
__pci_enable_msi_range() and __pci_enable_msix_range(), we returned
-ENOSPC.

Return -ENOSPC from __pci_enable_msi_range() so we do it consistently.

[bhelgaas: changelog]
Signed-off-by: Dennis Chen <dennis.chen@arm.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
CC: Tejun Heo <tj@kernel.org>
CC: Christoph Hellwig <hch@lst.de>
CC: Tom Long Nguyen <tom.l.nguyen@intel.com>
CC: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
CC: Marc Zyngier <marc.zyngier@arm.com>
CC: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
CC: Steve Capper <steve.capper@arm.com>
  • Loading branch information
arm64b authored and bjorn-helgaas committed Feb 10, 2017
1 parent 3674cc4 commit 948b762
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/pci/msi.c
Original file line number Diff line number Diff line change
Expand Up @@ -1065,7 +1065,7 @@ static int __pci_enable_msi_range(struct pci_dev *dev, int minvec, int maxvec,
if (nvec < 0)
return nvec;
if (nvec < minvec)
return -EINVAL;
return -ENOSPC;

if (nvec > maxvec)
nvec = maxvec;
Expand Down

0 comments on commit 948b762

Please sign in to comment.