All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] scsi: fnic: fix msix interrupt allocation
@ 2019-08-27 21:13 Govindarajulu Varadarajan
  2019-09-04 12:09 ` John Pittman
  2019-09-07 19:30 ` Martin K. Petersen
  0 siblings, 2 replies; 3+ messages in thread
From: Govindarajulu Varadarajan @ 2019-08-27 21:13 UTC (permalink / raw)
  To: linux-scsi, martin.petersen, jejb
  Cc: Govindarajulu Varadarajan, Satish Kharat

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")
Acked-by: Satish Kharat <satishkh@cisco.com>
Signed-off-by: Govindarajulu Varadarajan <gvaradar@cisco.com>
---
 drivers/scsi/fnic/fnic_isr.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/fnic/fnic_isr.c b/drivers/scsi/fnic/fnic_isr.c
index da4602b63495..2fb2731f50fb 100644
--- a/drivers/scsi/fnic/fnic_isr.c
+++ b/drivers/scsi/fnic/fnic_isr.c
@@ -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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] scsi: fnic: fix msix interrupt allocation
  2019-08-27 21:13 [PATCH] scsi: fnic: fix msix interrupt allocation Govindarajulu Varadarajan
@ 2019-09-04 12:09 ` John Pittman
  2019-09-07 19:30 ` Martin K. Petersen
  1 sibling, 0 replies; 3+ messages in thread
From: John Pittman @ 2019-09-04 12:09 UTC (permalink / raw)
  To: Govindarajulu Varadarajan
  Cc: linux-scsi, Martin K. Petersen, jejb, Satish Kharat

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.

On Tue, Aug 27, 2019 at 5:20 PM Govindarajulu Varadarajan
<gvaradar@cisco.com> wrote:
>
> 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")
> Acked-by: Satish Kharat <satishkh@cisco.com>
> Signed-off-by: Govindarajulu Varadarajan <gvaradar@cisco.com>
> ---
>  drivers/scsi/fnic/fnic_isr.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/scsi/fnic/fnic_isr.c b/drivers/scsi/fnic/fnic_isr.c
> index da4602b63495..2fb2731f50fb 100644
> --- a/drivers/scsi/fnic/fnic_isr.c
> +++ b/drivers/scsi/fnic/fnic_isr.c
> @@ -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
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] scsi: fnic: fix msix interrupt allocation
  2019-08-27 21:13 [PATCH] scsi: fnic: fix msix interrupt allocation Govindarajulu Varadarajan
  2019-09-04 12:09 ` John Pittman
@ 2019-09-07 19:30 ` Martin K. Petersen
  1 sibling, 0 replies; 3+ messages in thread
From: Martin K. Petersen @ 2019-09-07 19:30 UTC (permalink / raw)
  To: Govindarajulu Varadarajan
  Cc: linux-scsi, martin.petersen, jejb, Satish Kharat


Govindarajulu,

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

Applied to 5.4/scsi-queue, thanks!

-- 
Martin K. Petersen	Oracle Linux Engineering

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-09-07 19:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-27 21:13 [PATCH] scsi: fnic: fix msix interrupt allocation Govindarajulu Varadarajan
2019-09-04 12:09 ` John Pittman
2019-09-07 19:30 ` Martin K. Petersen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.