Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

PCI/msi: fix the pci_alloc_irq_vectors_affinity stub

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: Christoph Hellwig <hch@lst.de>
Reported-by: Steven Rostedt <rostedt@goodmis.org>
Fixes: aff17164 ("PCI: Provide sensible IRQ vector alloc/free routines")
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Christoph Hellwig and committed by
Linus Torvalds
83b4605b be941bf2

+3 -3
+3 -3
include/linux/pci.h
··· 1342 1342 unsigned int max_vecs, unsigned int flags, 1343 1343 const struct irq_affinity *aff_desc) 1344 1344 { 1345 - if (min_vecs > 1) 1346 - return -EINVAL; 1347 - return 1; 1345 + if ((flags & PCI_IRQ_LEGACY) && min_vecs == 1 && dev->irq) 1346 + return 1; 1347 + return -ENOSPC; 1348 1348 } 1349 1349 1350 1350 static inline void pci_free_irq_vectors(struct pci_dev *dev)