Commit 63913462 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Greg Kroah-Hartman

PCI/msi: fix the pci_alloc_irq_vectors_affinity stub


[ Upstream commit 83b4605b ]

We need to return an error for any call that asks for MSI / MSI-X
vectors only, so that non-trivial fallback logic can work properly.

Also valid dev->irq and use the "correct" errno value based on feedback
from Linus.
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Reported-by: default avatarSteven Rostedt <rostedt@goodmis.org>
Fixes: aff17164 ("PCI: Provide sensible IRQ vector alloc/free routines")
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: default avatarSasha Levin <alexander.levin@microsoft.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent c198e227
...@@ -1348,9 +1348,9 @@ static inline int pci_alloc_irq_vectors(struct pci_dev *dev, ...@@ -1348,9 +1348,9 @@ static inline int pci_alloc_irq_vectors(struct pci_dev *dev,
unsigned int min_vecs, unsigned int max_vecs, unsigned int min_vecs, unsigned int max_vecs,
unsigned int flags) unsigned int flags)
{ {
if (min_vecs > 1) if ((flags & PCI_IRQ_LEGACY) && min_vecs == 1 && dev->irq)
return -EINVAL; return 1;
return 1; return -ENOSPC;
} }
static inline void pci_free_irq_vectors(struct pci_dev *dev) static inline void pci_free_irq_vectors(struct pci_dev *dev)
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment