Patch "PCI/msi: fix the pci_alloc_irq_vectors_affinity stub" has been added to the 4.9-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    PCI/msi: fix the pci_alloc_irq_vectors_affinity stub

to the 4.9-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     pci-msi-fix-the-pci_alloc_irq_vectors_affinity-stub.patch
and it can be found in the queue-4.9 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.


>From foo@baz Mon Apr  9 17:09:24 CEST 2018
From: Christoph Hellwig <hch@xxxxxx>
Date: Sat, 20 May 2017 18:59:54 +0200
Subject: PCI/msi: fix the pci_alloc_irq_vectors_affinity stub

From: Christoph Hellwig <hch@xxxxxx>


[ Upstream commit 83b4605b0c16cde5b00c8cf192408d51eab75402 ]

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@xxxxxx>
Reported-by: Steven Rostedt <rostedt@xxxxxxxxxxx>
Fixes: aff17164 ("PCI: Provide sensible IRQ vector alloc/free routines")
Signed-off-by: Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx>
Signed-off-by: Sasha Levin <alexander.levin@xxxxxxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
---
 include/linux/pci.h |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -1348,9 +1348,9 @@ static inline int pci_alloc_irq_vectors(
 		unsigned int min_vecs, unsigned int max_vecs,
 		unsigned int flags)
 {
-	if (min_vecs > 1)
-		return -EINVAL;
-	return 1;
+	if ((flags & PCI_IRQ_LEGACY) && min_vecs == 1 && dev->irq)
+		return 1;
+	return -ENOSPC;
 }
 static inline void pci_free_irq_vectors(struct pci_dev *dev)
 {


Patches currently in stable-queue which might be from hch@xxxxxx are

queue-4.9/nvme-pci-fix-multiple-ctrl-removal-scheduling.patch
queue-4.9/bio-integrity-do-not-allocate-integrity-context-for-bio-w-o-data.patch
queue-4.9/scsi-libsas-initialize-sas_phy-status-according-to-response-of-discover.patch
queue-4.9/nvme-fix-hang-in-remove-path.patch
queue-4.9/scsi-libsas-fix-error-when-getting-phy-events.patch
queue-4.9/ib-srpt-avoid-that-aborting-a-command-triggers-a-kernel-warning.patch
queue-4.9/blk-mq-fix-race-between-updating-nr_hw_queues-and-switching-io-sched.patch
queue-4.9/pci-msi-fix-the-pci_alloc_irq_vectors_affinity-stub.patch
queue-4.9/scsi-libsas-fix-memory-leak-in-sas_smp_get_phy_events.patch
queue-4.9/ib-srpt-fix-abort-handling.patch



[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]