PCI/MSI: Forward MSI-X error code in pci_alloc_irq_vectors_affinity()
authorPiotr Stankiewicz <piotr.stankiewicz@intel.com>
Tue, 16 Jun 2020 07:33:16 +0000 (09:33 +0200)
committerBjorn Helgaas <bhelgaas@google.com>
Tue, 30 Jun 2020 22:02:39 +0000 (17:02 -0500)
commit30ff3e8c287455e9f7f85162df10d62819ba42a9
tree83111761f10e996363a841e2c0e6e21821abd632
parentb3a9e3b9622ae10064826dccb4f7a52bd88c7407
PCI/MSI: Forward MSI-X error code in pci_alloc_irq_vectors_affinity()

When debugging an issue where I was asking the PCI machinery to enable a
set of MSI-X vectors, without falling back on MSI, I ran across a behaviour
which seems odd. The pci_alloc_irq_vectors_affinity() will always return
-ENOSPC on failure, when allocating MSI-X vectors only, whereas with MSI
fallback it will forward any error returned by __pci_enable_msi_range().
This is a confusing behaviour, so have the pci_alloc_irq_vectors_affinity()
forward the error code from __pci_enable_msix_range() when appropriate.

Link: https://lore.kernel.org/r/20200616073318.20229-1-piotr.stankiewicz@intel.com
Signed-off-by: Piotr Stankiewicz <piotr.stankiewicz@intel.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Reviewed-by: Logan Gunthorpe <logang@deltatee.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
drivers/pci/msi.c