Skip to contentSkip to conversation

scsi: fnic: fix msix interrupt allocation

PATCH Applied Govindarajulu Varadarajan 3 participants 3 messages Aug 27, 2019 – Sep 7, 2019

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 scsi: fnic: fix msix interrupt allocation

pci_alloc_irq_vectors() returns number of vectors allocated. Fix the check for error condition.

Fixes cca678dfbad49 ("scsi: fnic: switch to pci_alloc_irq_vectors")
---
 drivers/scsi/fnic/fnic_isr.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/scsi/fnic/fnic_isr.c +2 -2
index da4602b63495..2fb2731f50fb 100644
@@ -254,7 +254,7 @@ int fnic_set_intr_mode(struct fnic *fnic)
 		int vecs = n + m + o + 1;
 
 		if (pci_alloc_irq_vectors(fnic->pdev, vecs, vecs,
-				PCI_IRQ_MSIX) < 0) {
+				PCI_IRQ_MSIX) == vecs) {
 			fnic->rq_count = n;
 			fnic->raw_wq_count = m;
 			fnic->wq_copy_count = o;
@@ -280,7 +280,7 @@ int fnic_set_intr_mode(struct fnic *fnic)
 	    fnic->wq_copy_count >= 1 &&
 	    fnic->cq_count >= 3 &&
 	    fnic->intr_count >= 1 &&
-	    pci_alloc_irq_vectors(fnic->pdev, 1, 1, PCI_IRQ_MSI) < 0) {
+	    pci_alloc_irq_vectors(fnic->pdev, 1, 1, PCI_IRQ_MSI) == 1) {
 		fnic->rq_count = 1;
 		fnic->raw_wq_count = 1;
 		fnic->wq_copy_count = 1;
Signature · 1 line
2.21.0
#1 lore raw

Hi Martin, would you have a quick look at this one when you get a moment? Bugging you for selfish reasons as I'm trying to get this included in the next RHEL release. Thanks for any info.

Quoted 36 lines · Govindarajulu Varadarajan

pci_alloc_irq_vectors() returns number of vectors allocated. Fix the check for error condition.

Fixes cca678dfbad49 ("scsi: fnic: switch to pci_alloc_irq_vectors")
---
 drivers/scsi/fnic/fnic_isr.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/scsi/fnic/fnic_isr.c +2 -3
index da4602b63495..2fb2731f50fb 100644
@@ -254,7 +254,7 @@ int fnic_set_intr_mode(struct fnic *fnic)
                int vecs = n + m + o + 1;
 
                if (pci_alloc_irq_vectors(fnic->pdev, vecs, vecs,
-                               PCI_IRQ_MSIX) < 0) {
+                               PCI_IRQ_MSIX) == vecs) {
                        fnic->rq_count = n;
                        fnic->raw_wq_count = m;
                        fnic->wq_copy_count = o;
@@ -280,7 +280,7 @@ int fnic_set_intr_mode(struct fnic *fnic)
            fnic->wq_copy_count >= 1 &&
            fnic->cq_count >= 3 &&
            fnic->intr_count >= 1 &&
-           pci_alloc_irq_vectors(fnic->pdev, 1, 1, PCI_IRQ_MSI) < 0) {
+           pci_alloc_irq_vectors(fnic->pdev, 1, 1, PCI_IRQ_MSI) == 1) {
                fnic->rq_count = 1;
                fnic->raw_wq_count = 1;
                fnic->wq_copy_count = 1;
--

2.21.0

#2 lore raw
In reply to Govindarajulu Varadarajan

Govindarajulu,

Quoted 2 lines

pci_alloc_irq_vectors() returns number of vectors allocated. Fix the check for error condition.

Applied to 5.4/scsi-queue, thanks!

Signature · 1 line
Martin K. Petersen	Oracle Linux Engineering