All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 RESEND 00/23] scsi: Use pci_enable_msix_range() instead of pci_enable_msix()
@ 2014-07-16 18:05 Alexander Gordeev
  2014-07-16 18:05 ` [PATCH v2 RESEND 01/23] be2iscsi: Use pci_enable_msix_exact() " Alexander Gordeev
                   ` (23 more replies)
  0 siblings, 24 replies; 85+ messages in thread
From: Alexander Gordeev @ 2014-07-16 18:05 UTC (permalink / raw)
  To: linux-kernel
  Cc: Alexander Gordeev, iss_storagedev, intel-linux-scu, support,
	DL-MPTFusionLinux, qla2xxx-upstream, iscsi-driver, pv-drivers,
	linux-scsi, linux-pci

Hello,

This is a series of mostly trivial patches. Once accepted,
we could phase out pci_enable_msix() interface.

As result of deprecation of MSI-X/MSI enablement functions
pci_enable_msix() and pci_enable_msi_block() all drivers
using these two interfaces need to be updated to use the
new pci_enable_msi_range()  or pci_enable_msi_exact()
and pci_enable_msix_range() or pci_enable_msix_exact()
interfaces.

Thanks!

Cc: iss_storagedev@hp.com
Cc: intel-linux-scu@intel.com
Cc: support@lsi.com
Cc: DL-MPTFusionLinux@lsi.com
Cc: qla2xxx-upstream@qlogic.com
Cc: iscsi-driver@qlogic.com
Cc: pv-drivers@vmware.com
Cc: linux-scsi@vger.kernel.org
Cc: linux-pci@vger.kernel.org

Alexander Gordeev (23):
  be2iscsi: Use pci_enable_msix_exact() instead of pci_enable_msix()
  bfa: Do not call pci_enable_msix() after it failed once
  bfa: Cleanup bfad_setup_intr() function
  bfa: Use pci_enable_msix_exact() instead of pci_enable_msix()
  csiostor: Remove superfluous call to pci_disable_msix()
  csiostor: Use pci_enable_msix_range() instead of pci_enable_msix()
  fnic: Use pci_enable_msix_exact() instead of pci_enable_msix()
  hpsa: Fallback to MSI rather than to INTx if MSI-X failed
  hpsa: Use pci_enable_msix_range() instead of pci_enable_msix()
  isci: Use pci_enable_msix_exact() instead of pci_enable_msix()
  lpfc: Remove superfluous call to pci_disable_msix()
  lpfc: Use pci_enable_msix_range() instead of pci_enable_msix()
  megaraid: Fail resume if MSI-X re-initialization failed
  megaraid: Use pci_enable_msix_range() instead of pci_enable_msix()
  mpt2sas: Use pci_enable_msix_exact() instead of pci_enable_msix()
  mpt3sas: Use pci_enable_msix_exact() instead of pci_enable_msix()
  pm8001: Fix invalid return when request_irq() failed
  pm8001: Use pci_enable_msix_exact() instead of pci_enable_msix()
  pmcraid: Get rid of a redundant assignment
  pmcraid: Use pci_enable_msix_range() instead of pci_enable_msix()
  qla2xxx: Use pci_enable_msix_range() instead of pci_enable_msix()
  qla4xxx: Use pci_enable_msix_exact() instead of pci_enable_msix()
  vmw_pvscsi: Use pci_enable_msix_exact() instead of pci_enable_msix()

 drivers/scsi/be2iscsi/be_main.c           |    6 +--
 drivers/scsi/bfa/bfad.c                   |   62 ++++++++++++-----------------
 drivers/scsi/csiostor/csio_hw.h           |    2 +-
 drivers/scsi/csiostor/csio_isr.c          |   24 ++++-------
 drivers/scsi/fnic/fnic_isr.c              |    4 +-
 drivers/scsi/hpsa.c                       |   28 ++++++-------
 drivers/scsi/isci/init.c                  |    2 +-
 drivers/scsi/lpfc/lpfc_init.c             |   47 +++++++++++-----------
 drivers/scsi/megaraid/megaraid_sas_base.c |   24 +++++------
 drivers/scsi/mpt2sas/mpt2sas_base.c       |    6 +-
 drivers/scsi/mpt3sas/mpt3sas_base.c       |    4 +-
 drivers/scsi/pm8001/pm8001_init.c         |   44 +++++++++++----------
 drivers/scsi/pmcraid.c                    |   14 +------
 drivers/scsi/qla2xxx/qla_isr.c            |   27 +++++-------
 drivers/scsi/qla4xxx/ql4_nx.c             |    2 +-
 drivers/scsi/vmw_pvscsi.c                 |    2 +-
 16 files changed, 128 insertions(+), 170 deletions(-)

-- 
1.7.7.6


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

* [PATCH v2 RESEND 01/23] be2iscsi: Use pci_enable_msix_exact() instead of pci_enable_msix()
  2014-07-16 18:05 [PATCH v2 RESEND 00/23] scsi: Use pci_enable_msix_range() instead of pci_enable_msix() Alexander Gordeev
@ 2014-07-16 18:05 ` Alexander Gordeev
  2014-07-26  8:08   ` Alexander Gordeev
  2014-07-16 18:05 ` [PATCH v2 RESEND 02/23] bfa: Do not call pci_enable_msix() after it failed once Alexander Gordeev
                   ` (22 subsequent siblings)
  23 siblings, 1 reply; 85+ messages in thread
From: Alexander Gordeev @ 2014-07-16 18:05 UTC (permalink / raw)
  To: linux-kernel; +Cc: Alexander Gordeev

As result of deprecation of MSI-X/MSI enablement functions
pci_enable_msix() and pci_enable_msi_block() all drivers
using these two interfaces need to be updated to use the
new pci_enable_msi_range()  or pci_enable_msi_exact()
and pci_enable_msix_range() or pci_enable_msix_exact()
interfaces.

Signed-off-by: Alexander Gordeev <agordeev@redhat.com>
---
 drivers/scsi/be2iscsi/be_main.c |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/scsi/be2iscsi/be_main.c b/drivers/scsi/be2iscsi/be_main.c
index 56467df..1f63169 100644
--- a/drivers/scsi/be2iscsi/be_main.c
+++ b/drivers/scsi/be2iscsi/be_main.c
@@ -5278,12 +5278,10 @@ static void beiscsi_msix_enable(struct beiscsi_hba *phba)
 	for (i = 0; i <= phba->num_cpus; i++)
 		phba->msix_entries[i].entry = i;
 
-	status = pci_enable_msix(phba->pcidev, phba->msix_entries,
-				 (phba->num_cpus + 1));
+	status = pci_enable_msix_exact(phba->pcidev, phba->msix_entries,
+				       phba->num_cpus + 1);
 	if (!status)
 		phba->msix_enabled = true;
-
-	return;
 }
 
 static void be_eqd_update(struct beiscsi_hba *phba)
-- 
1.7.7.6


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

* [PATCH v2 RESEND 02/23] bfa: Do not call pci_enable_msix() after it failed once
  2014-07-16 18:05 [PATCH v2 RESEND 00/23] scsi: Use pci_enable_msix_range() instead of pci_enable_msix() Alexander Gordeev
  2014-07-16 18:05 ` [PATCH v2 RESEND 01/23] be2iscsi: Use pci_enable_msix_exact() " Alexander Gordeev
@ 2014-07-16 18:05 ` Alexander Gordeev
  2014-07-16 18:05 ` [PATCH v2 RESEND 03/23] bfa: Cleanup bfad_setup_intr() function Alexander Gordeev
                   ` (21 subsequent siblings)
  23 siblings, 0 replies; 85+ messages in thread
From: Alexander Gordeev @ 2014-07-16 18:05 UTC (permalink / raw)
  To: linux-kernel
  Cc: Alexander Gordeev, Anil Gurumurthy, Vijaya Mohan Guvva,
	linux-scsi, linux-pci

Function pci_enable_msix() should not be called in case
it threw a negative errno from a previous call.

Signed-off-by: Alexander Gordeev <agordeev@redhat.com>
Cc: Anil Gurumurthy <agurumur@brocade.com>
Cc: Vijaya Mohan Guvva <vmohan@brocade.com>
Cc: linux-scsi@vger.kernel.org
Cc: linux-pci@vger.kernel.org
Acked-by: Anil Gurumurthy <anil.gurumurthy@qlogic.com>
---
 drivers/scsi/bfa/bfad.c |   48 ++++++++++++++++++++++------------------------
 1 files changed, 23 insertions(+), 25 deletions(-)

diff --git a/drivers/scsi/bfa/bfad.c b/drivers/scsi/bfa/bfad.c
index 7593b7c..bb93180 100644
--- a/drivers/scsi/bfa/bfad.c
+++ b/drivers/scsi/bfa/bfad.c
@@ -1235,33 +1235,31 @@ bfad_setup_intr(struct bfad_s *bfad)
 	   (bfa_asic_id_cb(pdev->device) && !msix_disable_cb)) {
 
 		error = pci_enable_msix(bfad->pcidev, msix_entries, bfad->nvec);
-		if (error) {
-			/* In CT1 & CT2, try to allocate just one vector */
-			if (bfa_asic_id_ctc(pdev->device)) {
-				printk(KERN_WARNING "bfa %s: trying one msix "
-				       "vector failed to allocate %d[%d]\n",
-				       bfad->pci_name, bfad->nvec, error);
-				bfad->nvec = 1;
-				error = pci_enable_msix(bfad->pcidev,
+		/* In CT1 & CT2, try to allocate just one vector */
+		if (error > 0 && bfa_asic_id_ctc(pdev->device)) {
+			printk(KERN_WARNING "bfa %s: trying one msix "
+			       "vector failed to allocate %d[%d]\n",
+			       bfad->pci_name, bfad->nvec, error);
+			bfad->nvec = 1;
+			error = pci_enable_msix(bfad->pcidev,
 						msix_entries, bfad->nvec);
-			}
+		}
 
-			/*
-			 * Only error number of vector is available.
-			 * We don't have a mechanism to map multiple
-			 * interrupts into one vector, so even if we
-			 * can try to request less vectors, we don't
-			 * know how to associate interrupt events to
-			 *  vectors. Linux doesn't duplicate vectors
-			 * in the MSIX table for this case.
-			 */
-			if (error) {
-				printk(KERN_WARNING "bfad%d: "
-				       "pci_enable_msix failed (%d), "
-				       "use line based.\n",
-					bfad->inst_no, error);
-				goto line_based;
-			}
+		/*
+		 * Only error number of vector is available.
+		 * We don't have a mechanism to map multiple
+		 * interrupts into one vector, so even if we
+		 * can try to request less vectors, we don't
+		 * know how to associate interrupt events to
+		 *  vectors. Linux doesn't duplicate vectors
+		 * in the MSIX table for this case.
+		 */
+		if (error) {
+			printk(KERN_WARNING "bfad%d: "
+			       "pci_enable_msix failed (%d), "
+			       "use line based.\n",
+				bfad->inst_no, error);
+			goto line_based;
 		}
 
 		/* Disable INTX in MSI-X mode */
-- 
1.7.7.6


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

* [PATCH v2 RESEND 03/23] bfa: Cleanup bfad_setup_intr() function
  2014-07-16 18:05 [PATCH v2 RESEND 00/23] scsi: Use pci_enable_msix_range() instead of pci_enable_msix() Alexander Gordeev
  2014-07-16 18:05 ` [PATCH v2 RESEND 01/23] be2iscsi: Use pci_enable_msix_exact() " Alexander Gordeev
  2014-07-16 18:05 ` [PATCH v2 RESEND 02/23] bfa: Do not call pci_enable_msix() after it failed once Alexander Gordeev
@ 2014-07-16 18:05 ` Alexander Gordeev
  2014-07-16 18:05 ` [PATCH v2 RESEND 04/23] bfa: Use pci_enable_msix_exact() instead of pci_enable_msix() Alexander Gordeev
                   ` (20 subsequent siblings)
  23 siblings, 0 replies; 85+ messages in thread
From: Alexander Gordeev @ 2014-07-16 18:05 UTC (permalink / raw)
  To: linux-kernel
  Cc: Alexander Gordeev, Anil Gurumurthy, Vijaya Mohan Guvva,
	linux-scsi, linux-pci

Signed-off-by: Alexander Gordeev <agordeev@redhat.com>
Cc: Anil Gurumurthy <agurumur@brocade.com>
Cc: Vijaya Mohan Guvva <vmohan@brocade.com>
Cc: linux-scsi@vger.kernel.org
Cc: linux-pci@vger.kernel.org
Acked-by: Anil Gurumurthy <anil.gurumurthy@qlogic.com>
---
 drivers/scsi/bfa/bfad.c |   18 ++++++++----------
 1 files changed, 8 insertions(+), 10 deletions(-)

diff --git a/drivers/scsi/bfa/bfad.c b/drivers/scsi/bfa/bfad.c
index bb93180..c18279f 100644
--- a/drivers/scsi/bfa/bfad.c
+++ b/drivers/scsi/bfa/bfad.c
@@ -1219,7 +1219,7 @@ bfad_install_msix_handler(struct bfad_s *bfad)
 int
 bfad_setup_intr(struct bfad_s *bfad)
 {
-	int error = 0;
+	int error;
 	u32 mask = 0, i, num_bit = 0, max_bit = 0;
 	struct msix_entry msix_entries[MAX_MSIX_ENTRY];
 	struct pci_dev *pdev = bfad->pcidev;
@@ -1279,20 +1279,18 @@ bfad_setup_intr(struct bfad_s *bfad)
 
 		bfad->bfad_flags |= BFAD_MSIX_ON;
 
-		return error;
+		return 0;
 	}
 
 line_based:
-	error = 0;
-	if (request_irq
-	    (bfad->pcidev->irq, (irq_handler_t) bfad_intx, BFAD_IRQ_FLAGS,
-	     BFAD_DRIVER_NAME, bfad) != 0) {
-		/* Enable interrupt handler failed */
-		return 1;
-	}
+	error = request_irq(bfad->pcidev->irq, (irq_handler_t)bfad_intx,
+			    BFAD_IRQ_FLAGS, BFAD_DRIVER_NAME, bfad);
+	if (error)
+		return error;
+
 	bfad->bfad_flags |= BFAD_INTX_ON;
 
-	return error;
+	return 0;
 }
 
 void
-- 
1.7.7.6


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

* [PATCH v2 RESEND 04/23] bfa: Use pci_enable_msix_exact() instead of pci_enable_msix()
  2014-07-16 18:05 [PATCH v2 RESEND 00/23] scsi: Use pci_enable_msix_range() instead of pci_enable_msix() Alexander Gordeev
                   ` (2 preceding siblings ...)
  2014-07-16 18:05 ` [PATCH v2 RESEND 03/23] bfa: Cleanup bfad_setup_intr() function Alexander Gordeev
@ 2014-07-16 18:05 ` Alexander Gordeev
  2014-08-11  7:39   ` Alexander Gordeev
  2014-07-16 18:05 ` [PATCH v2 RESEND 05/23] csiostor: Remove superfluous call to pci_disable_msix() Alexander Gordeev
                   ` (19 subsequent siblings)
  23 siblings, 1 reply; 85+ messages in thread
From: Alexander Gordeev @ 2014-07-16 18:05 UTC (permalink / raw)
  To: linux-kernel
  Cc: Alexander Gordeev, Anil Gurumurthy, Vijaya Mohan Guvva,
	linux-scsi, linux-pci

As result of deprecation of MSI-X/MSI enablement functions
pci_enable_msix() and pci_enable_msi_block() all drivers
using these two interfaces need to be updated to use the
new pci_enable_msi_range()  or pci_enable_msi_exact()
and pci_enable_msix_range() or pci_enable_msix_exact()
interfaces.

Signed-off-by: Alexander Gordeev <agordeev@redhat.com>
Cc: Anil Gurumurthy <agurumur@brocade.com>
Cc: Vijaya Mohan Guvva <vmohan@brocade.com>
Cc: linux-scsi@vger.kernel.org
Cc: linux-pci@vger.kernel.org
Acked-by: Anil Gurumurthy <anil.gurumurthy@qlogic.com>
---
 drivers/scsi/bfa/bfad.c |   20 ++++++--------------
 1 files changed, 6 insertions(+), 14 deletions(-)

diff --git a/drivers/scsi/bfa/bfad.c b/drivers/scsi/bfa/bfad.c
index c18279f..e90a374 100644
--- a/drivers/scsi/bfa/bfad.c
+++ b/drivers/scsi/bfa/bfad.c
@@ -1234,29 +1234,21 @@ bfad_setup_intr(struct bfad_s *bfad)
 	if ((bfa_asic_id_ctc(pdev->device) && !msix_disable_ct) ||
 	   (bfa_asic_id_cb(pdev->device) && !msix_disable_cb)) {
 
-		error = pci_enable_msix(bfad->pcidev, msix_entries, bfad->nvec);
+		error = pci_enable_msix_exact(bfad->pcidev,
+					      msix_entries, bfad->nvec);
 		/* In CT1 & CT2, try to allocate just one vector */
-		if (error > 0 && bfa_asic_id_ctc(pdev->device)) {
+		if (error == -ENOSPC && bfa_asic_id_ctc(pdev->device)) {
 			printk(KERN_WARNING "bfa %s: trying one msix "
 			       "vector failed to allocate %d[%d]\n",
 			       bfad->pci_name, bfad->nvec, error);
 			bfad->nvec = 1;
-			error = pci_enable_msix(bfad->pcidev,
-						msix_entries, bfad->nvec);
+			error = pci_enable_msix_exact(bfad->pcidev,
+						      msix_entries, 1);
 		}
 
-		/*
-		 * Only error number of vector is available.
-		 * We don't have a mechanism to map multiple
-		 * interrupts into one vector, so even if we
-		 * can try to request less vectors, we don't
-		 * know how to associate interrupt events to
-		 *  vectors. Linux doesn't duplicate vectors
-		 * in the MSIX table for this case.
-		 */
 		if (error) {
 			printk(KERN_WARNING "bfad%d: "
-			       "pci_enable_msix failed (%d), "
+			       "pci_enable_msix_exact failed (%d), "
 			       "use line based.\n",
 				bfad->inst_no, error);
 			goto line_based;
-- 
1.7.7.6


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

* [PATCH v2 RESEND 05/23] csiostor: Remove superfluous call to pci_disable_msix()
  2014-07-16 18:05 [PATCH v2 RESEND 00/23] scsi: Use pci_enable_msix_range() instead of pci_enable_msix() Alexander Gordeev
                   ` (3 preceding siblings ...)
  2014-07-16 18:05 ` [PATCH v2 RESEND 04/23] bfa: Use pci_enable_msix_exact() instead of pci_enable_msix() Alexander Gordeev
@ 2014-07-16 18:05 ` Alexander Gordeev
  2014-07-26  8:13   ` Alexander Gordeev
  2014-07-16 18:05 ` [PATCH v2 RESEND 06/23] csiostor: Use pci_enable_msix_range() instead of pci_enable_msix() Alexander Gordeev
                   ` (18 subsequent siblings)
  23 siblings, 1 reply; 85+ messages in thread
From: Alexander Gordeev @ 2014-07-16 18:05 UTC (permalink / raw)
  To: linux-kernel
  Cc: Alexander Gordeev, Naresh Kumar Inna, Arvind Bhushan, linux-scsi,
	linux-pci

There is no need to call pci_disable_msix() in case
the previous call to pci_enable_msix() failed

Signed-off-by: Alexander Gordeev <agordeev@redhat.com>
Cc: Naresh Kumar Inna <naresh@chelsio.com>
Cc: Arvind Bhushan <arvindb@chelsio.com>
Cc: linux-scsi@vger.kernel.org
Cc: linux-pci@vger.kernel.org
---
 drivers/scsi/csiostor/csio_isr.c |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)

diff --git a/drivers/scsi/csiostor/csio_isr.c b/drivers/scsi/csiostor/csio_isr.c
index 7ee9777..91ba91d 100644
--- a/drivers/scsi/csiostor/csio_isr.c
+++ b/drivers/scsi/csiostor/csio_isr.c
@@ -529,10 +529,8 @@ csio_enable_msix(struct csio_hw *hw)
 			csio_reduce_sqsets(hw, cnt - extra);
 		}
 	} else {
-		if (rv > 0) {
-			pci_disable_msix(hw->pdev);
+		if (rv > 0)
 			csio_info(hw, "Not using MSI-X, remainder:%d\n", rv);
-		}
 
 		kfree(entries);
 		return -ENOMEM;
-- 
1.7.7.6


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

* [PATCH v2 RESEND 06/23] csiostor: Use pci_enable_msix_range() instead of pci_enable_msix()
  2014-07-16 18:05 [PATCH v2 RESEND 00/23] scsi: Use pci_enable_msix_range() instead of pci_enable_msix() Alexander Gordeev
                   ` (4 preceding siblings ...)
  2014-07-16 18:05 ` [PATCH v2 RESEND 05/23] csiostor: Remove superfluous call to pci_disable_msix() Alexander Gordeev
@ 2014-07-16 18:05 ` Alexander Gordeev
  2014-08-11  7:49   ` Alexander Gordeev
  2014-07-16 18:05 ` [PATCH v2 RESEND 07/23] fnic: Use pci_enable_msix_exact() " Alexander Gordeev
                   ` (17 subsequent siblings)
  23 siblings, 1 reply; 85+ messages in thread
From: Alexander Gordeev @ 2014-07-16 18:05 UTC (permalink / raw)
  To: linux-kernel
  Cc: Alexander Gordeev, Naresh Kumar Inna, Arvind Bhushan, linux-scsi,
	linux-pci

As result of deprecation of MSI-X/MSI enablement functions
pci_enable_msix() and pci_enable_msi_block() all drivers
using these two interfaces need to be updated to use the
new pci_enable_msi_range()  or pci_enable_msi_exact()
and pci_enable_msix_range() or pci_enable_msix_exact()
interfaces.

Signed-off-by: Alexander Gordeev <agordeev@redhat.com>
Cc: Naresh Kumar Inna <naresh@chelsio.com>
Cc: Arvind Bhushan <arvindb@chelsio.com>
Cc: linux-scsi@vger.kernel.org
Cc: linux-pci@vger.kernel.org
---
 drivers/scsi/csiostor/csio_hw.h  |    2 +-
 drivers/scsi/csiostor/csio_isr.c |   22 +++++++++-------------
 2 files changed, 10 insertions(+), 14 deletions(-)

diff --git a/drivers/scsi/csiostor/csio_hw.h b/drivers/scsi/csiostor/csio_hw.h
index 49b1daa..5db2d85 100644
--- a/drivers/scsi/csiostor/csio_hw.h
+++ b/drivers/scsi/csiostor/csio_hw.h
@@ -94,7 +94,7 @@ enum {
 };
 
 struct csio_msix_entries {
-	unsigned short	vector;		/* Vector assigned by pci_enable_msix */
+	unsigned short	vector;		/* Assigned MSI-X vector */
 	void		*dev_id;	/* Priv object associated w/ this msix*/
 	char		desc[24];	/* Description of this vector */
 };
diff --git a/drivers/scsi/csiostor/csio_isr.c b/drivers/scsi/csiostor/csio_isr.c
index 91ba91d..a8c748a 100644
--- a/drivers/scsi/csiostor/csio_isr.c
+++ b/drivers/scsi/csiostor/csio_isr.c
@@ -499,7 +499,7 @@ csio_reduce_sqsets(struct csio_hw *hw, int cnt)
 static int
 csio_enable_msix(struct csio_hw *hw)
 {
-	int rv, i, j, k, n, min, cnt;
+	int i, j, k, n, min, cnt;
 	struct csio_msix_entries *entryp;
 	struct msix_entry *entries;
 	int extra = CSIO_EXTRA_VECS;
@@ -521,19 +521,15 @@ csio_enable_msix(struct csio_hw *hw)
 
 	csio_dbg(hw, "FW supp #niq:%d, trying %d msix's\n", hw->cfg_niq, cnt);
 
-	while ((rv = pci_enable_msix(hw->pdev, entries, cnt)) >= min)
-		cnt = rv;
-	if (!rv) {
-		if (cnt < (hw->num_sqsets + extra)) {
-			csio_dbg(hw, "Reducing sqsets to %d\n", cnt - extra);
-			csio_reduce_sqsets(hw, cnt - extra);
-		}
-	} else {
-		if (rv > 0)
-			csio_info(hw, "Not using MSI-X, remainder:%d\n", rv);
-
+	cnt = pci_enable_msix_range(hw->pdev, entries, min, cnt);
+	if (cnt < 0) {
 		kfree(entries);
-		return -ENOMEM;
+		return cnt;
+	}
+
+	if (cnt < (hw->num_sqsets + extra)) {
+		csio_dbg(hw, "Reducing sqsets to %d\n", cnt - extra);
+		csio_reduce_sqsets(hw, cnt - extra);
 	}
 
 	/* Save off vectors */
-- 
1.7.7.6


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

* [PATCH v2 RESEND 07/23] fnic: Use pci_enable_msix_exact() instead of pci_enable_msix()
  2014-07-16 18:05 [PATCH v2 RESEND 00/23] scsi: Use pci_enable_msix_range() instead of pci_enable_msix() Alexander Gordeev
                   ` (5 preceding siblings ...)
  2014-07-16 18:05 ` [PATCH v2 RESEND 06/23] csiostor: Use pci_enable_msix_range() instead of pci_enable_msix() Alexander Gordeev
@ 2014-07-16 18:05 ` Alexander Gordeev
  2014-07-26  8:15   ` Alexander Gordeev
  2014-07-16 18:05 ` [PATCH v2 RESEND 08/23] hpsa: Fallback to MSI rather than to INTx if MSI-X failed Alexander Gordeev
                   ` (16 subsequent siblings)
  23 siblings, 1 reply; 85+ messages in thread
From: Alexander Gordeev @ 2014-07-16 18:05 UTC (permalink / raw)
  To: linux-kernel
  Cc: Alexander Gordeev, Hiral Patel, Suma Ramars, Brian Uchino,
	linux-scsi, linux-pci

As result of deprecation of MSI-X/MSI enablement functions
pci_enable_msix() and pci_enable_msi_block() all drivers
using these two interfaces need to be updated to use the
new pci_enable_msi_range()  or pci_enable_msi_exact()
and pci_enable_msix_range() or pci_enable_msix_exact()
interfaces.

Signed-off-by: Alexander Gordeev <agordeev@redhat.com>
Cc: Hiral Patel <hiralpat@cisco.com>
Cc: Suma Ramars <sramars@cisco.com>
Cc: Brian Uchino <buchino@cisco.com>
Cc: linux-scsi@vger.kernel.org
Cc: linux-pci@vger.kernel.org
---
 drivers/scsi/fnic/fnic_isr.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/fnic/fnic_isr.c b/drivers/scsi/fnic/fnic_isr.c
index 7d9b54a..a0dd1b6 100644
--- a/drivers/scsi/fnic/fnic_isr.c
+++ b/drivers/scsi/fnic/fnic_isr.c
@@ -257,8 +257,8 @@ int fnic_set_intr_mode(struct fnic *fnic)
 	    fnic->raw_wq_count >= m &&
 	    fnic->wq_copy_count >= o &&
 	    fnic->cq_count >= n + m + o) {
-		if (!pci_enable_msix(fnic->pdev, fnic->msix_entry,
-				    n + m + o + 1)) {
+		if (!pci_enable_msix_exact(fnic->pdev, fnic->msix_entry,
+					   n + m + o + 1)) {
 			fnic->rq_count = n;
 			fnic->raw_wq_count = m;
 			fnic->wq_copy_count = o;
-- 
1.7.7.6


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

* [PATCH v2 RESEND 08/23] hpsa: Fallback to MSI rather than to INTx if MSI-X failed
  2014-07-16 18:05 [PATCH v2 RESEND 00/23] scsi: Use pci_enable_msix_range() instead of pci_enable_msix() Alexander Gordeev
                   ` (6 preceding siblings ...)
  2014-07-16 18:05 ` [PATCH v2 RESEND 07/23] fnic: Use pci_enable_msix_exact() " Alexander Gordeev
@ 2014-07-16 18:05 ` Alexander Gordeev
  2014-07-26  8:16   ` Alexander Gordeev
  2014-08-13 16:04   ` scameron
  2014-07-16 18:05 ` [PATCH v2 RESEND 09/23] hpsa: Use pci_enable_msix_range() instead of pci_enable_msix() Alexander Gordeev
                   ` (15 subsequent siblings)
  23 siblings, 2 replies; 85+ messages in thread
From: Alexander Gordeev @ 2014-07-16 18:05 UTC (permalink / raw)
  To: linux-kernel
  Cc: Alexander Gordeev, Stephen M. Cameron, iss_storagedev,
	linux-scsi, linux-pci

Currently the driver falls back to INTx mode when MSI-X
initialization failed. This is a suboptimal behaviour
for chips that also support MSI. This update changes that
behaviour and falls back to MSI mode in case MSI-X mode
initialization failed.

Signed-off-by: Alexander Gordeev <agordeev@redhat.com>
Cc: "Stephen M. Cameron" <scameron@beardog.cce.hp.com>
Cc: iss_storagedev@hp.com
Cc: linux-scsi@vger.kernel.org
Cc: linux-pci@vger.kernel.org
---
 drivers/scsi/hpsa.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c
index 31184b3..648dec2 100644
--- a/drivers/scsi/hpsa.c
+++ b/drivers/scsi/hpsa.c
@@ -6177,7 +6177,6 @@ static void hpsa_interrupt_mode(struct ctlr_info *h)
 			dev_warn(&h->pdev->dev, "MSI-X init failed %d\n",
 			       err);
 			h->msix_vector = 0;
-			goto default_int_mode;
 		}
 	}
 	if (pci_find_capability(h->pdev, PCI_CAP_ID_MSI)) {
-- 
1.7.7.6


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

* [PATCH v2 RESEND 09/23] hpsa: Use pci_enable_msix_range() instead of pci_enable_msix()
  2014-07-16 18:05 [PATCH v2 RESEND 00/23] scsi: Use pci_enable_msix_range() instead of pci_enable_msix() Alexander Gordeev
                   ` (7 preceding siblings ...)
  2014-07-16 18:05 ` [PATCH v2 RESEND 08/23] hpsa: Fallback to MSI rather than to INTx if MSI-X failed Alexander Gordeev
@ 2014-07-16 18:05 ` Alexander Gordeev
  2014-08-15 15:48   ` scameron
  2014-07-16 18:05 ` [PATCH v2 RESEND 10/23] isci: Use pci_enable_msix_exact() " Alexander Gordeev
                   ` (14 subsequent siblings)
  23 siblings, 1 reply; 85+ messages in thread
From: Alexander Gordeev @ 2014-07-16 18:05 UTC (permalink / raw)
  To: linux-kernel
  Cc: Alexander Gordeev, Stephen M. Cameron, iss_storagedev,
	linux-scsi, linux-pci

As result of deprecation of MSI-X/MSI enablement functions
pci_enable_msix() and pci_enable_msi_block() all drivers
using these two interfaces need to be updated to use the
new pci_enable_msi_range()  or pci_enable_msi_exact()
and pci_enable_msix_range() or pci_enable_msix_exact()
interfaces.

Cc: "Stephen M. Cameron" <scameron@beardog.cce.hp.com>
Cc: iss_storagedev@hp.com
Cc: linux-scsi@vger.kernel.org
Cc: linux-pci@vger.kernel.org
Signed-off-by: Alexander Gordeev <agordeev@redhat.com>
---
 drivers/scsi/hpsa.c |   27 ++++++++++++---------------
 1 files changed, 12 insertions(+), 15 deletions(-)

diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c
index 648dec2..5c4ab6e 100644
--- a/drivers/scsi/hpsa.c
+++ b/drivers/scsi/hpsa.c
@@ -6160,25 +6160,22 @@ static void hpsa_interrupt_mode(struct ctlr_info *h)
 		h->msix_vector = MAX_REPLY_QUEUES;
 		if (h->msix_vector > num_online_cpus())
 			h->msix_vector = num_online_cpus();
-		err = pci_enable_msix(h->pdev, hpsa_msix_entries,
-				      h->msix_vector);
-		if (err > 0) {
+		err = pci_enable_msix_range(h->pdev, hpsa_msix_entries,
+					    1, h->msix_vector);
+		if (err < 0) {
+			dev_warn(&h->pdev->dev, "MSI-X init failed %d\n", err);
+			h->msix_vector = 0;
+			goto single_msi_mode;
+		} else if (err < h->msix_vector) {
 			dev_warn(&h->pdev->dev, "only %d MSI-X vectors "
 			       "available\n", err);
-			h->msix_vector = err;
-			err = pci_enable_msix(h->pdev, hpsa_msix_entries,
-					      h->msix_vector);
-		}
-		if (!err) {
-			for (i = 0; i < h->msix_vector; i++)
-				h->intr[i] = hpsa_msix_entries[i].vector;
-			return;
-		} else {
-			dev_warn(&h->pdev->dev, "MSI-X init failed %d\n",
-			       err);
-			h->msix_vector = 0;
 		}
+		h->msix_vector = err;
+		for (i = 0; i < h->msix_vector; i++)
+			h->intr[i] = hpsa_msix_entries[i].vector;
+		return;
 	}
+single_msi_mode:
 	if (pci_find_capability(h->pdev, PCI_CAP_ID_MSI)) {
 		dev_info(&h->pdev->dev, "MSI\n");
 		if (!pci_enable_msi(h->pdev))
-- 
1.7.7.6


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

* [PATCH v2 RESEND 10/23] isci: Use pci_enable_msix_exact() instead of pci_enable_msix()
  2014-07-16 18:05 [PATCH v2 RESEND 00/23] scsi: Use pci_enable_msix_range() instead of pci_enable_msix() Alexander Gordeev
                   ` (8 preceding siblings ...)
  2014-07-16 18:05 ` [PATCH v2 RESEND 09/23] hpsa: Use pci_enable_msix_range() instead of pci_enable_msix() Alexander Gordeev
@ 2014-07-16 18:05 ` Alexander Gordeev
  2014-08-11  7:57     ` Alexander Gordeev
       [not found]   ` <718e4066d6294033a7590659cf0f3c4d@fmsmsx106.amr.corp.intel.com>
  2014-07-16 18:05 ` [PATCH v2 RESEND 11/23] lpfc: Remove superfluous call to pci_disable_msix() Alexander Gordeev
                   ` (13 subsequent siblings)
  23 siblings, 2 replies; 85+ messages in thread
From: Alexander Gordeev @ 2014-07-16 18:05 UTC (permalink / raw)
  To: linux-kernel
  Cc: Alexander Gordeev, Lukasz Dorau, Maciej Patelczyk, Dave Jiang,
	intel-linux-scu, linux-scsi, linux-pci

As result of deprecation of MSI-X/MSI enablement functions
pci_enable_msix() and pci_enable_msi_block() all drivers
using these two interfaces need to be updated to use the
new pci_enable_msi_range()  or pci_enable_msi_exact()
and pci_enable_msix_range() or pci_enable_msix_exact()
interfaces.

Signed-off-by: Alexander Gordeev <agordeev@redhat.com>
Cc: Lukasz Dorau <lukasz.dorau@intel.com>
Cc: Maciej Patelczyk <maciej.patelczyk@intel.com>
Cc: Dave Jiang <dave.jiang@intel.com>
Cc: intel-linux-scu@intel.com
Cc: linux-scsi@vger.kernel.org
Cc: linux-pci@vger.kernel.org
Acked-by: Artur Paszkiewicz <artur.paszkiewicz@intel.com>
---
 drivers/scsi/isci/init.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/scsi/isci/init.c b/drivers/scsi/isci/init.c
index 695b34e..4198e45 100644
--- a/drivers/scsi/isci/init.c
+++ b/drivers/scsi/isci/init.c
@@ -356,7 +356,7 @@ static int isci_setup_interrupts(struct pci_dev *pdev)
 	for (i = 0; i < num_msix; i++)
 		pci_info->msix_entries[i].entry = i;
 
-	err = pci_enable_msix(pdev, pci_info->msix_entries, num_msix);
+	err = pci_enable_msix_exact(pdev, pci_info->msix_entries, num_msix);
 	if (err)
 		goto intx;
 
-- 
1.7.7.6


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

* [PATCH v2 RESEND 11/23] lpfc: Remove superfluous call to pci_disable_msix()
  2014-07-16 18:05 [PATCH v2 RESEND 00/23] scsi: Use pci_enable_msix_range() instead of pci_enable_msix() Alexander Gordeev
                   ` (9 preceding siblings ...)
  2014-07-16 18:05 ` [PATCH v2 RESEND 10/23] isci: Use pci_enable_msix_exact() " Alexander Gordeev
@ 2014-07-16 18:05 ` Alexander Gordeev
  2014-07-16 18:05 ` [PATCH v2 RESEND 12/23] lpfc: Use pci_enable_msix_range() instead of pci_enable_msix() Alexander Gordeev
                   ` (12 subsequent siblings)
  23 siblings, 0 replies; 85+ messages in thread
From: Alexander Gordeev @ 2014-07-16 18:05 UTC (permalink / raw)
  To: linux-kernel; +Cc: Alexander Gordeev, James Smart, linux-scsi, linux-pci

There is no need to call pci_disable_msix() in case
the previous call to pci_enable_msix() failed

Signed-off-by: Alexander Gordeev <agordeev@redhat.com>
Cc: James Smart <james.smart@emulex.com>
Cc: linux-scsi@vger.kernel.org
Cc: linux-pci@vger.kernel.org
Acked-by: James Smart <james.smart@emulex.com>
---
 drivers/scsi/lpfc/lpfc_init.c |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c
index 06f9a5b..a5769a9 100644
--- a/drivers/scsi/lpfc/lpfc_init.c
+++ b/drivers/scsi/lpfc/lpfc_init.c
@@ -8242,7 +8242,7 @@ lpfc_sli_enable_msix(struct lpfc_hba *phba)
 	if (rc) {
 		lpfc_printf_log(phba, KERN_INFO, LOG_INIT,
 				"0420 PCI enable MSI-X failed (%d)\n", rc);
-		goto msi_fail_out;
+		goto vec_fail_out;
 	}
 	for (i = 0; i < LPFC_MSIX_VECTORS; i++)
 		lpfc_printf_log(phba, KERN_INFO, LOG_INIT,
@@ -8320,6 +8320,8 @@ irq_fail_out:
 msi_fail_out:
 	/* Unconfigure MSI-X capability structure */
 	pci_disable_msix(phba->pcidev);
+
+vec_fail_out:
 	return rc;
 }
 
@@ -8812,7 +8814,7 @@ enable_msix_vectors:
 	} else if (rc) {
 		lpfc_printf_log(phba, KERN_INFO, LOG_INIT,
 				"0484 PCI enable MSI-X failed (%d)\n", rc);
-		goto msi_fail_out;
+		goto vec_fail_out;
 	}
 
 	/* Log MSI-X vector assignment */
@@ -8875,9 +8877,10 @@ cfg_fail_out:
 			 &phba->sli4_hba.fcp_eq_hdl[index]);
 	}
 
-msi_fail_out:
 	/* Unconfigure MSI-X capability structure */
 	pci_disable_msix(phba->pcidev);
+
+vec_fail_out:
 	return rc;
 }
 
-- 
1.7.7.6


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

* [PATCH v2 RESEND 12/23] lpfc: Use pci_enable_msix_range() instead of pci_enable_msix()
  2014-07-16 18:05 [PATCH v2 RESEND 00/23] scsi: Use pci_enable_msix_range() instead of pci_enable_msix() Alexander Gordeev
                   ` (10 preceding siblings ...)
  2014-07-16 18:05 ` [PATCH v2 RESEND 11/23] lpfc: Remove superfluous call to pci_disable_msix() Alexander Gordeev
@ 2014-07-16 18:05 ` Alexander Gordeev
  2014-07-26  8:22   ` Alexander Gordeev
  2014-07-16 18:05 ` [PATCH v2 RESEND 13/23] megaraid: Fail resume if MSI-X re-initialization failed Alexander Gordeev
                   ` (11 subsequent siblings)
  23 siblings, 1 reply; 85+ messages in thread
From: Alexander Gordeev @ 2014-07-16 18:05 UTC (permalink / raw)
  To: linux-kernel; +Cc: Alexander Gordeev, James Smart, linux-scsi, linux-pci

As result of deprecation of MSI-X/MSI enablement functions
pci_enable_msix() and pci_enable_msi_block() all drivers
using these two interfaces need to be updated to use the
new pci_enable_msi_range()  or pci_enable_msi_exact()
and pci_enable_msix_range() or pci_enable_msix_exact()
interfaces.

Signed-off-by: Alexander Gordeev <agordeev@redhat.com>
Cc: James Smart <james.smart@emulex.com>
Cc: linux-scsi@vger.kernel.org
Cc: linux-pci@vger.kernel.org
---
 drivers/scsi/lpfc/lpfc_init.c |   38 +++++++++++++++++---------------------
 1 files changed, 17 insertions(+), 21 deletions(-)

diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c
index a5769a9..d9caed9 100644
--- a/drivers/scsi/lpfc/lpfc_init.c
+++ b/drivers/scsi/lpfc/lpfc_init.c
@@ -8211,9 +8211,9 @@ lpfc_sli4_pci_mem_unset(struct lpfc_hba *phba)
  * @phba: pointer to lpfc hba data structure.
  *
  * This routine is invoked to enable the MSI-X interrupt vectors to device
- * with SLI-3 interface specs. The kernel function pci_enable_msix() is
- * called to enable the MSI-X vectors. Note that pci_enable_msix(), once
- * invoked, enables either all or nothing, depending on the current
+ * with SLI-3 interface specs. The kernel function pci_enable_msix_exact()
+ * is called to enable the MSI-X vectors. Note that pci_enable_msix_exact(),
+ * once invoked, enables either all or nothing, depending on the current
  * availability of PCI vector resources. The device driver is responsible
  * for calling the individual request_irq() to register each MSI-X vector
  * with a interrupt handler, which is done in this function. Note that
@@ -8237,8 +8237,8 @@ lpfc_sli_enable_msix(struct lpfc_hba *phba)
 		phba->msix_entries[i].entry = i;
 
 	/* Configure MSI-X capability structure */
-	rc = pci_enable_msix(phba->pcidev, phba->msix_entries,
-				ARRAY_SIZE(phba->msix_entries));
+	rc = pci_enable_msix_exact(phba->pcidev, phba->msix_entries,
+				   ARRAY_SIZE(phba->msix_entries));
 	if (rc) {
 		lpfc_printf_log(phba, KERN_INFO, LOG_INIT,
 				"0420 PCI enable MSI-X failed (%d)\n", rc);
@@ -8775,15 +8775,13 @@ out:
  * @phba: pointer to lpfc hba data structure.
  *
  * This routine is invoked to enable the MSI-X interrupt vectors to device
- * with SLI-4 interface spec. The kernel function pci_enable_msix() is called
- * to enable the MSI-X vectors. Note that pci_enable_msix(), once invoked,
- * enables either all or nothing, depending on the current availability of
- * PCI vector resources. The device driver is responsible for calling the
- * individual request_irq() to register each MSI-X vector with a interrupt
- * handler, which is done in this function. Note that later when device is
- * unloading, the driver should always call free_irq() on all MSI-X vectors
- * it has done request_irq() on before calling pci_disable_msix(). Failure
- * to do so results in a BUG_ON() and a device will be left with MSI-X
+ * with SLI-4 interface spec. The kernel function pci_enable_msix_range()
+ * is called to enable the MSI-X vectors. The device driver is responsible
+ * for calling the individual request_irq() to register each MSI-X vector
+ * with a interrupt handler, which is done in this function. Note that later
+ * when device is unloading, the driver should always call free_irq() on all
+ * MSI-X vectors it has done request_irq() on before calling pci_disable_msix()
+ * Failure to do so results in a BUG_ON() and a device will be left with MSI-X
  * enabled and leaks its vectors.
  *
  * Return codes
@@ -8805,18 +8803,16 @@ lpfc_sli4_enable_msix(struct lpfc_hba *phba)
 		phba->sli4_hba.msix_entries[index].entry = index;
 		vectors++;
 	}
-enable_msix_vectors:
-	rc = pci_enable_msix(phba->pcidev, phba->sli4_hba.msix_entries,
-			     vectors);
-	if (rc > 1) {
-		vectors = rc;
-		goto enable_msix_vectors;
-	} else if (rc) {
+
+	rc = pci_enable_msix_range(phba->pcidev, phba->sli4_hba.msix_entries,
+				   2, vectors);
+	if (rc < 0) {
 		lpfc_printf_log(phba, KERN_INFO, LOG_INIT,
 				"0484 PCI enable MSI-X failed (%d)\n", rc);
 		goto vec_fail_out;
 	}
 
+	vectors = rc;
 	/* Log MSI-X vector assignment */
 	for (index = 0; index < vectors; index++)
 		lpfc_printf_log(phba, KERN_INFO, LOG_INIT,
-- 
1.7.7.6


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

* [PATCH v2 RESEND 13/23] megaraid: Fail resume if MSI-X re-initialization failed
  2014-07-16 18:05 [PATCH v2 RESEND 00/23] scsi: Use pci_enable_msix_range() instead of pci_enable_msix() Alexander Gordeev
                   ` (11 preceding siblings ...)
  2014-07-16 18:05 ` [PATCH v2 RESEND 12/23] lpfc: Use pci_enable_msix_range() instead of pci_enable_msix() Alexander Gordeev
@ 2014-07-16 18:05 ` Alexander Gordeev
  2014-07-26  8:24   ` Alexander Gordeev
  2014-07-16 18:05 ` [PATCH v2 RESEND 14/23] megaraid: Use pci_enable_msix_range() instead of pci_enable_msix() Alexander Gordeev
                   ` (10 subsequent siblings)
  23 siblings, 1 reply; 85+ messages in thread
From: Alexander Gordeev @ 2014-07-16 18:05 UTC (permalink / raw)
  To: linux-kernel; +Cc: Alexander Gordeev

Currently the driver fails to analize MSI-X re-enablement
status on resuming and always assumes the success. This
update checks the MSI-X initialization result and fails
to resume if MSI-Xs re-enablement failed.

Signed-off-by: Alexander Gordeev <agordeev@redhat.com>
---
 drivers/scsi/megaraid/megaraid_sas_base.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c b/drivers/scsi/megaraid/megaraid_sas_base.c
index 112799b..ba06102 100644
--- a/drivers/scsi/megaraid/megaraid_sas_base.c
+++ b/drivers/scsi/megaraid/megaraid_sas_base.c
@@ -5134,9 +5134,10 @@ megasas_resume(struct pci_dev *pdev)
 		goto fail_ready_state;
 
 	/* Now re-enable MSI-X */
-	if (instance->msix_vectors)
-		pci_enable_msix(instance->pdev, instance->msixentry,
-				instance->msix_vectors);
+	if (instance->msix_vectors &&
+	    pci_enable_msix(instance->pdev, instance->msixentry,
+			    instance->msix_vectors))
+		goto fail_reenable_msix;
 
 	switch (instance->pdev->device) {
 	case PCI_DEVICE_ID_LSI_FUSION:
@@ -5245,6 +5246,7 @@ fail_init_mfi:
 
 fail_set_dma_mask:
 fail_ready_state:
+fail_reenable_msix:
 
 	pci_disable_device(pdev);
 
-- 
1.7.7.6


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

* [PATCH v2 RESEND 14/23] megaraid: Use pci_enable_msix_range() instead of pci_enable_msix()
  2014-07-16 18:05 [PATCH v2 RESEND 00/23] scsi: Use pci_enable_msix_range() instead of pci_enable_msix() Alexander Gordeev
                   ` (12 preceding siblings ...)
  2014-07-16 18:05 ` [PATCH v2 RESEND 13/23] megaraid: Fail resume if MSI-X re-initialization failed Alexander Gordeev
@ 2014-07-16 18:05 ` Alexander Gordeev
  2014-08-11  8:09   ` Alexander Gordeev
  2014-07-16 18:05 ` [PATCH v2 RESEND 15/23] mpt2sas: Use pci_enable_msix_exact() " Alexander Gordeev
                   ` (9 subsequent siblings)
  23 siblings, 1 reply; 85+ messages in thread
From: Alexander Gordeev @ 2014-07-16 18:05 UTC (permalink / raw)
  To: linux-kernel; +Cc: Alexander Gordeev, Neela Syam Kolli, linux-scsi, linux-pci

As result of deprecation of MSI-X/MSI enablement functions
pci_enable_msix() and pci_enable_msi_block() all drivers
using these two interfaces need to be updated to use the
new pci_enable_msi_range()  or pci_enable_msi_exact()
and pci_enable_msix_range() or pci_enable_msix_exact()
interfaces.

Signed-off-by: Alexander Gordeev <agordeev@redhat.com>
Cc: Neela Syam Kolli <megaraidlinux@lsi.com>
Cc: linux-scsi@vger.kernel.org
Cc: linux-pci@vger.kernel.org
---
 drivers/scsi/megaraid/megaraid_sas_base.c |   20 +++++++-------------
 1 files changed, 7 insertions(+), 13 deletions(-)

diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c b/drivers/scsi/megaraid/megaraid_sas_base.c
index ba06102..7a4e75e 100644
--- a/drivers/scsi/megaraid/megaraid_sas_base.c
+++ b/drivers/scsi/megaraid/megaraid_sas_base.c
@@ -4105,17 +4105,11 @@ static int megasas_init_fw(struct megasas_instance *instance)
 					     (unsigned int)num_online_cpus());
 		for (i = 0; i < instance->msix_vectors; i++)
 			instance->msixentry[i].entry = i;
-		i = pci_enable_msix(instance->pdev, instance->msixentry,
-				    instance->msix_vectors);
-		if (i >= 0) {
-			if (i) {
-				if (!pci_enable_msix(instance->pdev,
-						     instance->msixentry, i))
-					instance->msix_vectors = i;
-				else
-					instance->msix_vectors = 0;
-			}
-		} else
+		i = pci_enable_msix_range(instance->pdev, instance->msixentry,
+					  1, instance->msix_vectors);
+		if (i)
+			instance->msix_vectors = i;
+		else
 			instance->msix_vectors = 0;
 
 		dev_info(&instance->pdev->dev, "[scsi%d]: FW supports"
@@ -5135,8 +5129,8 @@ megasas_resume(struct pci_dev *pdev)
 
 	/* Now re-enable MSI-X */
 	if (instance->msix_vectors &&
-	    pci_enable_msix(instance->pdev, instance->msixentry,
-			    instance->msix_vectors))
+	    pci_enable_msix_exact(instance->pdev, instance->msixentry,
+				  instance->msix_vectors))
 		goto fail_reenable_msix;
 
 	switch (instance->pdev->device) {
-- 
1.7.7.6


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

* [PATCH v2 RESEND 15/23] mpt2sas: Use pci_enable_msix_exact() instead of pci_enable_msix()
  2014-07-16 18:05 [PATCH v2 RESEND 00/23] scsi: Use pci_enable_msix_range() instead of pci_enable_msix() Alexander Gordeev
                   ` (13 preceding siblings ...)
  2014-07-16 18:05 ` [PATCH v2 RESEND 14/23] megaraid: Use pci_enable_msix_range() instead of pci_enable_msix() Alexander Gordeev
@ 2014-07-16 18:05 ` Alexander Gordeev
  2014-07-26  8:26   ` Alexander Gordeev
  2014-08-11 13:07   ` Tomas Henzl
  2014-07-16 18:05 ` [PATCH v2 RESEND 16/23] mpt3sas: " Alexander Gordeev
                   ` (8 subsequent siblings)
  23 siblings, 2 replies; 85+ messages in thread
From: Alexander Gordeev @ 2014-07-16 18:05 UTC (permalink / raw)
  To: linux-kernel
  Cc: Alexander Gordeev, Nagalakshmi Nandigama, Sreekanth Reddy,
	support, DL-MPTFusionLinux, linux-scsi, linux-pci

As result of deprecation of MSI-X/MSI enablement functions
pci_enable_msix() and pci_enable_msi_block() all drivers
using these two interfaces need to be updated to use the
new pci_enable_msi_range()  or pci_enable_msi_exact()
and pci_enable_msix_range() or pci_enable_msix_exact()
interfaces.

Signed-off-by: Alexander Gordeev <agordeev@redhat.com>
Cc: Nagalakshmi Nandigama <Nagalakshmi.Nandigama@lsi.com>
Cc: Sreekanth Reddy <Sreekanth.Reddy@lsi.com>
Cc: support@lsi.com
Cc: DL-MPTFusionLinux@lsi.com
Cc: linux-scsi@vger.kernel.org
Cc: linux-pci@vger.kernel.org
---
 drivers/scsi/mpt2sas/mpt2sas_base.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/scsi/mpt2sas/mpt2sas_base.c b/drivers/scsi/mpt2sas/mpt2sas_base.c
index 8b88118..6aca369 100644
--- a/drivers/scsi/mpt2sas/mpt2sas_base.c
+++ b/drivers/scsi/mpt2sas/mpt2sas_base.c
@@ -1432,10 +1432,10 @@ _base_enable_msix(struct MPT2SAS_ADAPTER *ioc)
 	for (i = 0, a = entries; i < ioc->reply_queue_count; i++, a++)
 		a->entry = i;
 
-	r = pci_enable_msix(ioc->pdev, entries, ioc->reply_queue_count);
+	r = pci_enable_msix_exact(ioc->pdev, entries, ioc->reply_queue_count);
 	if (r) {
-		dfailprintk(ioc, printk(MPT2SAS_INFO_FMT "pci_enable_msix "
-		    "failed (r=%d) !!!\n", ioc->name, r));
+		dfailprintk(ioc, printk(MPT2SAS_INFO_FMT
+		    "pci_enable_msix_exact failed (r=%d) !!!\n", ioc->name, r));
 		kfree(entries);
 		goto try_ioapic;
 	}
-- 
1.7.7.6


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

* [PATCH v2 RESEND 16/23] mpt3sas: Use pci_enable_msix_exact() instead of pci_enable_msix()
  2014-07-16 18:05 [PATCH v2 RESEND 00/23] scsi: Use pci_enable_msix_range() instead of pci_enable_msix() Alexander Gordeev
                   ` (14 preceding siblings ...)
  2014-07-16 18:05 ` [PATCH v2 RESEND 15/23] mpt2sas: Use pci_enable_msix_exact() " Alexander Gordeev
@ 2014-07-16 18:05 ` Alexander Gordeev
  2014-08-11  8:13   ` Alexander Gordeev
  2014-08-11 13:07   ` Tomas Henzl
  2014-07-16 18:05 ` [PATCH v2 RESEND 17/23] pm8001: Fix invalid return when request_irq() failed Alexander Gordeev
                   ` (7 subsequent siblings)
  23 siblings, 2 replies; 85+ messages in thread
From: Alexander Gordeev @ 2014-07-16 18:05 UTC (permalink / raw)
  To: linux-kernel
  Cc: Alexander Gordeev, Nagalakshmi Nandigama, Sreekanth Reddy,
	support, DL-MPTFusionLinux, linux-scsi, linux-pci

As result of deprecation of MSI-X/MSI enablement functions
pci_enable_msix() and pci_enable_msi_block() all drivers
using these two interfaces need to be updated to use the
new pci_enable_msi_range()  or pci_enable_msi_exact()
and pci_enable_msix_range() or pci_enable_msix_exact()
interfaces.

Signed-off-by: Alexander Gordeev <agordeev@redhat.com>
Cc: Nagalakshmi Nandigama <Nagalakshmi.Nandigama@lsi.com>
Cc: Sreekanth Reddy <Sreekanth.Reddy@lsi.com>
Cc: support@lsi.com
Cc: DL-MPTFusionLinux@lsi.com
Cc: linux-scsi@vger.kernel.org
Cc: linux-pci@vger.kernel.org
---
 drivers/scsi/mpt3sas/mpt3sas_base.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/mpt3sas/mpt3sas_base.c b/drivers/scsi/mpt3sas/mpt3sas_base.c
index 0cf4f70..7b65ec2 100644
--- a/drivers/scsi/mpt3sas/mpt3sas_base.c
+++ b/drivers/scsi/mpt3sas/mpt3sas_base.c
@@ -1747,10 +1747,10 @@ _base_enable_msix(struct MPT3SAS_ADAPTER *ioc)
 	for (i = 0, a = entries; i < ioc->reply_queue_count; i++, a++)
 		a->entry = i;
 
-	r = pci_enable_msix(ioc->pdev, entries, ioc->reply_queue_count);
+	r = pci_enable_msix_exact(ioc->pdev, entries, ioc->reply_queue_count);
 	if (r) {
 		dfailprintk(ioc, pr_info(MPT3SAS_FMT
-			"pci_enable_msix failed (r=%d) !!!\n",
+			"pci_enable_msix_exact failed (r=%d) !!!\n",
 			ioc->name, r));
 		kfree(entries);
 		goto try_ioapic;
-- 
1.7.7.6


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

* [PATCH v2 RESEND 17/23] pm8001: Fix invalid return when request_irq() failed
  2014-07-16 18:05 [PATCH v2 RESEND 00/23] scsi: Use pci_enable_msix_range() instead of pci_enable_msix() Alexander Gordeev
                   ` (15 preceding siblings ...)
  2014-07-16 18:05 ` [PATCH v2 RESEND 16/23] mpt3sas: " Alexander Gordeev
@ 2014-07-16 18:05 ` Alexander Gordeev
  2014-07-29 13:13   ` Tomas Henzl
  2014-07-16 18:05 ` [PATCH v2 RESEND 18/23] pm8001: Use pci_enable_msix_exact() instead of pci_enable_msix() Alexander Gordeev
                   ` (6 subsequent siblings)
  23 siblings, 1 reply; 85+ messages in thread
From: Alexander Gordeev @ 2014-07-16 18:05 UTC (permalink / raw)
  To: linux-kernel
  Cc: Alexander Gordeev, xjtuwjp, lindar_liu, linux-scsi, linux-pci

When a call to request_irq() failed pm8001_setup_msix()
still returns the success. This udate fixes the described
misbehaviour.

Signed-off-by: Alexander Gordeev <agordeev@redhat.com>
Cc: xjtuwjp@gmail.com
Cc: lindar_liu@usish.com
Cc: linux-scsi@vger.kernel.org
Cc: linux-pci@vger.kernel.org
Acked-by: Jack Wang <xjtuwjp@gmail.com>
---
 drivers/scsi/pm8001/pm8001_init.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/pm8001/pm8001_init.c b/drivers/scsi/pm8001/pm8001_init.c
index e90c89f..e837ece 100644
--- a/drivers/scsi/pm8001/pm8001_init.c
+++ b/drivers/scsi/pm8001/pm8001_init.c
@@ -744,9 +744,10 @@ static u32 pm8001_setup_msix(struct pm8001_hba_info *pm8001_ha)
 			pm8001_ha->irq_vector[i].irq_id = i;
 			pm8001_ha->irq_vector[i].drv_inst = pm8001_ha;
 
-			if (request_irq(pm8001_ha->msix_entries[i].vector,
+			rc = request_irq(pm8001_ha->msix_entries[i].vector,
 				pm8001_interrupt_handler_msix, flag,
-				intr_drvname[i], &(pm8001_ha->irq_vector[i]))) {
+				intr_drvname[i], &(pm8001_ha->irq_vector[i]));
+			if (rc) {
 				for (j = 0; j < i; j++)
 					free_irq(
 					pm8001_ha->msix_entries[j].vector,
-- 
1.7.7.6


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

* [PATCH v2 RESEND 18/23] pm8001: Use pci_enable_msix_exact() instead of pci_enable_msix()
  2014-07-16 18:05 [PATCH v2 RESEND 00/23] scsi: Use pci_enable_msix_range() instead of pci_enable_msix() Alexander Gordeev
                   ` (16 preceding siblings ...)
  2014-07-16 18:05 ` [PATCH v2 RESEND 17/23] pm8001: Fix invalid return when request_irq() failed Alexander Gordeev
@ 2014-07-16 18:05 ` Alexander Gordeev
  2014-07-26  8:33   ` Alexander Gordeev
  2014-07-16 18:05 ` [PATCH v2 RESEND 19/23] pmcraid: Get rid of a redundant assignment Alexander Gordeev
                   ` (5 subsequent siblings)
  23 siblings, 1 reply; 85+ messages in thread
From: Alexander Gordeev @ 2014-07-16 18:05 UTC (permalink / raw)
  To: linux-kernel
  Cc: Alexander Gordeev, xjtuwjp, lindar_liu, linux-scsi, linux-pci

As result of deprecation of MSI-X/MSI enablement functions
pci_enable_msix() and pci_enable_msi_block() all drivers
using these two interfaces need to be updated to use the
new pci_enable_msi_range()  or pci_enable_msi_exact()
and pci_enable_msix_range() or pci_enable_msix_exact()
interfaces.

Signed-off-by: Alexander Gordeev <agordeev@redhat.com>
Cc: xjtuwjp@gmail.com
Cc: lindar_liu@usish.com
Cc: linux-scsi@vger.kernel.org
Cc: linux-pci@vger.kernel.org
---
 drivers/scsi/pm8001/pm8001_init.c |   39 +++++++++++++++++++------------------
 1 files changed, 20 insertions(+), 19 deletions(-)

diff --git a/drivers/scsi/pm8001/pm8001_init.c b/drivers/scsi/pm8001/pm8001_init.c
index e837ece..4057c24 100644
--- a/drivers/scsi/pm8001/pm8001_init.c
+++ b/drivers/scsi/pm8001/pm8001_init.c
@@ -729,34 +729,35 @@ static u32 pm8001_setup_msix(struct pm8001_hba_info *pm8001_ha)
 		sizeof(pm8001_ha->msix_entries[0]);
 	for (i = 0; i < max_entry ; i++)
 		pm8001_ha->msix_entries[i].entry = i;
-	rc = pci_enable_msix(pm8001_ha->pdev, pm8001_ha->msix_entries,
+	rc = pci_enable_msix_exact(pm8001_ha->pdev, pm8001_ha->msix_entries,
 		number_of_intr);
 	pm8001_ha->number_of_intr = number_of_intr;
-	if (!rc) {
-		PM8001_INIT_DBG(pm8001_ha, pm8001_printk(
-			"pci_enable_msix request ret:%d no of intr %d\n",
-					rc, pm8001_ha->number_of_intr));
+	if (rc)
+		return rc;
 
+	PM8001_INIT_DBG(pm8001_ha, pm8001_printk(
+		"pci_enable_msix_exact request ret:%d no of intr %d\n",
+				rc, pm8001_ha->number_of_intr));
 
-		for (i = 0; i < number_of_intr; i++) {
-			snprintf(intr_drvname[i], sizeof(intr_drvname[0]),
-					DRV_NAME"%d", i);
-			pm8001_ha->irq_vector[i].irq_id = i;
-			pm8001_ha->irq_vector[i].drv_inst = pm8001_ha;
+	for (i = 0; i < number_of_intr; i++) {
+		snprintf(intr_drvname[i], sizeof(intr_drvname[0]),
+				DRV_NAME"%d", i);
+		pm8001_ha->irq_vector[i].irq_id = i;
+		pm8001_ha->irq_vector[i].drv_inst = pm8001_ha;
 
-			rc = request_irq(pm8001_ha->msix_entries[i].vector,
-				pm8001_interrupt_handler_msix, flag,
-				intr_drvname[i], &(pm8001_ha->irq_vector[i]));
-			if (rc) {
-				for (j = 0; j < i; j++)
-					free_irq(
-					pm8001_ha->msix_entries[j].vector,
+		rc = request_irq(pm8001_ha->msix_entries[i].vector,
+			pm8001_interrupt_handler_msix, flag,
+			intr_drvname[i], &(pm8001_ha->irq_vector[i]));
+		if (rc) {
+			for (j = 0; j < i; j++) {
+				free_irq(pm8001_ha->msix_entries[j].vector,
 					&(pm8001_ha->irq_vector[i]));
-				pci_disable_msix(pm8001_ha->pdev);
-				break;
 			}
+			pci_disable_msix(pm8001_ha->pdev);
+			break;
 		}
 	}
+
 	return rc;
 }
 #endif
-- 
1.7.7.6


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

* [PATCH v2 RESEND 19/23] pmcraid: Get rid of a redundant assignment
  2014-07-16 18:05 [PATCH v2 RESEND 00/23] scsi: Use pci_enable_msix_range() instead of pci_enable_msix() Alexander Gordeev
                   ` (17 preceding siblings ...)
  2014-07-16 18:05 ` [PATCH v2 RESEND 18/23] pm8001: Use pci_enable_msix_exact() instead of pci_enable_msix() Alexander Gordeev
@ 2014-07-16 18:05 ` Alexander Gordeev
  2014-07-16 18:05 ` [PATCH v2 RESEND 20/23] pmcraid: Use pci_enable_msix_range() instead of pci_enable_msix() Alexander Gordeev
                   ` (4 subsequent siblings)
  23 siblings, 0 replies; 85+ messages in thread
From: Alexander Gordeev @ 2014-07-16 18:05 UTC (permalink / raw)
  To: linux-kernel; +Cc: Alexander Gordeev, Anil Ravindranath, linux-scsi, linux-pci

Signed-off-by: Alexander Gordeev <agordeev@redhat.com>
Cc: Anil Ravindranath <anil_ravindranath@pmc-sierra.com>
Cc: linux-scsi@vger.kernel.org
Cc: linux-pci@vger.kernel.org
---
 drivers/scsi/pmcraid.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/drivers/scsi/pmcraid.c b/drivers/scsi/pmcraid.c
index be8ce54..c06af7f 100644
--- a/drivers/scsi/pmcraid.c
+++ b/drivers/scsi/pmcraid.c
@@ -4746,7 +4746,6 @@ pmcraid_isr_legacy:
 	pinstance->hrrq_vector[0].drv_inst = pinstance;
 	pinstance->hrrq_vector[0].vector = pdev->irq;
 	pinstance->num_hrrq = 1;
-	rc = 0;
 
 	rc = request_irq(pdev->irq, pmcraid_isr, IRQF_SHARED,
 			 PMCRAID_DRIVER_NAME, &pinstance->hrrq_vector[0]);
-- 
1.7.7.6


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

* [PATCH v2 RESEND 20/23] pmcraid: Use pci_enable_msix_range() instead of pci_enable_msix()
  2014-07-16 18:05 [PATCH v2 RESEND 00/23] scsi: Use pci_enable_msix_range() instead of pci_enable_msix() Alexander Gordeev
                   ` (18 preceding siblings ...)
  2014-07-16 18:05 ` [PATCH v2 RESEND 19/23] pmcraid: Get rid of a redundant assignment Alexander Gordeev
@ 2014-07-16 18:05 ` Alexander Gordeev
  2014-07-26  8:37   ` Alexander Gordeev
  2014-08-11  7:44   ` Alexander Gordeev
  2014-07-16 18:05 ` [PATCH v2 RESEND 21/23] qla2xxx: " Alexander Gordeev
                   ` (3 subsequent siblings)
  23 siblings, 2 replies; 85+ messages in thread
From: Alexander Gordeev @ 2014-07-16 18:05 UTC (permalink / raw)
  To: linux-kernel; +Cc: Alexander Gordeev, Anil Ravindranath, linux-scsi, linux-pci

As result of deprecation of MSI-X/MSI enablement functions
pci_enable_msix() and pci_enable_msi_block() all drivers
using these two interfaces need to be updated to use the
new pci_enable_msi_range()  or pci_enable_msi_exact()
and pci_enable_msix_range() or pci_enable_msix_exact()
interfaces.

Signed-off-by: Alexander Gordeev <agordeev@redhat.com>
Cc: Anil Ravindranath <anil_ravindranath@pmc-sierra.com>
Cc: linux-scsi@vger.kernel.org
Cc: linux-pci@vger.kernel.org
---
 drivers/scsi/pmcraid.c |   13 ++-----------
 1 files changed, 2 insertions(+), 11 deletions(-)

diff --git a/drivers/scsi/pmcraid.c b/drivers/scsi/pmcraid.c
index c06af7f..6d0f208 100644
--- a/drivers/scsi/pmcraid.c
+++ b/drivers/scsi/pmcraid.c
@@ -4698,19 +4698,10 @@ pmcraid_register_interrupt_handler(struct pmcraid_instance *pinstance)
 		for (i = 0; i < PMCRAID_NUM_MSIX_VECTORS; i++)
 			entries[i].entry = i;
 
-		rc = pci_enable_msix(pdev, entries, num_hrrq);
-		if (rc < 0)
+		num_hrrq = pci_enable_msix_range(pdev, entries, 1, num_hrrq);
+		if (num_hrrq < 0)
 			goto pmcraid_isr_legacy;
 
-		/* Check how many MSIX vectors are allocated and register
-		 * msi-x handlers for each of them giving appropriate buffer
-		 */
-		if (rc > 0) {
-			num_hrrq = rc;
-			if (pci_enable_msix(pdev, entries, num_hrrq))
-				goto pmcraid_isr_legacy;
-		}
-
 		for (i = 0; i < num_hrrq; i++) {
 			pinstance->hrrq_vector[i].hrrq_id = i;
 			pinstance->hrrq_vector[i].drv_inst = pinstance;
-- 
1.7.7.6


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

* [PATCH v2 RESEND 21/23] qla2xxx: Use pci_enable_msix_range() instead of pci_enable_msix()
  2014-07-16 18:05 [PATCH v2 RESEND 00/23] scsi: Use pci_enable_msix_range() instead of pci_enable_msix() Alexander Gordeev
                   ` (19 preceding siblings ...)
  2014-07-16 18:05 ` [PATCH v2 RESEND 20/23] pmcraid: Use pci_enable_msix_range() instead of pci_enable_msix() Alexander Gordeev
@ 2014-07-16 18:05 ` Alexander Gordeev
  2014-07-26  8:40   ` Alexander Gordeev
  2014-08-11  8:57   ` Alexander Gordeev
  2014-07-16 18:05 ` [PATCH v2 RESEND 22/23] qla4xxx: Use pci_enable_msix_exact() " Alexander Gordeev
                   ` (2 subsequent siblings)
  23 siblings, 2 replies; 85+ messages in thread
From: Alexander Gordeev @ 2014-07-16 18:05 UTC (permalink / raw)
  To: linux-kernel; +Cc: Alexander Gordeev, qla2xxx-upstream, linux-scsi, linux-pci

As result of deprecation of MSI-X/MSI enablement functions
pci_enable_msix() and pci_enable_msi_block() all drivers
using these two interfaces need to be updated to use the
new pci_enable_msi_range()  or pci_enable_msi_exact()
and pci_enable_msix_range() or pci_enable_msix_exact()
interfaces.

Log message code 0x00c6 preserved, although it is reported
after successful call to pci_enable_msix_range(), not before
possibly unsuccessful call to pci_enable_msix(). Consumers
of the error code should not notice the difference.

Signed-off-by: Alexander Gordeev <agordeev@redhat.com>
Cc: qla2xxx-upstream@qlogic.com
Cc: linux-scsi@vger.kernel.org
Cc: linux-pci@vger.kernel.org
---
 drivers/scsi/qla2xxx/qla_isr.c |   27 +++++++++++----------------
 1 files changed, 11 insertions(+), 16 deletions(-)

diff --git a/drivers/scsi/qla2xxx/qla_isr.c b/drivers/scsi/qla2xxx/qla_isr.c
index a56825c..52d420f 100644
--- a/drivers/scsi/qla2xxx/qla_isr.c
+++ b/drivers/scsi/qla2xxx/qla_isr.c
@@ -2923,27 +2923,22 @@ qla24xx_enable_msix(struct qla_hw_data *ha, struct rsp_que *rsp)
 	for (i = 0; i < ha->msix_count; i++)
 		entries[i].entry = i;
 
-	ret = pci_enable_msix(ha->pdev, entries, ha->msix_count);
-	if (ret) {
-		if (ret < MIN_MSIX_COUNT)
-			goto msix_failed;
-
+	ret = pci_enable_msix_range(ha->pdev,
+				    entries, MIN_MSIX_COUNT, ha->msix_count);
+	if (ret < 0) {
+		ql_log(ql_log_fatal, vha, 0x00c7,
+		    "MSI-X: Failed to enable support, "
+		    "giving   up -- %d/%d.\n",
+		    ha->msix_count, ret);
+		goto msix_out;
+	} else if (ret < ha->msix_count) {
 		ql_log(ql_log_warn, vha, 0x00c6,
 		    "MSI-X: Failed to enable support "
 		    "-- %d/%d\n Retry with %d vectors.\n",
 		    ha->msix_count, ret, ret);
-		ha->msix_count = ret;
-		ret = pci_enable_msix(ha->pdev, entries, ha->msix_count);
-		if (ret) {
-msix_failed:
-			ql_log(ql_log_fatal, vha, 0x00c7,
-			    "MSI-X: Failed to enable support, "
-			    "giving   up -- %d/%d.\n",
-			    ha->msix_count, ret);
-			goto msix_out;
-		}
-		ha->max_rsp_queues = ha->msix_count - 1;
 	}
+	ha->msix_count = ret;
+	ha->max_rsp_queues = ha->msix_count - 1;
 	ha->msix_entries = kzalloc(sizeof(struct qla_msix_entry) *
 				ha->msix_count, GFP_KERNEL);
 	if (!ha->msix_entries) {
-- 
1.7.7.6


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

* [PATCH v2 RESEND 22/23] qla4xxx: Use pci_enable_msix_exact() instead of pci_enable_msix()
  2014-07-16 18:05 [PATCH v2 RESEND 00/23] scsi: Use pci_enable_msix_range() instead of pci_enable_msix() Alexander Gordeev
                   ` (20 preceding siblings ...)
  2014-07-16 18:05 ` [PATCH v2 RESEND 21/23] qla2xxx: " Alexander Gordeev
@ 2014-07-16 18:05 ` Alexander Gordeev
  2014-07-26  8:41   ` Alexander Gordeev
  2014-07-16 18:05 ` [PATCH v2 RESEND 23/23] vmw_pvscsi: " Alexander Gordeev
  2014-07-17 20:28 ` [PATCH v2 RESEND 00/23] scsi: Use pci_enable_msix_range() " Christoph Hellwig
  23 siblings, 1 reply; 85+ messages in thread
From: Alexander Gordeev @ 2014-07-16 18:05 UTC (permalink / raw)
  To: linux-kernel
  Cc: Alexander Gordeev, Vikas Chaudhary, iscsi-driver, linux-scsi, linux-pci

As result of deprecation of MSI-X/MSI enablement functions
pci_enable_msix() and pci_enable_msi_block() all drivers
using these two interfaces need to be updated to use the
new pci_enable_msi_range()  or pci_enable_msi_exact()
and pci_enable_msix_range() or pci_enable_msix_exact()
interfaces.

Signed-off-by: Alexander Gordeev <agordeev@redhat.com>
Cc: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Cc: iscsi-driver@qlogic.com
Cc: linux-scsi@vger.kernel.org
Cc: linux-pci@vger.kernel.org
Acked-By: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
---
 drivers/scsi/qla4xxx/ql4_nx.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/scsi/qla4xxx/ql4_nx.c b/drivers/scsi/qla4xxx/ql4_nx.c
index 9dbdb4b..7c33658 100644
--- a/drivers/scsi/qla4xxx/ql4_nx.c
+++ b/drivers/scsi/qla4xxx/ql4_nx.c
@@ -4221,7 +4221,7 @@ qla4_8xxx_enable_msix(struct scsi_qla_host *ha)
 	for (i = 0; i < QLA_MSIX_ENTRIES; i++)
 		entries[i].entry = qla4_8xxx_msix_entries[i].entry;
 
-	ret = pci_enable_msix(ha->pdev, entries, ARRAY_SIZE(entries));
+	ret = pci_enable_msix_exact(ha->pdev, entries, ARRAY_SIZE(entries));
 	if (ret) {
 		ql4_printk(KERN_WARNING, ha,
 		    "MSI-X: Failed to enable support -- %d/%d\n",
-- 
1.7.7.6


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

* [PATCH v2 RESEND 23/23] vmw_pvscsi: Use pci_enable_msix_exact() instead of pci_enable_msix()
  2014-07-16 18:05 [PATCH v2 RESEND 00/23] scsi: Use pci_enable_msix_range() instead of pci_enable_msix() Alexander Gordeev
                   ` (21 preceding siblings ...)
  2014-07-16 18:05 ` [PATCH v2 RESEND 22/23] qla4xxx: Use pci_enable_msix_exact() " Alexander Gordeev
@ 2014-07-16 18:05 ` Alexander Gordeev
  2014-07-16 18:23   ` Arvind Kumar
  2014-07-17 20:28 ` [PATCH v2 RESEND 00/23] scsi: Use pci_enable_msix_range() " Christoph Hellwig
  23 siblings, 1 reply; 85+ messages in thread
From: Alexander Gordeev @ 2014-07-16 18:05 UTC (permalink / raw)
  To: linux-kernel
  Cc: Alexander Gordeev, Arvind Kumar, pv-drivers, linux-scsi, linux-pci

As result of deprecation of MSI-X/MSI enablement functions
pci_enable_msix() and pci_enable_msi_block() all drivers
using these two interfaces need to be updated to use the
new pci_enable_msi_range()  or pci_enable_msi_exact()
and pci_enable_msix_range() or pci_enable_msix_exact()
interfaces.

Signed-off-by: Alexander Gordeev <agordeev@redhat.com>
Cc: Arvind Kumar <arvindkumar@vmware.com>
Cc: pv-drivers@vmware.com
Cc: linux-scsi@vger.kernel.org
Cc: linux-pci@vger.kernel.org
Acked-by: Arvind Kumar <arvindkumar@vmware.com>
---
 drivers/scsi/vmw_pvscsi.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/scsi/vmw_pvscsi.c b/drivers/scsi/vmw_pvscsi.c
index c88e146..598f65e 100644
--- a/drivers/scsi/vmw_pvscsi.c
+++ b/drivers/scsi/vmw_pvscsi.c
@@ -1194,7 +1194,7 @@ static int pvscsi_setup_msix(const struct pvscsi_adapter *adapter,
 	struct msix_entry entry = { 0, PVSCSI_VECTOR_COMPLETION };
 	int ret;
 
-	ret = pci_enable_msix(adapter->dev, &entry, 1);
+	ret = pci_enable_msix_exact(adapter->dev, &entry, 1);
 	if (ret)
 		return ret;
 
-- 
1.7.7.6


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

* RE: [PATCH v2 RESEND 23/23] vmw_pvscsi: Use pci_enable_msix_exact() instead of pci_enable_msix()
  2014-07-16 18:05 ` [PATCH v2 RESEND 23/23] vmw_pvscsi: " Alexander Gordeev
@ 2014-07-16 18:23   ` Arvind Kumar
  0 siblings, 0 replies; 85+ messages in thread
From: Arvind Kumar @ 2014-07-16 18:23 UTC (permalink / raw)
  To: Alexander Gordeev, linux-kernel; +Cc: pv-drivers, linux-scsi, linux-pci

Hi Alexander,

This looks fine to me.

Acked-by: Arvind Kumar <arvindkumar@vmware.com>

Thanks!
Arvind
________________________________________
From: Alexander Gordeev <agordeev@redhat.com>
Sent: Wednesday, July 16, 2014 11:05 AM
To: linux-kernel@vger.kernel.org
Cc: Alexander Gordeev; Arvind Kumar; pv-drivers@vmware.com; linux-scsi@vger.kernel.org; linux-pci@vger.kernel.org
Subject: [PATCH v2 RESEND 23/23] vmw_pvscsi: Use pci_enable_msix_exact() instead of pci_enable_msix()

As result of deprecation of MSI-X/MSI enablement functions
pci_enable_msix() and pci_enable_msi_block() all drivers
using these two interfaces need to be updated to use the
new pci_enable_msi_range()  or pci_enable_msi_exact()
and pci_enable_msix_range() or pci_enable_msix_exact()
interfaces.

Signed-off-by: Alexander Gordeev <agordeev@redhat.com>
Cc: Arvind Kumar <arvindkumar@vmware.com>
Cc: pv-drivers@vmware.com
Cc: linux-scsi@vger.kernel.org
Cc: linux-pci@vger.kernel.org
Acked-by: Arvind Kumar <arvindkumar@vmware.com>
---
 drivers/scsi/vmw_pvscsi.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/scsi/vmw_pvscsi.c b/drivers/scsi/vmw_pvscsi.c
index c88e146..598f65e 100644
--- a/drivers/scsi/vmw_pvscsi.c
+++ b/drivers/scsi/vmw_pvscsi.c
@@ -1194,7 +1194,7 @@ static int pvscsi_setup_msix(const struct pvscsi_adapter *adapter,
        struct msix_entry entry = { 0, PVSCSI_VECTOR_COMPLETION };
        int ret;

-       ret = pci_enable_msix(adapter->dev, &entry, 1);
+       ret = pci_enable_msix_exact(adapter->dev, &entry, 1);
        if (ret)
                return ret;

--
1.7.7.6

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

* Re: [PATCH v2 RESEND 00/23] scsi: Use pci_enable_msix_range() instead of pci_enable_msix()
  2014-07-16 18:05 [PATCH v2 RESEND 00/23] scsi: Use pci_enable_msix_range() instead of pci_enable_msix() Alexander Gordeev
                   ` (22 preceding siblings ...)
  2014-07-16 18:05 ` [PATCH v2 RESEND 23/23] vmw_pvscsi: " Alexander Gordeev
@ 2014-07-17 20:28 ` Christoph Hellwig
  2014-07-29 12:38   ` Christoph Hellwig
  23 siblings, 1 reply; 85+ messages in thread
From: Christoph Hellwig @ 2014-07-17 20:28 UTC (permalink / raw)
  To: Alexander Gordeev
  Cc: linux-kernel, iss_storagedev, intel-linux-scu, support,
	DL-MPTFusionLinux, qla2xxx-upstream, iscsi-driver, pv-drivers,
	linux-scsi, linux-pci

Can I get reviews for the patches still missing one, maybe from the
Distro folks?  I'd like to pull in the whole things in favor of cherry
picking the reviewed patches.

Thanks!


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

* Re: [PATCH v2 RESEND 01/23] be2iscsi: Use pci_enable_msix_exact() instead of pci_enable_msix()
  2014-07-16 18:05 ` [PATCH v2 RESEND 01/23] be2iscsi: Use pci_enable_msix_exact() " Alexander Gordeev
@ 2014-07-26  8:08   ` Alexander Gordeev
  2014-07-28 23:29     ` Jayamohan Kallickal
  0 siblings, 1 reply; 85+ messages in thread
From: Alexander Gordeev @ 2014-07-26  8:08 UTC (permalink / raw)
  To: linux-kernel, Jayamohan Kallickal

On Wed, Jul 16, 2014 at 08:05:05PM +0200, Alexander Gordeev wrote:
> As result of deprecation of MSI-X/MSI enablement functions
> pci_enable_msix() and pci_enable_msi_block() all drivers
> using these two interfaces need to be updated to use the
> new pci_enable_msi_range()  or pci_enable_msi_exact()
> and pci_enable_msix_range() or pci_enable_msix_exact()
> interfaces.

Hi Jayamohan,

Could you please review this patch?

Thanks!

> Signed-off-by: Alexander Gordeev <agordeev@redhat.com>
> ---
>  drivers/scsi/be2iscsi/be_main.c |    6 ++----
>  1 files changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/scsi/be2iscsi/be_main.c b/drivers/scsi/be2iscsi/be_main.c
> index 56467df..1f63169 100644
> --- a/drivers/scsi/be2iscsi/be_main.c
> +++ b/drivers/scsi/be2iscsi/be_main.c
> @@ -5278,12 +5278,10 @@ static void beiscsi_msix_enable(struct beiscsi_hba *phba)
>  	for (i = 0; i <= phba->num_cpus; i++)
>  		phba->msix_entries[i].entry = i;
>  
> -	status = pci_enable_msix(phba->pcidev, phba->msix_entries,
> -				 (phba->num_cpus + 1));
> +	status = pci_enable_msix_exact(phba->pcidev, phba->msix_entries,
> +				       phba->num_cpus + 1);
>  	if (!status)
>  		phba->msix_enabled = true;
> -
> -	return;
>  }
>  
>  static void be_eqd_update(struct beiscsi_hba *phba)
> -- 
> 1.7.7.6
> 

-- 
Regards,
Alexander Gordeev
agordeev@redhat.com

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

* Re: [PATCH v2 RESEND 05/23] csiostor: Remove superfluous call to pci_disable_msix()
  2014-07-16 18:05 ` [PATCH v2 RESEND 05/23] csiostor: Remove superfluous call to pci_disable_msix() Alexander Gordeev
@ 2014-07-26  8:13   ` Alexander Gordeev
  0 siblings, 0 replies; 85+ messages in thread
From: Alexander Gordeev @ 2014-07-26  8:13 UTC (permalink / raw)
  To: linux-kernel; +Cc: Naresh Kumar Inna, Arvind Bhushan, linux-scsi, linux-pci

On Wed, Jul 16, 2014 at 08:05:09PM +0200, Alexander Gordeev wrote:
> There is no need to call pci_disable_msix() in case
> the previous call to pci_enable_msix() failed

Hi Naresh, Arvind,

Could you please review csiostor patches in this series?

Thanks!

> Signed-off-by: Alexander Gordeev <agordeev@redhat.com>
> Cc: Naresh Kumar Inna <naresh@chelsio.com>
> Cc: Arvind Bhushan <arvindb@chelsio.com>
> Cc: linux-scsi@vger.kernel.org
> Cc: linux-pci@vger.kernel.org
> ---
>  drivers/scsi/csiostor/csio_isr.c |    4 +---
>  1 files changed, 1 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/scsi/csiostor/csio_isr.c b/drivers/scsi/csiostor/csio_isr.c
> index 7ee9777..91ba91d 100644
> --- a/drivers/scsi/csiostor/csio_isr.c
> +++ b/drivers/scsi/csiostor/csio_isr.c
> @@ -529,10 +529,8 @@ csio_enable_msix(struct csio_hw *hw)
>  			csio_reduce_sqsets(hw, cnt - extra);
>  		}
>  	} else {
> -		if (rv > 0) {
> -			pci_disable_msix(hw->pdev);
> +		if (rv > 0)
>  			csio_info(hw, "Not using MSI-X, remainder:%d\n", rv);
> -		}
>  
>  		kfree(entries);
>  		return -ENOMEM;
> -- 
> 1.7.7.6
> 

-- 
Regards,
Alexander Gordeev
agordeev@redhat.com

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

* Re: [PATCH v2 RESEND 07/23] fnic: Use pci_enable_msix_exact() instead of pci_enable_msix()
  2014-07-16 18:05 ` [PATCH v2 RESEND 07/23] fnic: Use pci_enable_msix_exact() " Alexander Gordeev
@ 2014-07-26  8:15   ` Alexander Gordeev
  2014-07-28  8:08     ` Suma Ramars (sramars)
  0 siblings, 1 reply; 85+ messages in thread
From: Alexander Gordeev @ 2014-07-26  8:15 UTC (permalink / raw)
  To: linux-kernel
  Cc: Hiral Patel, Suma Ramars, Brian Uchino, linux-scsi, linux-pci

On Wed, Jul 16, 2014 at 08:05:11PM +0200, Alexander Gordeev wrote:
> As result of deprecation of MSI-X/MSI enablement functions
> pci_enable_msix() and pci_enable_msi_block() all drivers
> using these two interfaces need to be updated to use the
> new pci_enable_msi_range()  or pci_enable_msi_exact()
> and pci_enable_msix_range() or pci_enable_msix_exact()
> interfaces.

Hi Hiral, Suma, Brian,

Could you please review this patch?

Thanks!

> Signed-off-by: Alexander Gordeev <agordeev@redhat.com>
> Cc: Hiral Patel <hiralpat@cisco.com>
> Cc: Suma Ramars <sramars@cisco.com>
> Cc: Brian Uchino <buchino@cisco.com>
> Cc: linux-scsi@vger.kernel.org
> Cc: linux-pci@vger.kernel.org
> ---
>  drivers/scsi/fnic/fnic_isr.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/scsi/fnic/fnic_isr.c b/drivers/scsi/fnic/fnic_isr.c
> index 7d9b54a..a0dd1b6 100644
> --- a/drivers/scsi/fnic/fnic_isr.c
> +++ b/drivers/scsi/fnic/fnic_isr.c
> @@ -257,8 +257,8 @@ int fnic_set_intr_mode(struct fnic *fnic)
>  	    fnic->raw_wq_count >= m &&
>  	    fnic->wq_copy_count >= o &&
>  	    fnic->cq_count >= n + m + o) {
> -		if (!pci_enable_msix(fnic->pdev, fnic->msix_entry,
> -				    n + m + o + 1)) {
> +		if (!pci_enable_msix_exact(fnic->pdev, fnic->msix_entry,
> +					   n + m + o + 1)) {
>  			fnic->rq_count = n;
>  			fnic->raw_wq_count = m;
>  			fnic->wq_copy_count = o;
> -- 
> 1.7.7.6
> 

-- 
Regards,
Alexander Gordeev
agordeev@redhat.com

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

* Re: [PATCH v2 RESEND 08/23] hpsa: Fallback to MSI rather than to INTx if MSI-X failed
  2014-07-16 18:05 ` [PATCH v2 RESEND 08/23] hpsa: Fallback to MSI rather than to INTx if MSI-X failed Alexander Gordeev
@ 2014-07-26  8:16   ` Alexander Gordeev
  2014-08-11  7:53     ` Alexander Gordeev
  2014-08-13 16:04   ` scameron
  1 sibling, 1 reply; 85+ messages in thread
From: Alexander Gordeev @ 2014-07-26  8:16 UTC (permalink / raw)
  To: linux-kernel; +Cc: Stephen M. Cameron, iss_storagedev, linux-scsi, linux-pci

On Wed, Jul 16, 2014 at 08:05:12PM +0200, Alexander Gordeev wrote:
> Currently the driver falls back to INTx mode when MSI-X
> initialization failed. This is a suboptimal behaviour
> for chips that also support MSI. This update changes that
> behaviour and falls back to MSI mode in case MSI-X mode
> initialization failed.

Hi Stephen,

Could you please reveiew hpsa patches in this series?

Thanks!

> Signed-off-by: Alexander Gordeev <agordeev@redhat.com>
> Cc: "Stephen M. Cameron" <scameron@beardog.cce.hp.com>
> Cc: iss_storagedev@hp.com
> Cc: linux-scsi@vger.kernel.org
> Cc: linux-pci@vger.kernel.org
> ---
>  drivers/scsi/hpsa.c |    1 -
>  1 files changed, 0 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c
> index 31184b3..648dec2 100644
> --- a/drivers/scsi/hpsa.c
> +++ b/drivers/scsi/hpsa.c
> @@ -6177,7 +6177,6 @@ static void hpsa_interrupt_mode(struct ctlr_info *h)
>  			dev_warn(&h->pdev->dev, "MSI-X init failed %d\n",
>  			       err);
>  			h->msix_vector = 0;
> -			goto default_int_mode;
>  		}
>  	}
>  	if (pci_find_capability(h->pdev, PCI_CAP_ID_MSI)) {
> -- 
> 1.7.7.6
> 

-- 
Regards,
Alexander Gordeev
agordeev@redhat.com

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

* Re: [PATCH v2 RESEND 12/23] lpfc: Use pci_enable_msix_range() instead of pci_enable_msix()
  2014-07-16 18:05 ` [PATCH v2 RESEND 12/23] lpfc: Use pci_enable_msix_range() instead of pci_enable_msix() Alexander Gordeev
@ 2014-07-26  8:22   ` Alexander Gordeev
  2014-08-11  8:01     ` Alexander Gordeev
  0 siblings, 1 reply; 85+ messages in thread
From: Alexander Gordeev @ 2014-07-26  8:22 UTC (permalink / raw)
  To: linux-kernel; +Cc: James Smart, linux-scsi, linux-pci

On Wed, Jul 16, 2014 at 08:05:16PM +0200, Alexander Gordeev wrote:
> As result of deprecation of MSI-X/MSI enablement functions
> pci_enable_msix() and pci_enable_msi_block() all drivers
> using these two interfaces need to be updated to use the
> new pci_enable_msi_range()  or pci_enable_msi_exact()
> and pci_enable_msix_range() or pci_enable_msix_exact()
> interfaces.

Hi James,

Could you please review this patch?

Thanks!

> Signed-off-by: Alexander Gordeev <agordeev@redhat.com>
> Cc: James Smart <james.smart@emulex.com>
> Cc: linux-scsi@vger.kernel.org
> Cc: linux-pci@vger.kernel.org
> ---
>  drivers/scsi/lpfc/lpfc_init.c |   38 +++++++++++++++++---------------------
>  1 files changed, 17 insertions(+), 21 deletions(-)
> 
> diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c
> index a5769a9..d9caed9 100644
> --- a/drivers/scsi/lpfc/lpfc_init.c
> +++ b/drivers/scsi/lpfc/lpfc_init.c
> @@ -8211,9 +8211,9 @@ lpfc_sli4_pci_mem_unset(struct lpfc_hba *phba)
>   * @phba: pointer to lpfc hba data structure.
>   *
>   * This routine is invoked to enable the MSI-X interrupt vectors to device
> - * with SLI-3 interface specs. The kernel function pci_enable_msix() is
> - * called to enable the MSI-X vectors. Note that pci_enable_msix(), once
> - * invoked, enables either all or nothing, depending on the current
> + * with SLI-3 interface specs. The kernel function pci_enable_msix_exact()
> + * is called to enable the MSI-X vectors. Note that pci_enable_msix_exact(),
> + * once invoked, enables either all or nothing, depending on the current
>   * availability of PCI vector resources. The device driver is responsible
>   * for calling the individual request_irq() to register each MSI-X vector
>   * with a interrupt handler, which is done in this function. Note that
> @@ -8237,8 +8237,8 @@ lpfc_sli_enable_msix(struct lpfc_hba *phba)
>  		phba->msix_entries[i].entry = i;
>  
>  	/* Configure MSI-X capability structure */
> -	rc = pci_enable_msix(phba->pcidev, phba->msix_entries,
> -				ARRAY_SIZE(phba->msix_entries));
> +	rc = pci_enable_msix_exact(phba->pcidev, phba->msix_entries,
> +				   ARRAY_SIZE(phba->msix_entries));
>  	if (rc) {
>  		lpfc_printf_log(phba, KERN_INFO, LOG_INIT,
>  				"0420 PCI enable MSI-X failed (%d)\n", rc);
> @@ -8775,15 +8775,13 @@ out:
>   * @phba: pointer to lpfc hba data structure.
>   *
>   * This routine is invoked to enable the MSI-X interrupt vectors to device
> - * with SLI-4 interface spec. The kernel function pci_enable_msix() is called
> - * to enable the MSI-X vectors. Note that pci_enable_msix(), once invoked,
> - * enables either all or nothing, depending on the current availability of
> - * PCI vector resources. The device driver is responsible for calling the
> - * individual request_irq() to register each MSI-X vector with a interrupt
> - * handler, which is done in this function. Note that later when device is
> - * unloading, the driver should always call free_irq() on all MSI-X vectors
> - * it has done request_irq() on before calling pci_disable_msix(). Failure
> - * to do so results in a BUG_ON() and a device will be left with MSI-X
> + * with SLI-4 interface spec. The kernel function pci_enable_msix_range()
> + * is called to enable the MSI-X vectors. The device driver is responsible
> + * for calling the individual request_irq() to register each MSI-X vector
> + * with a interrupt handler, which is done in this function. Note that later
> + * when device is unloading, the driver should always call free_irq() on all
> + * MSI-X vectors it has done request_irq() on before calling pci_disable_msix()
> + * Failure to do so results in a BUG_ON() and a device will be left with MSI-X
>   * enabled and leaks its vectors.
>   *
>   * Return codes
> @@ -8805,18 +8803,16 @@ lpfc_sli4_enable_msix(struct lpfc_hba *phba)
>  		phba->sli4_hba.msix_entries[index].entry = index;
>  		vectors++;
>  	}
> -enable_msix_vectors:
> -	rc = pci_enable_msix(phba->pcidev, phba->sli4_hba.msix_entries,
> -			     vectors);
> -	if (rc > 1) {
> -		vectors = rc;
> -		goto enable_msix_vectors;
> -	} else if (rc) {
> +
> +	rc = pci_enable_msix_range(phba->pcidev, phba->sli4_hba.msix_entries,
> +				   2, vectors);
> +	if (rc < 0) {
>  		lpfc_printf_log(phba, KERN_INFO, LOG_INIT,
>  				"0484 PCI enable MSI-X failed (%d)\n", rc);
>  		goto vec_fail_out;
>  	}
>  
> +	vectors = rc;
>  	/* Log MSI-X vector assignment */
>  	for (index = 0; index < vectors; index++)
>  		lpfc_printf_log(phba, KERN_INFO, LOG_INIT,
> -- 
> 1.7.7.6
> 

-- 
Regards,
Alexander Gordeev
agordeev@redhat.com

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

* Re: [PATCH v2 RESEND 13/23] megaraid: Fail resume if MSI-X re-initialization failed
  2014-07-16 18:05 ` [PATCH v2 RESEND 13/23] megaraid: Fail resume if MSI-X re-initialization failed Alexander Gordeev
@ 2014-07-26  8:24   ` Alexander Gordeev
  2014-07-28  5:56     ` Kashyap Desai
  0 siblings, 1 reply; 85+ messages in thread
From: Alexander Gordeev @ 2014-07-26  8:24 UTC (permalink / raw)
  To: linux-kernel, Neela Syam Kolli

On Wed, Jul 16, 2014 at 08:05:17PM +0200, Alexander Gordeev wrote:
> Currently the driver fails to analize MSI-X re-enablement
> status on resuming and always assumes the success. This
> update checks the MSI-X initialization result and fails
> to resume if MSI-Xs re-enablement failed.

Hi Neela,

Could you please review megaraid patches in this series?

Thanks!

> Signed-off-by: Alexander Gordeev <agordeev@redhat.com>
> ---
>  drivers/scsi/megaraid/megaraid_sas_base.c |    8 +++++---
>  1 files changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c b/drivers/scsi/megaraid/megaraid_sas_base.c
> index 112799b..ba06102 100644
> --- a/drivers/scsi/megaraid/megaraid_sas_base.c
> +++ b/drivers/scsi/megaraid/megaraid_sas_base.c
> @@ -5134,9 +5134,10 @@ megasas_resume(struct pci_dev *pdev)
>  		goto fail_ready_state;
>  
>  	/* Now re-enable MSI-X */
> -	if (instance->msix_vectors)
> -		pci_enable_msix(instance->pdev, instance->msixentry,
> -				instance->msix_vectors);
> +	if (instance->msix_vectors &&
> +	    pci_enable_msix(instance->pdev, instance->msixentry,
> +			    instance->msix_vectors))
> +		goto fail_reenable_msix;
>  
>  	switch (instance->pdev->device) {
>  	case PCI_DEVICE_ID_LSI_FUSION:
> @@ -5245,6 +5246,7 @@ fail_init_mfi:
>  
>  fail_set_dma_mask:
>  fail_ready_state:
> +fail_reenable_msix:
>  
>  	pci_disable_device(pdev);
>  
> -- 
> 1.7.7.6
> 

-- 
Regards,
Alexander Gordeev
agordeev@redhat.com

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

* Re: [PATCH v2 RESEND 15/23] mpt2sas: Use pci_enable_msix_exact() instead of pci_enable_msix()
  2014-07-16 18:05 ` [PATCH v2 RESEND 15/23] mpt2sas: Use pci_enable_msix_exact() " Alexander Gordeev
@ 2014-07-26  8:26   ` Alexander Gordeev
  2014-08-11 13:07   ` Tomas Henzl
  1 sibling, 0 replies; 85+ messages in thread
From: Alexander Gordeev @ 2014-07-26  8:26 UTC (permalink / raw)
  To: linux-kernel
  Cc: Nagalakshmi Nandigama, Sreekanth Reddy, support,
	DL-MPTFusionLinux, linux-scsi, linux-pci

On Wed, Jul 16, 2014 at 08:05:19PM +0200, Alexander Gordeev wrote:
> As result of deprecation of MSI-X/MSI enablement functions
> pci_enable_msix() and pci_enable_msi_block() all drivers
> using these two interfaces need to be updated to use the
> new pci_enable_msi_range()  or pci_enable_msi_exact()
> and pci_enable_msix_range() or pci_enable_msix_exact()
> interfaces.

Hi Nagalakshmi, Sreekanth,

Could you please review mpt patches in this series?

Thanks!

> Signed-off-by: Alexander Gordeev <agordeev@redhat.com>
> Cc: Nagalakshmi Nandigama <Nagalakshmi.Nandigama@lsi.com>
> Cc: Sreekanth Reddy <Sreekanth.Reddy@lsi.com>
> Cc: support@lsi.com
> Cc: DL-MPTFusionLinux@lsi.com
> Cc: linux-scsi@vger.kernel.org
> Cc: linux-pci@vger.kernel.org
> ---
>  drivers/scsi/mpt2sas/mpt2sas_base.c |    6 +++---
>  1 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/scsi/mpt2sas/mpt2sas_base.c b/drivers/scsi/mpt2sas/mpt2sas_base.c
> index 8b88118..6aca369 100644
> --- a/drivers/scsi/mpt2sas/mpt2sas_base.c
> +++ b/drivers/scsi/mpt2sas/mpt2sas_base.c
> @@ -1432,10 +1432,10 @@ _base_enable_msix(struct MPT2SAS_ADAPTER *ioc)
>  	for (i = 0, a = entries; i < ioc->reply_queue_count; i++, a++)
>  		a->entry = i;
>  
> -	r = pci_enable_msix(ioc->pdev, entries, ioc->reply_queue_count);
> +	r = pci_enable_msix_exact(ioc->pdev, entries, ioc->reply_queue_count);
>  	if (r) {
> -		dfailprintk(ioc, printk(MPT2SAS_INFO_FMT "pci_enable_msix "
> -		    "failed (r=%d) !!!\n", ioc->name, r));
> +		dfailprintk(ioc, printk(MPT2SAS_INFO_FMT
> +		    "pci_enable_msix_exact failed (r=%d) !!!\n", ioc->name, r));
>  		kfree(entries);
>  		goto try_ioapic;
>  	}
> -- 
> 1.7.7.6
> 

-- 
Regards,
Alexander Gordeev
agordeev@redhat.com

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

* Re: [PATCH v2 RESEND 18/23] pm8001: Use pci_enable_msix_exact() instead of pci_enable_msix()
  2014-07-16 18:05 ` [PATCH v2 RESEND 18/23] pm8001: Use pci_enable_msix_exact() instead of pci_enable_msix() Alexander Gordeev
@ 2014-07-26  8:33   ` Alexander Gordeev
  2014-07-27 10:29     ` Jack Wang
  0 siblings, 1 reply; 85+ messages in thread
From: Alexander Gordeev @ 2014-07-26  8:33 UTC (permalink / raw)
  To: linux-kernel; +Cc: xjtuwjp, lindar_liu, linux-scsi, linux-pci

On Wed, Jul 16, 2014 at 08:05:22PM +0200, Alexander Gordeev wrote:
> As result of deprecation of MSI-X/MSI enablement functions
> pci_enable_msix() and pci_enable_msi_block() all drivers
> using these two interfaces need to be updated to use the
> new pci_enable_msi_range()  or pci_enable_msi_exact()
> and pci_enable_msix_range() or pci_enable_msix_exact()
> interfaces.

Hi Jack, Lindar,

Could you please review this patch?

Thanks!

> Signed-off-by: Alexander Gordeev <agordeev@redhat.com>
> Cc: xjtuwjp@gmail.com
> Cc: lindar_liu@usish.com
> Cc: linux-scsi@vger.kernel.org
> Cc: linux-pci@vger.kernel.org
> ---
>  drivers/scsi/pm8001/pm8001_init.c |   39 +++++++++++++++++++------------------
>  1 files changed, 20 insertions(+), 19 deletions(-)
> 
> diff --git a/drivers/scsi/pm8001/pm8001_init.c b/drivers/scsi/pm8001/pm8001_init.c
> index e837ece..4057c24 100644
> --- a/drivers/scsi/pm8001/pm8001_init.c
> +++ b/drivers/scsi/pm8001/pm8001_init.c
> @@ -729,34 +729,35 @@ static u32 pm8001_setup_msix(struct pm8001_hba_info *pm8001_ha)
>  		sizeof(pm8001_ha->msix_entries[0]);
>  	for (i = 0; i < max_entry ; i++)
>  		pm8001_ha->msix_entries[i].entry = i;
> -	rc = pci_enable_msix(pm8001_ha->pdev, pm8001_ha->msix_entries,
> +	rc = pci_enable_msix_exact(pm8001_ha->pdev, pm8001_ha->msix_entries,
>  		number_of_intr);
>  	pm8001_ha->number_of_intr = number_of_intr;
> -	if (!rc) {
> -		PM8001_INIT_DBG(pm8001_ha, pm8001_printk(
> -			"pci_enable_msix request ret:%d no of intr %d\n",
> -					rc, pm8001_ha->number_of_intr));
> +	if (rc)
> +		return rc;
>  
> +	PM8001_INIT_DBG(pm8001_ha, pm8001_printk(
> +		"pci_enable_msix_exact request ret:%d no of intr %d\n",
> +				rc, pm8001_ha->number_of_intr));
>  
> -		for (i = 0; i < number_of_intr; i++) {
> -			snprintf(intr_drvname[i], sizeof(intr_drvname[0]),
> -					DRV_NAME"%d", i);
> -			pm8001_ha->irq_vector[i].irq_id = i;
> -			pm8001_ha->irq_vector[i].drv_inst = pm8001_ha;
> +	for (i = 0; i < number_of_intr; i++) {
> +		snprintf(intr_drvname[i], sizeof(intr_drvname[0]),
> +				DRV_NAME"%d", i);
> +		pm8001_ha->irq_vector[i].irq_id = i;
> +		pm8001_ha->irq_vector[i].drv_inst = pm8001_ha;
>  
> -			rc = request_irq(pm8001_ha->msix_entries[i].vector,
> -				pm8001_interrupt_handler_msix, flag,
> -				intr_drvname[i], &(pm8001_ha->irq_vector[i]));
> -			if (rc) {
> -				for (j = 0; j < i; j++)
> -					free_irq(
> -					pm8001_ha->msix_entries[j].vector,
> +		rc = request_irq(pm8001_ha->msix_entries[i].vector,
> +			pm8001_interrupt_handler_msix, flag,
> +			intr_drvname[i], &(pm8001_ha->irq_vector[i]));
> +		if (rc) {
> +			for (j = 0; j < i; j++) {
> +				free_irq(pm8001_ha->msix_entries[j].vector,
>  					&(pm8001_ha->irq_vector[i]));
> -				pci_disable_msix(pm8001_ha->pdev);
> -				break;
>  			}
> +			pci_disable_msix(pm8001_ha->pdev);
> +			break;
>  		}
>  	}
> +
>  	return rc;
>  }
>  #endif
> -- 
> 1.7.7.6
> 

-- 
Regards,
Alexander Gordeev
agordeev@redhat.com

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

* Re: [PATCH v2 RESEND 20/23] pmcraid: Use pci_enable_msix_range() instead of pci_enable_msix()
  2014-07-16 18:05 ` [PATCH v2 RESEND 20/23] pmcraid: Use pci_enable_msix_range() instead of pci_enable_msix() Alexander Gordeev
@ 2014-07-26  8:37   ` Alexander Gordeev
  2014-08-11  7:44   ` Alexander Gordeev
  1 sibling, 0 replies; 85+ messages in thread
From: Alexander Gordeev @ 2014-07-26  8:37 UTC (permalink / raw)
  To: linux-kernel; +Cc: Anil Ravindranath, linux-scsi, linux-pci

On Wed, Jul 16, 2014 at 08:05:24PM +0200, Alexander Gordeev wrote:
> As result of deprecation of MSI-X/MSI enablement functions
> pci_enable_msix() and pci_enable_msi_block() all drivers
> using these two interfaces need to be updated to use the
> new pci_enable_msi_range()  or pci_enable_msi_exact()
> and pci_enable_msix_range() or pci_enable_msix_exact()
> interfaces.

Hi Anil,

Could you please review pmcraid patches in this series?

Thanks!

> Signed-off-by: Alexander Gordeev <agordeev@redhat.com>
> Cc: Anil Ravindranath <anil_ravindranath@pmc-sierra.com>
> Cc: linux-scsi@vger.kernel.org
> Cc: linux-pci@vger.kernel.org
> ---
>  drivers/scsi/pmcraid.c |   13 ++-----------
>  1 files changed, 2 insertions(+), 11 deletions(-)
> 
> diff --git a/drivers/scsi/pmcraid.c b/drivers/scsi/pmcraid.c
> index c06af7f..6d0f208 100644
> --- a/drivers/scsi/pmcraid.c
> +++ b/drivers/scsi/pmcraid.c
> @@ -4698,19 +4698,10 @@ pmcraid_register_interrupt_handler(struct pmcraid_instance *pinstance)
>  		for (i = 0; i < PMCRAID_NUM_MSIX_VECTORS; i++)
>  			entries[i].entry = i;
>  
> -		rc = pci_enable_msix(pdev, entries, num_hrrq);
> -		if (rc < 0)
> +		num_hrrq = pci_enable_msix_range(pdev, entries, 1, num_hrrq);
> +		if (num_hrrq < 0)
>  			goto pmcraid_isr_legacy;
>  
> -		/* Check how many MSIX vectors are allocated and register
> -		 * msi-x handlers for each of them giving appropriate buffer
> -		 */
> -		if (rc > 0) {
> -			num_hrrq = rc;
> -			if (pci_enable_msix(pdev, entries, num_hrrq))
> -				goto pmcraid_isr_legacy;
> -		}
> -
>  		for (i = 0; i < num_hrrq; i++) {
>  			pinstance->hrrq_vector[i].hrrq_id = i;
>  			pinstance->hrrq_vector[i].drv_inst = pinstance;
> -- 
> 1.7.7.6
> 

-- 
Regards,
Alexander Gordeev
agordeev@redhat.com

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

* Re: [PATCH v2 RESEND 21/23] qla2xxx: Use pci_enable_msix_range() instead of pci_enable_msix()
  2014-07-16 18:05 ` [PATCH v2 RESEND 21/23] qla2xxx: " Alexander Gordeev
@ 2014-07-26  8:40   ` Alexander Gordeev
  2014-08-11  8:57   ` Alexander Gordeev
  1 sibling, 0 replies; 85+ messages in thread
From: Alexander Gordeev @ 2014-07-26  8:40 UTC (permalink / raw)
  To: linux-kernel; +Cc: qla2xxx-upstream, linux-scsi, linux-pci

On Wed, Jul 16, 2014 at 08:05:25PM +0200, Alexander Gordeev wrote:
> As result of deprecation of MSI-X/MSI enablement functions
> pci_enable_msix() and pci_enable_msi_block() all drivers
> using these two interfaces need to be updated to use the
> new pci_enable_msi_range()  or pci_enable_msi_exact()
> and pci_enable_msix_range() or pci_enable_msix_exact()
> interfaces.
> 
> Log message code 0x00c6 preserved, although it is reported
> after successful call to pci_enable_msix_range(), not before
> possibly unsuccessful call to pci_enable_msix(). Consumers
> of the error code should not notice the difference.

Hello,

Could someone review this patch, please?

Thanks!

> Signed-off-by: Alexander Gordeev <agordeev@redhat.com>
> Cc: qla2xxx-upstream@qlogic.com
> Cc: linux-scsi@vger.kernel.org
> Cc: linux-pci@vger.kernel.org
> ---
>  drivers/scsi/qla2xxx/qla_isr.c |   27 +++++++++++----------------
>  1 files changed, 11 insertions(+), 16 deletions(-)
> 
> diff --git a/drivers/scsi/qla2xxx/qla_isr.c b/drivers/scsi/qla2xxx/qla_isr.c
> index a56825c..52d420f 100644
> --- a/drivers/scsi/qla2xxx/qla_isr.c
> +++ b/drivers/scsi/qla2xxx/qla_isr.c
> @@ -2923,27 +2923,22 @@ qla24xx_enable_msix(struct qla_hw_data *ha, struct rsp_que *rsp)
>  	for (i = 0; i < ha->msix_count; i++)
>  		entries[i].entry = i;
>  
> -	ret = pci_enable_msix(ha->pdev, entries, ha->msix_count);
> -	if (ret) {
> -		if (ret < MIN_MSIX_COUNT)
> -			goto msix_failed;
> -
> +	ret = pci_enable_msix_range(ha->pdev,
> +				    entries, MIN_MSIX_COUNT, ha->msix_count);
> +	if (ret < 0) {
> +		ql_log(ql_log_fatal, vha, 0x00c7,
> +		    "MSI-X: Failed to enable support, "
> +		    "giving   up -- %d/%d.\n",
> +		    ha->msix_count, ret);
> +		goto msix_out;
> +	} else if (ret < ha->msix_count) {
>  		ql_log(ql_log_warn, vha, 0x00c6,
>  		    "MSI-X: Failed to enable support "
>  		    "-- %d/%d\n Retry with %d vectors.\n",
>  		    ha->msix_count, ret, ret);
> -		ha->msix_count = ret;
> -		ret = pci_enable_msix(ha->pdev, entries, ha->msix_count);
> -		if (ret) {
> -msix_failed:
> -			ql_log(ql_log_fatal, vha, 0x00c7,
> -			    "MSI-X: Failed to enable support, "
> -			    "giving   up -- %d/%d.\n",
> -			    ha->msix_count, ret);
> -			goto msix_out;
> -		}
> -		ha->max_rsp_queues = ha->msix_count - 1;
>  	}
> +	ha->msix_count = ret;
> +	ha->max_rsp_queues = ha->msix_count - 1;
>  	ha->msix_entries = kzalloc(sizeof(struct qla_msix_entry) *
>  				ha->msix_count, GFP_KERNEL);
>  	if (!ha->msix_entries) {
> -- 
> 1.7.7.6
> 

-- 
Regards,
Alexander Gordeev
agordeev@redhat.com

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

* Re: [PATCH v2 RESEND 22/23] qla4xxx: Use pci_enable_msix_exact() instead of pci_enable_msix()
  2014-07-16 18:05 ` [PATCH v2 RESEND 22/23] qla4xxx: Use pci_enable_msix_exact() " Alexander Gordeev
@ 2014-07-26  8:41   ` Alexander Gordeev
  2014-07-28 11:47       ` Vikas Chaudhary
  0 siblings, 1 reply; 85+ messages in thread
From: Alexander Gordeev @ 2014-07-26  8:41 UTC (permalink / raw)
  To: linux-kernel; +Cc: Vikas Chaudhary, iscsi-driver, linux-scsi, linux-pci

On Wed, Jul 16, 2014 at 08:05:26PM +0200, Alexander Gordeev wrote:
> As result of deprecation of MSI-X/MSI enablement functions
> pci_enable_msix() and pci_enable_msi_block() all drivers
> using these two interfaces need to be updated to use the
> new pci_enable_msi_range()  or pci_enable_msi_exact()
> and pci_enable_msix_range() or pci_enable_msix_exact()
> interfaces.

Hi Vikas,

Could you please reveiw this patch?

Thanks!

> Signed-off-by: Alexander Gordeev <agordeev@redhat.com>
> Cc: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
> Cc: iscsi-driver@qlogic.com
> Cc: linux-scsi@vger.kernel.org
> Cc: linux-pci@vger.kernel.org
> Acked-By: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
> ---
>  drivers/scsi/qla4xxx/ql4_nx.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/scsi/qla4xxx/ql4_nx.c b/drivers/scsi/qla4xxx/ql4_nx.c
> index 9dbdb4b..7c33658 100644
> --- a/drivers/scsi/qla4xxx/ql4_nx.c
> +++ b/drivers/scsi/qla4xxx/ql4_nx.c
> @@ -4221,7 +4221,7 @@ qla4_8xxx_enable_msix(struct scsi_qla_host *ha)
>  	for (i = 0; i < QLA_MSIX_ENTRIES; i++)
>  		entries[i].entry = qla4_8xxx_msix_entries[i].entry;
>  
> -	ret = pci_enable_msix(ha->pdev, entries, ARRAY_SIZE(entries));
> +	ret = pci_enable_msix_exact(ha->pdev, entries, ARRAY_SIZE(entries));
>  	if (ret) {
>  		ql4_printk(KERN_WARNING, ha,
>  		    "MSI-X: Failed to enable support -- %d/%d\n",
> -- 
> 1.7.7.6
> 

-- 
Regards,
Alexander Gordeev
agordeev@redhat.com

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

* Re: [PATCH v2 RESEND 18/23] pm8001: Use pci_enable_msix_exact() instead of pci_enable_msix()
  2014-07-26  8:33   ` Alexander Gordeev
@ 2014-07-27 10:29     ` Jack Wang
  0 siblings, 0 replies; 85+ messages in thread
From: Jack Wang @ 2014-07-27 10:29 UTC (permalink / raw)
  To: Alexander Gordeev; +Cc: linux-kernel, lindar_liu, linux-scsi, linux-pci

Hi Alex,

Looks Ok for me.
Please feel free to add my:
Reviewed-by: Jack Wang <xjtuwjp@gmail.com>

Thanks,
Jack

2014-07-26 10:33 GMT+02:00 Alexander Gordeev <agordeev@redhat.com>:
> On Wed, Jul 16, 2014 at 08:05:22PM +0200, Alexander Gordeev wrote:
>> As result of deprecation of MSI-X/MSI enablement functions
>> pci_enable_msix() and pci_enable_msi_block() all drivers
>> using these two interfaces need to be updated to use the
>> new pci_enable_msi_range()  or pci_enable_msi_exact()
>> and pci_enable_msix_range() or pci_enable_msix_exact()
>> interfaces.
>
> Hi Jack, Lindar,
>
> Could you please review this patch?
>
> Thanks!
>
>> Signed-off-by: Alexander Gordeev <agordeev@redhat.com>
>> Cc: xjtuwjp@gmail.com
>> Cc: lindar_liu@usish.com
>> Cc: linux-scsi@vger.kernel.org
>> Cc: linux-pci@vger.kernel.org
>> ---
>>  drivers/scsi/pm8001/pm8001_init.c |   39 +++++++++++++++++++------------------
>>  1 files changed, 20 insertions(+), 19 deletions(-)
>>
>> diff --git a/drivers/scsi/pm8001/pm8001_init.c b/drivers/scsi/pm8001/pm8001_init.c
>> index e837ece..4057c24 100644
>> --- a/drivers/scsi/pm8001/pm8001_init.c
>> +++ b/drivers/scsi/pm8001/pm8001_init.c
>> @@ -729,34 +729,35 @@ static u32 pm8001_setup_msix(struct pm8001_hba_info *pm8001_ha)
>>               sizeof(pm8001_ha->msix_entries[0]);
>>       for (i = 0; i < max_entry ; i++)
>>               pm8001_ha->msix_entries[i].entry = i;
>> -     rc = pci_enable_msix(pm8001_ha->pdev, pm8001_ha->msix_entries,
>> +     rc = pci_enable_msix_exact(pm8001_ha->pdev, pm8001_ha->msix_entries,
>>               number_of_intr);
>>       pm8001_ha->number_of_intr = number_of_intr;
>> -     if (!rc) {
>> -             PM8001_INIT_DBG(pm8001_ha, pm8001_printk(
>> -                     "pci_enable_msix request ret:%d no of intr %d\n",
>> -                                     rc, pm8001_ha->number_of_intr));
>> +     if (rc)
>> +             return rc;
>>
>> +     PM8001_INIT_DBG(pm8001_ha, pm8001_printk(
>> +             "pci_enable_msix_exact request ret:%d no of intr %d\n",
>> +                             rc, pm8001_ha->number_of_intr));
>>
>> -             for (i = 0; i < number_of_intr; i++) {
>> -                     snprintf(intr_drvname[i], sizeof(intr_drvname[0]),
>> -                                     DRV_NAME"%d", i);
>> -                     pm8001_ha->irq_vector[i].irq_id = i;
>> -                     pm8001_ha->irq_vector[i].drv_inst = pm8001_ha;
>> +     for (i = 0; i < number_of_intr; i++) {
>> +             snprintf(intr_drvname[i], sizeof(intr_drvname[0]),
>> +                             DRV_NAME"%d", i);
>> +             pm8001_ha->irq_vector[i].irq_id = i;
>> +             pm8001_ha->irq_vector[i].drv_inst = pm8001_ha;
>>
>> -                     rc = request_irq(pm8001_ha->msix_entries[i].vector,
>> -                             pm8001_interrupt_handler_msix, flag,
>> -                             intr_drvname[i], &(pm8001_ha->irq_vector[i]));
>> -                     if (rc) {
>> -                             for (j = 0; j < i; j++)
>> -                                     free_irq(
>> -                                     pm8001_ha->msix_entries[j].vector,
>> +             rc = request_irq(pm8001_ha->msix_entries[i].vector,
>> +                     pm8001_interrupt_handler_msix, flag,
>> +                     intr_drvname[i], &(pm8001_ha->irq_vector[i]));
>> +             if (rc) {
>> +                     for (j = 0; j < i; j++) {
>> +                             free_irq(pm8001_ha->msix_entries[j].vector,
>>                                       &(pm8001_ha->irq_vector[i]));
>> -                             pci_disable_msix(pm8001_ha->pdev);
>> -                             break;
>>                       }
>> +                     pci_disable_msix(pm8001_ha->pdev);
>> +                     break;
>>               }
>>       }
>> +
>>       return rc;
>>  }
>>  #endif
>> --
>> 1.7.7.6
>>
>
> --
> Regards,
> Alexander Gordeev
> agordeev@redhat.com

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

* RE: [PATCH v2 RESEND 13/23] megaraid: Fail resume if MSI-X re-initialization failed
  2014-07-26  8:24   ` Alexander Gordeev
@ 2014-07-28  5:56     ` Kashyap Desai
  2014-08-11  8:07       ` Alexander Gordeev
  0 siblings, 1 reply; 85+ messages in thread
From: Kashyap Desai @ 2014-07-28  5:56 UTC (permalink / raw)
  To: Alexander Gordeev, linux-kernel, Neela Syam Kolli

> -----Original Message-----
> From: Alexander Gordeev [mailto:agordeev@redhat.com]
> Sent: Saturday, July 26, 2014 1:54 PM
> To: linux-kernel@vger.kernel.org; Neela Syam Kolli
> Subject: Re: [PATCH v2 RESEND 13/23] megaraid: Fail resume if MSI-X re-
> initialization failed
>
> On Wed, Jul 16, 2014 at 08:05:17PM +0200, Alexander Gordeev wrote:
> > Currently the driver fails to analize MSI-X re-enablement status on
> > resuming and always assumes the success. This update checks the MSI-X
> > initialization result and fails to resume if MSI-Xs re-enablement
> > failed.
>
> Hi Neela,
>
> Could you please review megaraid patches in this series?
>
> Thanks!
Please consider this patch Acked by Me.

Acked-by: Kashyap Desai <Kashyap.desai@avagotech.com>

>
> > Signed-off-by: Alexander Gordeev <agordeev@redhat.com>
> > ---
> >  drivers/scsi/megaraid/megaraid_sas_base.c |    8 +++++---
> >  1 files changed, 5 insertions(+), 3 deletions(-)
> >
> > diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c
> > b/drivers/scsi/megaraid/megaraid_sas_base.c
> > index 112799b..ba06102 100644
> > --- a/drivers/scsi/megaraid/megaraid_sas_base.c
> > +++ b/drivers/scsi/megaraid/megaraid_sas_base.c
> > @@ -5134,9 +5134,10 @@ megasas_resume(struct pci_dev *pdev)
> >  		goto fail_ready_state;
> >
> >  	/* Now re-enable MSI-X */
> > -	if (instance->msix_vectors)
> > -		pci_enable_msix(instance->pdev, instance->msixentry,
> > -				instance->msix_vectors);
> > +	if (instance->msix_vectors &&
> > +	    pci_enable_msix(instance->pdev, instance->msixentry,
> > +			    instance->msix_vectors))
> > +		goto fail_reenable_msix;
> >
> >  	switch (instance->pdev->device) {
> >  	case PCI_DEVICE_ID_LSI_FUSION:
> > @@ -5245,6 +5246,7 @@ fail_init_mfi:
> >
> >  fail_set_dma_mask:
> >  fail_ready_state:
> > +fail_reenable_msix:
> >
> >  	pci_disable_device(pdev);
> >
> > --
> > 1.7.7.6
> >
>
> --
> Regards,
> Alexander Gordeev
> agordeev@redhat.com

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

* Re: [PATCH v2 RESEND 07/23] fnic: Use pci_enable_msix_exact() instead of pci_enable_msix()
  2014-07-26  8:15   ` Alexander Gordeev
@ 2014-07-28  8:08     ` Suma Ramars (sramars)
  0 siblings, 0 replies; 85+ messages in thread
From: Suma Ramars (sramars) @ 2014-07-28  8:08 UTC (permalink / raw)
  To: Alexander Gordeev, linux-kernel
  Cc: Hiral Patel, Brian Uchino (buchino), linux-scsi, linux-pci

Acked-by: "Suma Ramars (sramars)" <sramars@cisco.com>


On 26/07/14 1:45 pm, "Alexander Gordeev" <agordeev@redhat.com> wrote:

>On Wed, Jul 16, 2014 at 08:05:11PM +0200, Alexander Gordeev wrote:
>> As result of deprecation of MSI-X/MSI enablement functions
>> pci_enable_msix() and pci_enable_msi_block() all drivers
>> using these two interfaces need to be updated to use the
>> new pci_enable_msi_range()  or pci_enable_msi_exact()
>> and pci_enable_msix_range() or pci_enable_msix_exact()
>> interfaces.
>
>Hi Hiral, Suma, Brian,
>
>Could you please review this patch?
>
>Thanks!
>
>> Signed-off-by: Alexander Gordeev <agordeev@redhat.com>
>> Cc: Hiral Patel <hiralpat@cisco.com>
>> Cc: Suma Ramars <sramars@cisco.com>
>> Cc: Brian Uchino <buchino@cisco.com>
>> Cc: linux-scsi@vger.kernel.org
>> Cc: linux-pci@vger.kernel.org
>> ---
>>  drivers/scsi/fnic/fnic_isr.c |    4 ++--
>>  1 files changed, 2 insertions(+), 2 deletions(-)
>> 
>> diff --git a/drivers/scsi/fnic/fnic_isr.c b/drivers/scsi/fnic/fnic_isr.c
>> index 7d9b54a..a0dd1b6 100644
>> --- a/drivers/scsi/fnic/fnic_isr.c
>> +++ b/drivers/scsi/fnic/fnic_isr.c
>> @@ -257,8 +257,8 @@ int fnic_set_intr_mode(struct fnic *fnic)
>>  	    fnic->raw_wq_count >= m &&
>>  	    fnic->wq_copy_count >= o &&
>>  	    fnic->cq_count >= n + m + o) {
>> -		if (!pci_enable_msix(fnic->pdev, fnic->msix_entry,
>> -				    n + m + o + 1)) {
>> +		if (!pci_enable_msix_exact(fnic->pdev, fnic->msix_entry,
>> +					   n + m + o + 1)) {
>>  			fnic->rq_count = n;
>>  			fnic->raw_wq_count = m;
>>  			fnic->wq_copy_count = o;
>> -- 
>> 1.7.7.6
>> 
>
>-- 
>Regards,
>Alexander Gordeev
>agordeev@redhat.com


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

* Re: [PATCH v2 RESEND 22/23] qla4xxx: Use pci_enable_msix_exact() instead of pci_enable_msix()
  2014-07-26  8:41   ` Alexander Gordeev
@ 2014-07-28 11:47       ` Vikas Chaudhary
  0 siblings, 0 replies; 85+ messages in thread
From: Vikas Chaudhary @ 2014-07-28 11:47 UTC (permalink / raw)
  To: Alexander Gordeev, linux-kernel
  Cc: Dept-Eng iSCSI Driver, linux-scsi, linux-pci


Acked-By: Vikas Chaudhary <vikas.chaudhary@qlogic.com>



On 26/07/14 2:11 pm, "Alexander Gordeev" <agordeev@redhat.com> wrote:

>On Wed, Jul 16, 2014 at 08:05:26PM +0200, Alexander Gordeev wrote:
>> As result of deprecation of MSI-X/MSI enablement functions
>> pci_enable_msix() and pci_enable_msi_block() all drivers
>> using these two interfaces need to be updated to use the
>> new pci_enable_msi_range()  or pci_enable_msi_exact()
>> and pci_enable_msix_range() or pci_enable_msix_exact()
>> interfaces.
>
>Hi Vikas,
>
>Could you please reveiw this patch?
>
>Thanks!
>
>> Signed-off-by: Alexander Gordeev <agordeev@redhat.com>
>> Cc: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
>> Cc: iscsi-driver@qlogic.com
>> Cc: linux-scsi@vger.kernel.org
>> Cc: linux-pci@vger.kernel.org
>> Acked-By: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
>> ---
>>  drivers/scsi/qla4xxx/ql4_nx.c |    2 +-
>>  1 files changed, 1 insertions(+), 1 deletions(-)
>> 
>> diff --git a/drivers/scsi/qla4xxx/ql4_nx.c
>>b/drivers/scsi/qla4xxx/ql4_nx.c
>> index 9dbdb4b..7c33658 100644
>> --- a/drivers/scsi/qla4xxx/ql4_nx.c
>> +++ b/drivers/scsi/qla4xxx/ql4_nx.c
>> @@ -4221,7 +4221,7 @@ qla4_8xxx_enable_msix(struct scsi_qla_host *ha)
>>  	for (i = 0; i < QLA_MSIX_ENTRIES; i++)
>>  		entries[i].entry = qla4_8xxx_msix_entries[i].entry;
>>  
>> -	ret = pci_enable_msix(ha->pdev, entries, ARRAY_SIZE(entries));
>> +	ret = pci_enable_msix_exact(ha->pdev, entries, ARRAY_SIZE(entries));
>>  	if (ret) {
>>  		ql4_printk(KERN_WARNING, ha,
>>  		    "MSI-X: Failed to enable support -- %d/%d\n",
>> -- 
>> 1.7.7.6
>> 
>
>-- 
>Regards,
>Alexander Gordeev
>agordeev@redhat.com


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

* Re: [PATCH v2 RESEND 22/23] qla4xxx: Use pci_enable_msix_exact() instead of pci_enable_msix()
@ 2014-07-28 11:47       ` Vikas Chaudhary
  0 siblings, 0 replies; 85+ messages in thread
From: Vikas Chaudhary @ 2014-07-28 11:47 UTC (permalink / raw)
  To: Alexander Gordeev, linux-kernel
  Cc: Dept-Eng iSCSI Driver, linux-scsi, linux-pci

[-- Attachment #1: Type: text/plain, Size: 1703 bytes --]


Acked-By: Vikas Chaudhary <vikas.chaudhary@qlogic.com>



On 26/07/14 2:11 pm, "Alexander Gordeev" <agordeev@redhat.com> wrote:

>On Wed, Jul 16, 2014 at 08:05:26PM +0200, Alexander Gordeev wrote:
>> As result of deprecation of MSI-X/MSI enablement functions
>> pci_enable_msix() and pci_enable_msi_block() all drivers
>> using these two interfaces need to be updated to use the
>> new pci_enable_msi_range()  or pci_enable_msi_exact()
>> and pci_enable_msix_range() or pci_enable_msix_exact()
>> interfaces.
>
>Hi Vikas,
>
>Could you please reveiw this patch?
>
>Thanks!
>
>> Signed-off-by: Alexander Gordeev <agordeev@redhat.com>
>> Cc: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
>> Cc: iscsi-driver@qlogic.com
>> Cc: linux-scsi@vger.kernel.org
>> Cc: linux-pci@vger.kernel.org
>> Acked-By: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
>> ---
>>  drivers/scsi/qla4xxx/ql4_nx.c |    2 +-
>>  1 files changed, 1 insertions(+), 1 deletions(-)
>> 
>> diff --git a/drivers/scsi/qla4xxx/ql4_nx.c
>>b/drivers/scsi/qla4xxx/ql4_nx.c
>> index 9dbdb4b..7c33658 100644
>> --- a/drivers/scsi/qla4xxx/ql4_nx.c
>> +++ b/drivers/scsi/qla4xxx/ql4_nx.c
>> @@ -4221,7 +4221,7 @@ qla4_8xxx_enable_msix(struct scsi_qla_host *ha)
>>  	for (i = 0; i < QLA_MSIX_ENTRIES; i++)
>>  		entries[i].entry = qla4_8xxx_msix_entries[i].entry;
>>  
>> -	ret = pci_enable_msix(ha->pdev, entries, ARRAY_SIZE(entries));
>> +	ret = pci_enable_msix_exact(ha->pdev, entries, ARRAY_SIZE(entries));
>>  	if (ret) {
>>  		ql4_printk(KERN_WARNING, ha,
>>  		    "MSI-X: Failed to enable support -- %d/%d\n",
>> -- 
>> 1.7.7.6
>> 
>
>-- 
>Regards,
>Alexander Gordeev
>agordeev@redhat.com


[-- Attachment #2: winmail.dat --]
[-- Type: application/ms-tnef, Size: 5134 bytes --]

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

* RE: [PATCH v2 RESEND 01/23] be2iscsi: Use pci_enable_msix_exact() instead of pci_enable_msix()
  2014-07-26  8:08   ` Alexander Gordeev
@ 2014-07-28 23:29     ` Jayamohan Kallickal
  2014-08-11  7:34       ` Alexander Gordeev
  0 siblings, 1 reply; 85+ messages in thread
From: Jayamohan Kallickal @ 2014-07-28 23:29 UTC (permalink / raw)
  To: Alexander Gordeev, linux-kernel



-----Original Message-----
From: Alexander Gordeev [mailto:agordeev@redhat.com] 
Sent: Saturday, July 26, 2014 1:09 AM
To: linux-kernel@vger.kernel.org; Jayamohan Kallickal
Subject: Re: [PATCH v2 RESEND 01/23] be2iscsi: Use pci_enable_msix_exact() instead of pci_enable_msix()

On Wed, Jul 16, 2014 at 08:05:05PM +0200, Alexander Gordeev wrote:
> As result of deprecation of MSI-X/MSI enablement functions
> pci_enable_msix() and pci_enable_msi_block() all drivers using these 
> two interfaces need to be updated to use the new 
> pci_enable_msi_range()  or pci_enable_msi_exact() and 
> pci_enable_msix_range() or pci_enable_msix_exact() interfaces.

Hi Jayamohan,

Could you please review this patch?

Thanks!

> Signed-off-by: Alexander Gordeev <agordeev@redhat.com>
> ---
>  drivers/scsi/be2iscsi/be_main.c |    6 ++----
>  1 files changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/scsi/be2iscsi/be_main.c 
> b/drivers/scsi/be2iscsi/be_main.c index 56467df..1f63169 100644
> --- a/drivers/scsi/be2iscsi/be_main.c
> +++ b/drivers/scsi/be2iscsi/be_main.c
> @@ -5278,12 +5278,10 @@ static void beiscsi_msix_enable(struct beiscsi_hba *phba)
>  	for (i = 0; i <= phba->num_cpus; i++)
>  		phba->msix_entries[i].entry = i;
>  
> -	status = pci_enable_msix(phba->pcidev, phba->msix_entries,
> -				 (phba->num_cpus + 1));
> +	status = pci_enable_msix_exact(phba->pcidev, phba->msix_entries,
> +				       phba->num_cpus + 1);
>  	if (!status)
>  		phba->msix_enabled = true;
> -
> -	return;
>  }
>  
>  static void be_eqd_update(struct beiscsi_hba *phba)
> --
> 1.7.7.6
> 


Looks Good.

Acked-by:  Jayamohan Kallickal <jayamohan.kallickal@emulex.com>
--

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

* Re: [PATCH v2 RESEND 00/23] scsi: Use pci_enable_msix_range() instead of pci_enable_msix()
  2014-07-17 20:28 ` [PATCH v2 RESEND 00/23] scsi: Use pci_enable_msix_range() " Christoph Hellwig
@ 2014-07-29 12:38   ` Christoph Hellwig
  0 siblings, 0 replies; 85+ messages in thread
From: Christoph Hellwig @ 2014-07-29 12:38 UTC (permalink / raw)
  To: Alexander Gordeev
  Cc: linux-kernel, iss_storagedev, intel-linux-scu, support,
	DL-MPTFusionLinux, qla2xxx-upstream, iscsi-driver, pv-drivers,
	linux-scsi, linux-pci

On Thu, Jul 17, 2014 at 01:28:20PM -0700, Christoph Hellwig wrote:
> Can I get reviews for the patches still missing one, maybe from the
> Distro folks?  I'd like to pull in the whole things in favor of cherry
> picking the reviewed patches.

I've applied those few patches that did get a review to the
drivers-for-3.17 branch.   It still would be great if someone could help
reviewing the others.

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

* Re: [PATCH v2 RESEND 17/23] pm8001: Fix invalid return when request_irq() failed
  2014-07-16 18:05 ` [PATCH v2 RESEND 17/23] pm8001: Fix invalid return when request_irq() failed Alexander Gordeev
@ 2014-07-29 13:13   ` Tomas Henzl
  2014-07-29 13:20     ` Christoph Hellwig
  0 siblings, 1 reply; 85+ messages in thread
From: Tomas Henzl @ 2014-07-29 13:13 UTC (permalink / raw)
  To: Alexander Gordeev, linux-kernel
  Cc: xjtuwjp, lindar_liu, linux-scsi, linux-pci, Suresh Thiagarajan

Hi, 
patch looks good.

A correction in pm8001_request_irq might be added too to allow 
the INT-X path when pm8001_setup_msix fails, but that is not part 
of this fix.

Tomas

Reviewed-by: Tomas Henzl <thenzl@redhat.com>

On 07/16/2014 08:05 PM, Alexander Gordeev wrote:
> When a call to request_irq() failed pm8001_setup_msix()
> still returns the success. This udate fixes the described
> misbehaviour.
>
> Signed-off-by: Alexander Gordeev <agordeev@redhat.com>
> Cc: xjtuwjp@gmail.com
> Cc: lindar_liu@usish.com
> Cc: linux-scsi@vger.kernel.org
> Cc: linux-pci@vger.kernel.org
> Acked-by: Jack Wang <xjtuwjp@gmail.com>
> ---
>  drivers/scsi/pm8001/pm8001_init.c |    5 +++--
>  1 files changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/scsi/pm8001/pm8001_init.c b/drivers/scsi/pm8001/pm8001_init.c
> index e90c89f..e837ece 100644
> --- a/drivers/scsi/pm8001/pm8001_init.c
> +++ b/drivers/scsi/pm8001/pm8001_init.c
> @@ -744,9 +744,10 @@ static u32 pm8001_setup_msix(struct pm8001_hba_info *pm8001_ha)
>  			pm8001_ha->irq_vector[i].irq_id = i;
>  			pm8001_ha->irq_vector[i].drv_inst = pm8001_ha;
>  
> -			if (request_irq(pm8001_ha->msix_entries[i].vector,
> +			rc = request_irq(pm8001_ha->msix_entries[i].vector,
>  				pm8001_interrupt_handler_msix, flag,
> -				intr_drvname[i], &(pm8001_ha->irq_vector[i]))) {
> +				intr_drvname[i], &(pm8001_ha->irq_vector[i]));
> +			if (rc) {
>  				for (j = 0; j < i; j++)
>  					free_irq(
>  					pm8001_ha->msix_entries[j].vector,


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

* Re: [PATCH v2 RESEND 17/23] pm8001: Fix invalid return when request_irq() failed
  2014-07-29 13:13   ` Tomas Henzl
@ 2014-07-29 13:20     ` Christoph Hellwig
  2014-07-29 13:48       ` Tomas Henzl
  0 siblings, 1 reply; 85+ messages in thread
From: Christoph Hellwig @ 2014-07-29 13:20 UTC (permalink / raw)
  To: Tomas Henzl
  Cc: Alexander Gordeev, linux-kernel, xjtuwjp, lindar_liu, linux-scsi,
	linux-pci, Suresh Thiagarajan

On Tue, Jul 29, 2014 at 03:13:06PM +0200, Tomas Henzl wrote:
> Hi, 
> patch looks good.
> 
> A correction in pm8001_request_irq might be added too to allow 
> the INT-X path when pm8001_setup_msix fails, but that is not part 
> of this fix.


There's actually an equivalent fix already in through one of the
previous pm8001 updates, so I skipped this one even if it already had an
ACK.  The following pm8001 applied just fine, though.  Take a look, as
I've already pushed out the updated drivers branch.


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

* Re: [PATCH v2 RESEND 17/23] pm8001: Fix invalid return when request_irq() failed
  2014-07-29 13:20     ` Christoph Hellwig
@ 2014-07-29 13:48       ` Tomas Henzl
  2014-07-29 13:56         ` Christoph Hellwig
  0 siblings, 1 reply; 85+ messages in thread
From: Tomas Henzl @ 2014-07-29 13:48 UTC (permalink / raw)
  To: Christoph Hellwig
  Cc: Alexander Gordeev, linux-kernel, xjtuwjp, lindar_liu, linux-scsi,
	linux-pci, Suresh Thiagarajan

On 07/29/2014 03:20 PM, Christoph Hellwig wrote:
> On Tue, Jul 29, 2014 at 03:13:06PM +0200, Tomas Henzl wrote:
>> Hi, 
>> patch looks good.
>>
>> A correction in pm8001_request_irq might be added too to allow 
>> the INT-X path when pm8001_setup_msix fails, but that is not part 
>> of this fix.
>
> There's actually an equivalent fix already in through one of the
> previous pm8001 updates, so I skipped this one even if it already had an
> ACK.  The following pm8001 applied just fine, though.  Take a look, as
> I've already pushed out the updated drivers branch.

I'm a bit confused - you were not commenting my text above I think?

I see in drivers-for-3.17 this patch already applied 5607de7
but not yet the next one (18/23) which also has a review, is there another ack needed?

>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html


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

* Re: [PATCH v2 RESEND 17/23] pm8001: Fix invalid return when request_irq() failed
  2014-07-29 13:48       ` Tomas Henzl
@ 2014-07-29 13:56         ` Christoph Hellwig
  2014-07-29 14:15           ` Alexander Gordeev
  0 siblings, 1 reply; 85+ messages in thread
From: Christoph Hellwig @ 2014-07-29 13:56 UTC (permalink / raw)
  To: Tomas Henzl
  Cc: Alexander Gordeev, linux-kernel, xjtuwjp, lindar_liu, linux-scsi,
	linux-pci, Suresh Thiagarajan

On Tue, Jul 29, 2014 at 03:48:29PM +0200, Tomas Henzl wrote:
> I'm a bit confused - you were not commenting my text above I think?
> 
> I see in drivers-for-3.17 this patch already applied 5607de7
> but not yet the next one (18/23) which also has a review, is there another ack needed?

Looks like I got a bit confused due to a non-applying patch, but it
seems like the one that failed was the second one.  I'll look at it time
permitting, but if someone familar with pm8001 can fix the reject for me
that would help me greatly!


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

* Re: [PATCH v2 RESEND 17/23] pm8001: Fix invalid return when request_irq() failed
  2014-07-29 13:56         ` Christoph Hellwig
@ 2014-07-29 14:15           ` Alexander Gordeev
  2014-07-29 14:24             ` Christoph Hellwig
  0 siblings, 1 reply; 85+ messages in thread
From: Alexander Gordeev @ 2014-07-29 14:15 UTC (permalink / raw)
  To: Christoph Hellwig
  Cc: Tomas Henzl, linux-kernel, xjtuwjp, lindar_liu, linux-scsi,
	linux-pci, Suresh Thiagarajan

On Tue, Jul 29, 2014 at 06:56:41AM -0700, Christoph Hellwig wrote:
> On Tue, Jul 29, 2014 at 03:48:29PM +0200, Tomas Henzl wrote:
> > I'm a bit confused - you were not commenting my text above I think?
> > 
> > I see in drivers-for-3.17 this patch already applied 5607de7
> > but not yet the next one (18/23) which also has a review, is there another ack needed?
> 
> Looks like I got a bit confused due to a non-applying patch, but it
> seems like the one that failed was the second one.  I'll look at it time
> permitting, but if someone familar with pm8001 can fix the reject for me
> that would help me greatly!

Hmm.. 18/23 applies with a minor fuzz against
git://git.infradead.org/users/hch/scsi-queue.git drivers-for-3.17

-- 
Regards,
Alexander Gordeev
agordeev@redhat.com

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

* Re: [PATCH v2 RESEND 17/23] pm8001: Fix invalid return when request_irq() failed
  2014-07-29 14:15           ` Alexander Gordeev
@ 2014-07-29 14:24             ` Christoph Hellwig
  2014-08-11  8:14               ` Alexander Gordeev
  0 siblings, 1 reply; 85+ messages in thread
From: Christoph Hellwig @ 2014-07-29 14:24 UTC (permalink / raw)
  To: Alexander Gordeev
  Cc: Christoph Hellwig, Tomas Henzl, linux-kernel, xjtuwjp,
	lindar_liu, linux-scsi, linux-pci, Suresh Thiagarajan

On Tue, Jul 29, 2014 at 04:15:45PM +0200, Alexander Gordeev wrote:
> Hmm.. 18/23 applies with a minor fuzz against
> git://git.infradead.org/users/hch/scsi-queue.git drivers-for-3.17

Okay, it was just git-am being goofy then.  I'll take care of it.


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

* Re: [PATCH v2 RESEND 01/23] be2iscsi: Use pci_enable_msix_exact() instead of pci_enable_msix()
  2014-07-28 23:29     ` Jayamohan Kallickal
@ 2014-08-11  7:34       ` Alexander Gordeev
  0 siblings, 0 replies; 85+ messages in thread
From: Alexander Gordeev @ 2014-08-11  7:34 UTC (permalink / raw)
  To: Jayamohan Kallickal; +Cc: linux-kernel, Christoph Hellwig

On Mon, Jul 28, 2014 at 11:29:51PM +0000, Jayamohan Kallickal wrote:
> 
> 
> -----Original Message-----
> From: Alexander Gordeev [mailto:agordeev@redhat.com] 
> Sent: Saturday, July 26, 2014 1:09 AM
> To: linux-kernel@vger.kernel.org; Jayamohan Kallickal
> Subject: Re: [PATCH v2 RESEND 01/23] be2iscsi: Use pci_enable_msix_exact() instead of pci_enable_msix()
> 
> On Wed, Jul 16, 2014 at 08:05:05PM +0200, Alexander Gordeev wrote:
> > As result of deprecation of MSI-X/MSI enablement functions
> > pci_enable_msix() and pci_enable_msi_block() all drivers using these 
> > two interfaces need to be updated to use the new 
> > pci_enable_msi_range()  or pci_enable_msi_exact() and 
> > pci_enable_msix_range() or pci_enable_msix_exact() interfaces.
> 
> Hi Jayamohan,
> 
> Could you please review this patch?

Jayamohan?

> Thanks!
> 
> > Signed-off-by: Alexander Gordeev <agordeev@redhat.com>
> > ---
> >  drivers/scsi/be2iscsi/be_main.c |    6 ++----
> >  1 files changed, 2 insertions(+), 4 deletions(-)
> > 
> > diff --git a/drivers/scsi/be2iscsi/be_main.c 
> > b/drivers/scsi/be2iscsi/be_main.c index 56467df..1f63169 100644
> > --- a/drivers/scsi/be2iscsi/be_main.c
> > +++ b/drivers/scsi/be2iscsi/be_main.c
> > @@ -5278,12 +5278,10 @@ static void beiscsi_msix_enable(struct beiscsi_hba *phba)
> >  	for (i = 0; i <= phba->num_cpus; i++)
> >  		phba->msix_entries[i].entry = i;
> >  
> > -	status = pci_enable_msix(phba->pcidev, phba->msix_entries,
> > -				 (phba->num_cpus + 1));
> > +	status = pci_enable_msix_exact(phba->pcidev, phba->msix_entries,
> > +				       phba->num_cpus + 1);
> >  	if (!status)
> >  		phba->msix_enabled = true;
> > -
> > -	return;
> >  }
> >  
> >  static void be_eqd_update(struct beiscsi_hba *phba)
> > --
> > 1.7.7.6
> > 
> 
> 
> Looks Good.
> 
> Acked-by:  Jayamohan Kallickal <jayamohan.kallickal@emulex.com>
> --

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

* Re: [PATCH v2 RESEND 04/23] bfa: Use pci_enable_msix_exact() instead of pci_enable_msix()
  2014-07-16 18:05 ` [PATCH v2 RESEND 04/23] bfa: Use pci_enable_msix_exact() instead of pci_enable_msix() Alexander Gordeev
@ 2014-08-11  7:39   ` Alexander Gordeev
  2014-08-11 11:02       ` Anil Gurumurthy
  0 siblings, 1 reply; 85+ messages in thread
From: Alexander Gordeev @ 2014-08-11  7:39 UTC (permalink / raw)
  To: linux-kernel
  Cc: Anil Gurumurthy, Vijaya Mohan Guvva, linux-scsi, linux-pci,
	Anil Gurumurthy, Sudarsana Kalluru

On Wed, Jul 16, 2014 at 08:05:08PM +0200, Alexander Gordeev wrote:
> As result of deprecation of MSI-X/MSI enablement functions
> pci_enable_msix() and pci_enable_msi_block() all drivers
> using these two interfaces need to be updated to use the
> new pci_enable_msi_range()  or pci_enable_msi_exact()
> and pci_enable_msix_range() or pci_enable_msix_exact()
> interfaces.

Anil, Sudarsana,

Could you please review bfa patches in this series?

Thanks!

> Signed-off-by: Alexander Gordeev <agordeev@redhat.com>
> Cc: Anil Gurumurthy <agurumur@brocade.com>
> Cc: Vijaya Mohan Guvva <vmohan@brocade.com>
> Cc: linux-scsi@vger.kernel.org
> Cc: linux-pci@vger.kernel.org
> Acked-by: Anil Gurumurthy <anil.gurumurthy@qlogic.com>
> ---
>  drivers/scsi/bfa/bfad.c |   20 ++++++--------------
>  1 files changed, 6 insertions(+), 14 deletions(-)
> 
> diff --git a/drivers/scsi/bfa/bfad.c b/drivers/scsi/bfa/bfad.c
> index c18279f..e90a374 100644
> --- a/drivers/scsi/bfa/bfad.c
> +++ b/drivers/scsi/bfa/bfad.c
> @@ -1234,29 +1234,21 @@ bfad_setup_intr(struct bfad_s *bfad)
>  	if ((bfa_asic_id_ctc(pdev->device) && !msix_disable_ct) ||
>  	   (bfa_asic_id_cb(pdev->device) && !msix_disable_cb)) {
>  
> -		error = pci_enable_msix(bfad->pcidev, msix_entries, bfad->nvec);
> +		error = pci_enable_msix_exact(bfad->pcidev,
> +					      msix_entries, bfad->nvec);
>  		/* In CT1 & CT2, try to allocate just one vector */
> -		if (error > 0 && bfa_asic_id_ctc(pdev->device)) {
> +		if (error == -ENOSPC && bfa_asic_id_ctc(pdev->device)) {
>  			printk(KERN_WARNING "bfa %s: trying one msix "
>  			       "vector failed to allocate %d[%d]\n",
>  			       bfad->pci_name, bfad->nvec, error);
>  			bfad->nvec = 1;
> -			error = pci_enable_msix(bfad->pcidev,
> -						msix_entries, bfad->nvec);
> +			error = pci_enable_msix_exact(bfad->pcidev,
> +						      msix_entries, 1);
>  		}
>  
> -		/*
> -		 * Only error number of vector is available.
> -		 * We don't have a mechanism to map multiple
> -		 * interrupts into one vector, so even if we
> -		 * can try to request less vectors, we don't
> -		 * know how to associate interrupt events to
> -		 *  vectors. Linux doesn't duplicate vectors
> -		 * in the MSIX table for this case.
> -		 */
>  		if (error) {
>  			printk(KERN_WARNING "bfad%d: "
> -			       "pci_enable_msix failed (%d), "
> +			       "pci_enable_msix_exact failed (%d), "
>  			       "use line based.\n",
>  				bfad->inst_no, error);
>  			goto line_based;
> -- 
> 1.7.7.6
> 

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

* Re: [PATCH v2 RESEND 20/23] pmcraid: Use pci_enable_msix_range() instead of pci_enable_msix()
  2014-07-16 18:05 ` [PATCH v2 RESEND 20/23] pmcraid: Use pci_enable_msix_range() instead of pci_enable_msix() Alexander Gordeev
  2014-07-26  8:37   ` Alexander Gordeev
@ 2014-08-11  7:44   ` Alexander Gordeev
  1 sibling, 0 replies; 85+ messages in thread
From: Alexander Gordeev @ 2014-08-11  7:44 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: Anil Ravindranath, linux-scsi, linux-pci

On Wed, Jul 16, 2014 at 08:05:24PM +0200, Alexander Gordeev wrote:
> As result of deprecation of MSI-X/MSI enablement functions
> pci_enable_msix() and pci_enable_msi_block() all drivers
> using these two interfaces need to be updated to use the
> new pci_enable_msi_range()  or pci_enable_msi_exact()
> and pci_enable_msix_range() or pci_enable_msix_exact()
> interfaces.

Hi Christoph,

This device's maintainer mail <anil_ravindranath@pmc-sierra.com>
does not seem exist anymore.

> Signed-off-by: Alexander Gordeev <agordeev@redhat.com>
> Cc: Anil Ravindranath <anil_ravindranath@pmc-sierra.com>
> Cc: linux-scsi@vger.kernel.org
> Cc: linux-pci@vger.kernel.org
> ---
>  drivers/scsi/pmcraid.c |   13 ++-----------
>  1 files changed, 2 insertions(+), 11 deletions(-)
> 
> diff --git a/drivers/scsi/pmcraid.c b/drivers/scsi/pmcraid.c
> index c06af7f..6d0f208 100644
> --- a/drivers/scsi/pmcraid.c
> +++ b/drivers/scsi/pmcraid.c
> @@ -4698,19 +4698,10 @@ pmcraid_register_interrupt_handler(struct pmcraid_instance *pinstance)
>  		for (i = 0; i < PMCRAID_NUM_MSIX_VECTORS; i++)
>  			entries[i].entry = i;
>  
> -		rc = pci_enable_msix(pdev, entries, num_hrrq);
> -		if (rc < 0)
> +		num_hrrq = pci_enable_msix_range(pdev, entries, 1, num_hrrq);
> +		if (num_hrrq < 0)
>  			goto pmcraid_isr_legacy;
>  
> -		/* Check how many MSIX vectors are allocated and register
> -		 * msi-x handlers for each of them giving appropriate buffer
> -		 */
> -		if (rc > 0) {
> -			num_hrrq = rc;
> -			if (pci_enable_msix(pdev, entries, num_hrrq))
> -				goto pmcraid_isr_legacy;
> -		}
> -
>  		for (i = 0; i < num_hrrq; i++) {
>  			pinstance->hrrq_vector[i].hrrq_id = i;
>  			pinstance->hrrq_vector[i].drv_inst = pinstance;
> -- 
> 1.7.7.6
> 

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

* Re: [PATCH v2 RESEND 06/23] csiostor: Use pci_enable_msix_range() instead of pci_enable_msix()
  2014-07-16 18:05 ` [PATCH v2 RESEND 06/23] csiostor: Use pci_enable_msix_range() instead of pci_enable_msix() Alexander Gordeev
@ 2014-08-11  7:49   ` Alexander Gordeev
  0 siblings, 0 replies; 85+ messages in thread
From: Alexander Gordeev @ 2014-08-11  7:49 UTC (permalink / raw)
  To: linux-kernel, Christoph Hellwig
  Cc: Naresh Kumar Inna, Arvind Bhushan, linux-scsi, linux-pci

On Wed, Jul 16, 2014 at 08:05:10PM +0200, Alexander Gordeev wrote:
> As result of deprecation of MSI-X/MSI enablement functions
> pci_enable_msix() and pci_enable_msi_block() all drivers
> using these two interfaces need to be updated to use the
> new pci_enable_msi_range()  or pci_enable_msi_exact()
> and pci_enable_msix_range() or pci_enable_msix_exact()
> interfaces.

Christoph,

This driver does not have maintainers in Chelsio anymore.

> Signed-off-by: Alexander Gordeev <agordeev@redhat.com>
> Cc: Naresh Kumar Inna <naresh@chelsio.com>
> Cc: Arvind Bhushan <arvindb@chelsio.com>
> Cc: linux-scsi@vger.kernel.org
> Cc: linux-pci@vger.kernel.org
> ---
>  drivers/scsi/csiostor/csio_hw.h  |    2 +-
>  drivers/scsi/csiostor/csio_isr.c |   22 +++++++++-------------
>  2 files changed, 10 insertions(+), 14 deletions(-)
> 
> diff --git a/drivers/scsi/csiostor/csio_hw.h b/drivers/scsi/csiostor/csio_hw.h
> index 49b1daa..5db2d85 100644
> --- a/drivers/scsi/csiostor/csio_hw.h
> +++ b/drivers/scsi/csiostor/csio_hw.h
> @@ -94,7 +94,7 @@ enum {
>  };
>  
>  struct csio_msix_entries {
> -	unsigned short	vector;		/* Vector assigned by pci_enable_msix */
> +	unsigned short	vector;		/* Assigned MSI-X vector */
>  	void		*dev_id;	/* Priv object associated w/ this msix*/
>  	char		desc[24];	/* Description of this vector */
>  };
> diff --git a/drivers/scsi/csiostor/csio_isr.c b/drivers/scsi/csiostor/csio_isr.c
> index 91ba91d..a8c748a 100644
> --- a/drivers/scsi/csiostor/csio_isr.c
> +++ b/drivers/scsi/csiostor/csio_isr.c
> @@ -499,7 +499,7 @@ csio_reduce_sqsets(struct csio_hw *hw, int cnt)
>  static int
>  csio_enable_msix(struct csio_hw *hw)
>  {
> -	int rv, i, j, k, n, min, cnt;
> +	int i, j, k, n, min, cnt;
>  	struct csio_msix_entries *entryp;
>  	struct msix_entry *entries;
>  	int extra = CSIO_EXTRA_VECS;
> @@ -521,19 +521,15 @@ csio_enable_msix(struct csio_hw *hw)
>  
>  	csio_dbg(hw, "FW supp #niq:%d, trying %d msix's\n", hw->cfg_niq, cnt);
>  
> -	while ((rv = pci_enable_msix(hw->pdev, entries, cnt)) >= min)
> -		cnt = rv;
> -	if (!rv) {
> -		if (cnt < (hw->num_sqsets + extra)) {
> -			csio_dbg(hw, "Reducing sqsets to %d\n", cnt - extra);
> -			csio_reduce_sqsets(hw, cnt - extra);
> -		}
> -	} else {
> -		if (rv > 0)
> -			csio_info(hw, "Not using MSI-X, remainder:%d\n", rv);
> -
> +	cnt = pci_enable_msix_range(hw->pdev, entries, min, cnt);
> +	if (cnt < 0) {
>  		kfree(entries);
> -		return -ENOMEM;
> +		return cnt;
> +	}
> +
> +	if (cnt < (hw->num_sqsets + extra)) {
> +		csio_dbg(hw, "Reducing sqsets to %d\n", cnt - extra);
> +		csio_reduce_sqsets(hw, cnt - extra);
>  	}
>  
>  	/* Save off vectors */
> -- 
> 1.7.7.6
> 

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

* Re: [PATCH v2 RESEND 08/23] hpsa: Fallback to MSI rather than to INTx if MSI-X failed
  2014-07-26  8:16   ` Alexander Gordeev
@ 2014-08-11  7:53     ` Alexander Gordeev
  0 siblings, 0 replies; 85+ messages in thread
From: Alexander Gordeev @ 2014-08-11  7:53 UTC (permalink / raw)
  To: linux-kernel; +Cc: Stephen M. Cameron, iss_storagedev, linux-scsi, linux-pci

On Sat, Jul 26, 2014 at 09:16:47AM +0100, Alexander Gordeev wrote:
> On Wed, Jul 16, 2014 at 08:05:12PM +0200, Alexander Gordeev wrote:
> > Currently the driver falls back to INTx mode when MSI-X
> > initialization failed. This is a suboptimal behaviour
> > for chips that also support MSI. This update changes that
> > behaviour and falls back to MSI mode in case MSI-X mode
> > initialization failed.
> 
> Hi Stephen,
> 
> Could you please reveiew hpsa patches in this series?

Stephen?

> Thanks!
> 
> > Signed-off-by: Alexander Gordeev <agordeev@redhat.com>
> > Cc: "Stephen M. Cameron" <scameron@beardog.cce.hp.com>
> > Cc: iss_storagedev@hp.com
> > Cc: linux-scsi@vger.kernel.org
> > Cc: linux-pci@vger.kernel.org
> > ---
> >  drivers/scsi/hpsa.c |    1 -
> >  1 files changed, 0 insertions(+), 1 deletions(-)
> > 
> > diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c
> > index 31184b3..648dec2 100644
> > --- a/drivers/scsi/hpsa.c
> > +++ b/drivers/scsi/hpsa.c
> > @@ -6177,7 +6177,6 @@ static void hpsa_interrupt_mode(struct ctlr_info *h)
> >  			dev_warn(&h->pdev->dev, "MSI-X init failed %d\n",
> >  			       err);
> >  			h->msix_vector = 0;
> > -			goto default_int_mode;
> >  		}
> >  	}
> >  	if (pci_find_capability(h->pdev, PCI_CAP_ID_MSI)) {
> > -- 
> > 1.7.7.6
> > 
> 
> -- 
> Regards,
> Alexander Gordeev
> agordeev@redhat.com

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

* Re: [PATCH v2 RESEND 10/23] isci: Use pci_enable_msix_exact() instead of pci_enable_msix()
  2014-07-16 18:05 ` [PATCH v2 RESEND 10/23] isci: Use pci_enable_msix_exact() " Alexander Gordeev
@ 2014-08-11  7:57     ` Alexander Gordeev
       [not found]   ` <718e4066d6294033a7590659cf0f3c4d@fmsmsx106.amr.corp.intel.com>
  1 sibling, 0 replies; 85+ messages in thread
From: Alexander Gordeev @ 2014-08-11  7:57 UTC (permalink / raw)
  To: intel-linux-scu, Artur Paszkiewicz, Dave Jiang
  Cc: Lukasz Dorau, Maciej Patelczyk, intel-linux-scu, linux-scsi,
	linux-pci, Christoph Hellwig

On Wed, Jul 16, 2014 at 08:05:14PM +0200, Alexander Gordeev wrote:
> As result of deprecation of MSI-X/MSI enablement functions
> pci_enable_msix() and pci_enable_msi_block() all drivers
> using these two interfaces need to be updated to use the
> new pci_enable_msi_range()  or pci_enable_msi_exact()
> and pci_enable_msix_range() or pci_enable_msix_exact()
> interfaces.

Artur, Dave,

Could you please review isci patches in this series?

Thanks!

> Signed-off-by: Alexander Gordeev <agordeev@redhat.com>
> Cc: Lukasz Dorau <lukasz.dorau@intel.com>
> Cc: Maciej Patelczyk <maciej.patelczyk@intel.com>
> Cc: Dave Jiang <dave.jiang@intel.com>
> Cc: intel-linux-scu@intel.com
> Cc: linux-scsi@vger.kernel.org
> Cc: linux-pci@vger.kernel.org
> Acked-by: Artur Paszkiewicz <artur.paszkiewicz@intel.com>
> ---
>  drivers/scsi/isci/init.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/scsi/isci/init.c b/drivers/scsi/isci/init.c
> index 695b34e..4198e45 100644
> --- a/drivers/scsi/isci/init.c
> +++ b/drivers/scsi/isci/init.c
> @@ -356,7 +356,7 @@ static int isci_setup_interrupts(struct pci_dev *pdev)
>  	for (i = 0; i < num_msix; i++)
>  		pci_info->msix_entries[i].entry = i;
>  
> -	err = pci_enable_msix(pdev, pci_info->msix_entries, num_msix);
> +	err = pci_enable_msix_exact(pdev, pci_info->msix_entries, num_msix);
>  	if (err)
>  		goto intx;
>  
> -- 
> 1.7.7.6
> 

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

* Re: [PATCH v2 RESEND 10/23] isci: Use pci_enable_msix_exact() instead of pci_enable_msix()
@ 2014-08-11  7:57     ` Alexander Gordeev
  0 siblings, 0 replies; 85+ messages in thread
From: Alexander Gordeev @ 2014-08-11  7:57 UTC (permalink / raw)
  To: Artur Paszkiewicz, Dave Jiang
  Cc: Lukasz Dorau, Maciej Patelczyk, intel-linux-scu, linux-scsi,
	linux-pci, Christoph Hellwig

On Wed, Jul 16, 2014 at 08:05:14PM +0200, Alexander Gordeev wrote:
> As result of deprecation of MSI-X/MSI enablement functions
> pci_enable_msix() and pci_enable_msi_block() all drivers
> using these two interfaces need to be updated to use the
> new pci_enable_msi_range()  or pci_enable_msi_exact()
> and pci_enable_msix_range() or pci_enable_msix_exact()
> interfaces.

Artur, Dave,

Could you please review isci patches in this series?

Thanks!

> Signed-off-by: Alexander Gordeev <agordeev@redhat.com>
> Cc: Lukasz Dorau <lukasz.dorau@intel.com>
> Cc: Maciej Patelczyk <maciej.patelczyk@intel.com>
> Cc: Dave Jiang <dave.jiang@intel.com>
> Cc: intel-linux-scu@intel.com
> Cc: linux-scsi@vger.kernel.org
> Cc: linux-pci@vger.kernel.org
> Acked-by: Artur Paszkiewicz <artur.paszkiewicz@intel.com>
> ---
>  drivers/scsi/isci/init.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/scsi/isci/init.c b/drivers/scsi/isci/init.c
> index 695b34e..4198e45 100644
> --- a/drivers/scsi/isci/init.c
> +++ b/drivers/scsi/isci/init.c
> @@ -356,7 +356,7 @@ static int isci_setup_interrupts(struct pci_dev *pdev)
>  	for (i = 0; i < num_msix; i++)
>  		pci_info->msix_entries[i].entry = i;
>  
> -	err = pci_enable_msix(pdev, pci_info->msix_entries, num_msix);
> +	err = pci_enable_msix_exact(pdev, pci_info->msix_entries, num_msix);
>  	if (err)
>  		goto intx;
>  
> -- 
> 1.7.7.6
> 

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

* Re: [PATCH v2 RESEND 12/23] lpfc: Use pci_enable_msix_range() instead of pci_enable_msix()
  2014-07-26  8:22   ` Alexander Gordeev
@ 2014-08-11  8:01     ` Alexander Gordeev
  2014-08-11 17:14         ` James Smart
  0 siblings, 1 reply; 85+ messages in thread
From: Alexander Gordeev @ 2014-08-11  8:01 UTC (permalink / raw)
  To: James Smart; +Cc: linux-kernel, Christoph Hellwig, linux-scsi, linux-pci

On Sat, Jul 26, 2014 at 09:22:27AM +0100, Alexander Gordeev wrote:
> On Wed, Jul 16, 2014 at 08:05:16PM +0200, Alexander Gordeev wrote:
> > As result of deprecation of MSI-X/MSI enablement functions
> > pci_enable_msix() and pci_enable_msi_block() all drivers
> > using these two interfaces need to be updated to use the
> > new pci_enable_msi_range()  or pci_enable_msi_exact()
> > and pci_enable_msix_range() or pci_enable_msix_exact()
> > interfaces.
> 
> Hi James,
> 
> Could you please review this patch?

James?

> Thanks!
> 
> > Signed-off-by: Alexander Gordeev <agordeev@redhat.com>
> > Cc: James Smart <james.smart@emulex.com>
> > Cc: linux-scsi@vger.kernel.org
> > Cc: linux-pci@vger.kernel.org
> > ---
> >  drivers/scsi/lpfc/lpfc_init.c |   38 +++++++++++++++++---------------------
> >  1 files changed, 17 insertions(+), 21 deletions(-)
> > 
> > diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c
> > index a5769a9..d9caed9 100644
> > --- a/drivers/scsi/lpfc/lpfc_init.c
> > +++ b/drivers/scsi/lpfc/lpfc_init.c
> > @@ -8211,9 +8211,9 @@ lpfc_sli4_pci_mem_unset(struct lpfc_hba *phba)
> >   * @phba: pointer to lpfc hba data structure.
> >   *
> >   * This routine is invoked to enable the MSI-X interrupt vectors to device
> > - * with SLI-3 interface specs. The kernel function pci_enable_msix() is
> > - * called to enable the MSI-X vectors. Note that pci_enable_msix(), once
> > - * invoked, enables either all or nothing, depending on the current
> > + * with SLI-3 interface specs. The kernel function pci_enable_msix_exact()
> > + * is called to enable the MSI-X vectors. Note that pci_enable_msix_exact(),
> > + * once invoked, enables either all or nothing, depending on the current
> >   * availability of PCI vector resources. The device driver is responsible
> >   * for calling the individual request_irq() to register each MSI-X vector
> >   * with a interrupt handler, which is done in this function. Note that
> > @@ -8237,8 +8237,8 @@ lpfc_sli_enable_msix(struct lpfc_hba *phba)
> >  		phba->msix_entries[i].entry = i;
> >  
> >  	/* Configure MSI-X capability structure */
> > -	rc = pci_enable_msix(phba->pcidev, phba->msix_entries,
> > -				ARRAY_SIZE(phba->msix_entries));
> > +	rc = pci_enable_msix_exact(phba->pcidev, phba->msix_entries,
> > +				   ARRAY_SIZE(phba->msix_entries));
> >  	if (rc) {
> >  		lpfc_printf_log(phba, KERN_INFO, LOG_INIT,
> >  				"0420 PCI enable MSI-X failed (%d)\n", rc);
> > @@ -8775,15 +8775,13 @@ out:
> >   * @phba: pointer to lpfc hba data structure.
> >   *
> >   * This routine is invoked to enable the MSI-X interrupt vectors to device
> > - * with SLI-4 interface spec. The kernel function pci_enable_msix() is called
> > - * to enable the MSI-X vectors. Note that pci_enable_msix(), once invoked,
> > - * enables either all or nothing, depending on the current availability of
> > - * PCI vector resources. The device driver is responsible for calling the
> > - * individual request_irq() to register each MSI-X vector with a interrupt
> > - * handler, which is done in this function. Note that later when device is
> > - * unloading, the driver should always call free_irq() on all MSI-X vectors
> > - * it has done request_irq() on before calling pci_disable_msix(). Failure
> > - * to do so results in a BUG_ON() and a device will be left with MSI-X
> > + * with SLI-4 interface spec. The kernel function pci_enable_msix_range()
> > + * is called to enable the MSI-X vectors. The device driver is responsible
> > + * for calling the individual request_irq() to register each MSI-X vector
> > + * with a interrupt handler, which is done in this function. Note that later
> > + * when device is unloading, the driver should always call free_irq() on all
> > + * MSI-X vectors it has done request_irq() on before calling pci_disable_msix()
> > + * Failure to do so results in a BUG_ON() and a device will be left with MSI-X
> >   * enabled and leaks its vectors.
> >   *
> >   * Return codes
> > @@ -8805,18 +8803,16 @@ lpfc_sli4_enable_msix(struct lpfc_hba *phba)
> >  		phba->sli4_hba.msix_entries[index].entry = index;
> >  		vectors++;
> >  	}
> > -enable_msix_vectors:
> > -	rc = pci_enable_msix(phba->pcidev, phba->sli4_hba.msix_entries,
> > -			     vectors);
> > -	if (rc > 1) {
> > -		vectors = rc;
> > -		goto enable_msix_vectors;
> > -	} else if (rc) {
> > +
> > +	rc = pci_enable_msix_range(phba->pcidev, phba->sli4_hba.msix_entries,
> > +				   2, vectors);
> > +	if (rc < 0) {
> >  		lpfc_printf_log(phba, KERN_INFO, LOG_INIT,
> >  				"0484 PCI enable MSI-X failed (%d)\n", rc);
> >  		goto vec_fail_out;
> >  	}
> >  
> > +	vectors = rc;
> >  	/* Log MSI-X vector assignment */
> >  	for (index = 0; index < vectors; index++)
> >  		lpfc_printf_log(phba, KERN_INFO, LOG_INIT,
> > -- 
> > 1.7.7.6
> > 
> 
> -- 
> Regards,
> Alexander Gordeev
> agordeev@redhat.com

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

* Re: [PATCH v2 RESEND 13/23] megaraid: Fail resume if MSI-X re-initialization failed
  2014-07-28  5:56     ` Kashyap Desai
@ 2014-08-11  8:07       ` Alexander Gordeev
  0 siblings, 0 replies; 85+ messages in thread
From: Alexander Gordeev @ 2014-08-11  8:07 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: Kashyap Desai, linux-kernel, linux-scsi, linux-pci

On Mon, Jul 28, 2014 at 11:26:13AM +0530, Kashyap Desai wrote:
> > -----Original Message-----
> > From: Alexander Gordeev [mailto:agordeev@redhat.com]
> > Sent: Saturday, July 26, 2014 1:54 PM
> > To: linux-kernel@vger.kernel.org; Neela Syam Kolli
> > Subject: Re: [PATCH v2 RESEND 13/23] megaraid: Fail resume if MSI-X re-
> > initialization failed
> >
> > On Wed, Jul 16, 2014 at 08:05:17PM +0200, Alexander Gordeev wrote:
> > > Currently the driver fails to analize MSI-X re-enablement status on
> > > resuming and always assumes the success. This update checks the MSI-X
> > > initialization result and fails to resume if MSI-Xs re-enablement
> > > failed.
> >
> > Hi Neela,
> >
> > Could you please review megaraid patches in this series?
> >
> > Thanks!
> Please consider this patch Acked by Me.
> 
> Acked-by: Kashyap Desai <Kashyap.desai@avagotech.com>

Christoph,

I guess, this patch could be picked?

> >
> > > Signed-off-by: Alexander Gordeev <agordeev@redhat.com>
> > > ---
> > >  drivers/scsi/megaraid/megaraid_sas_base.c |    8 +++++---
> > >  1 files changed, 5 insertions(+), 3 deletions(-)
> > >
> > > diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c
> > > b/drivers/scsi/megaraid/megaraid_sas_base.c
> > > index 112799b..ba06102 100644
> > > --- a/drivers/scsi/megaraid/megaraid_sas_base.c
> > > +++ b/drivers/scsi/megaraid/megaraid_sas_base.c
> > > @@ -5134,9 +5134,10 @@ megasas_resume(struct pci_dev *pdev)
> > >  		goto fail_ready_state;
> > >
> > >  	/* Now re-enable MSI-X */
> > > -	if (instance->msix_vectors)
> > > -		pci_enable_msix(instance->pdev, instance->msixentry,
> > > -				instance->msix_vectors);
> > > +	if (instance->msix_vectors &&
> > > +	    pci_enable_msix(instance->pdev, instance->msixentry,
> > > +			    instance->msix_vectors))
> > > +		goto fail_reenable_msix;
> > >
> > >  	switch (instance->pdev->device) {
> > >  	case PCI_DEVICE_ID_LSI_FUSION:
> > > @@ -5245,6 +5246,7 @@ fail_init_mfi:
> > >
> > >  fail_set_dma_mask:
> > >  fail_ready_state:
> > > +fail_reenable_msix:
> > >
> > >  	pci_disable_device(pdev);
> > >
> > > --
> > > 1.7.7.6
> > >
> >
> > --
> > Regards,
> > Alexander Gordeev
> > agordeev@redhat.com

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

* Re: [PATCH v2 RESEND 14/23] megaraid: Use pci_enable_msix_range() instead of pci_enable_msix()
  2014-07-16 18:05 ` [PATCH v2 RESEND 14/23] megaraid: Use pci_enable_msix_range() instead of pci_enable_msix() Alexander Gordeev
@ 2014-08-11  8:09   ` Alexander Gordeev
  2014-08-11  8:29     ` Kashyap Desai
  0 siblings, 1 reply; 85+ messages in thread
From: Alexander Gordeev @ 2014-08-11  8:09 UTC (permalink / raw)
  To: Kashyap Desai, Neela Syam Kolli
  Cc: linux-scsi, linux-pci, linux-kernel, Christoph Hellwig

On Wed, Jul 16, 2014 at 08:05:18PM +0200, Alexander Gordeev wrote:
> As result of deprecation of MSI-X/MSI enablement functions
> pci_enable_msix() and pci_enable_msi_block() all drivers
> using these two interfaces need to be updated to use the
> new pci_enable_msi_range()  or pci_enable_msi_exact()
> and pci_enable_msix_range() or pci_enable_msix_exact()
> interfaces.

Kashyap, Neela,

Could you please reveiw this patch?

Thanks!

> Signed-off-by: Alexander Gordeev <agordeev@redhat.com>
> Cc: Neela Syam Kolli <megaraidlinux@lsi.com>
> Cc: linux-scsi@vger.kernel.org
> Cc: linux-pci@vger.kernel.org
> ---
>  drivers/scsi/megaraid/megaraid_sas_base.c |   20 +++++++-------------
>  1 files changed, 7 insertions(+), 13 deletions(-)
> 
> diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c b/drivers/scsi/megaraid/megaraid_sas_base.c
> index ba06102..7a4e75e 100644
> --- a/drivers/scsi/megaraid/megaraid_sas_base.c
> +++ b/drivers/scsi/megaraid/megaraid_sas_base.c
> @@ -4105,17 +4105,11 @@ static int megasas_init_fw(struct megasas_instance *instance)
>  					     (unsigned int)num_online_cpus());
>  		for (i = 0; i < instance->msix_vectors; i++)
>  			instance->msixentry[i].entry = i;
> -		i = pci_enable_msix(instance->pdev, instance->msixentry,
> -				    instance->msix_vectors);
> -		if (i >= 0) {
> -			if (i) {
> -				if (!pci_enable_msix(instance->pdev,
> -						     instance->msixentry, i))
> -					instance->msix_vectors = i;
> -				else
> -					instance->msix_vectors = 0;
> -			}
> -		} else
> +		i = pci_enable_msix_range(instance->pdev, instance->msixentry,
> +					  1, instance->msix_vectors);
> +		if (i)
> +			instance->msix_vectors = i;
> +		else
>  			instance->msix_vectors = 0;
>  
>  		dev_info(&instance->pdev->dev, "[scsi%d]: FW supports"
> @@ -5135,8 +5129,8 @@ megasas_resume(struct pci_dev *pdev)
>  
>  	/* Now re-enable MSI-X */
>  	if (instance->msix_vectors &&
> -	    pci_enable_msix(instance->pdev, instance->msixentry,
> -			    instance->msix_vectors))
> +	    pci_enable_msix_exact(instance->pdev, instance->msixentry,
> +				  instance->msix_vectors))
>  		goto fail_reenable_msix;
>  
>  	switch (instance->pdev->device) {
> -- 
> 1.7.7.6
> 

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

* Re: [PATCH v2 RESEND 16/23] mpt3sas: Use pci_enable_msix_exact() instead of pci_enable_msix()
  2014-07-16 18:05 ` [PATCH v2 RESEND 16/23] mpt3sas: " Alexander Gordeev
@ 2014-08-11  8:13   ` Alexander Gordeev
  2014-08-11 13:07   ` Tomas Henzl
  1 sibling, 0 replies; 85+ messages in thread
From: Alexander Gordeev @ 2014-08-11  8:13 UTC (permalink / raw)
  To: Nagalakshmi Nandigama, Praveen Krishnamoorthy, Sreekanth Reddy,
	Abhijit Mahajan, MPT-FusionLinux.pdl
  Cc: linux-scsi, linux-pci, linux-kernel, Christoph Hellwig

On Wed, Jul 16, 2014 at 08:05:20PM +0200, Alexander Gordeev wrote:
> As result of deprecation of MSI-X/MSI enablement functions
> pci_enable_msix() and pci_enable_msi_block() all drivers
> using these two interfaces need to be updated to use the
> new pci_enable_msi_range()  or pci_enable_msi_exact()
> and pci_enable_msix_range() or pci_enable_msix_exact()
> interfaces.

Hi Nagalakshmi, Praveen, Sreekanth and Abhijit,

Could you please review mpt2/mpt3 patches in this series?

Thanks!

> Signed-off-by: Alexander Gordeev <agordeev@redhat.com>
> Cc: Nagalakshmi Nandigama <Nagalakshmi.Nandigama@lsi.com>
> Cc: Sreekanth Reddy <Sreekanth.Reddy@lsi.com>
> Cc: support@lsi.com
> Cc: DL-MPTFusionLinux@lsi.com
> Cc: linux-scsi@vger.kernel.org
> Cc: linux-pci@vger.kernel.org
> ---
>  drivers/scsi/mpt3sas/mpt3sas_base.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/scsi/mpt3sas/mpt3sas_base.c b/drivers/scsi/mpt3sas/mpt3sas_base.c
> index 0cf4f70..7b65ec2 100644
> --- a/drivers/scsi/mpt3sas/mpt3sas_base.c
> +++ b/drivers/scsi/mpt3sas/mpt3sas_base.c
> @@ -1747,10 +1747,10 @@ _base_enable_msix(struct MPT3SAS_ADAPTER *ioc)
>  	for (i = 0, a = entries; i < ioc->reply_queue_count; i++, a++)
>  		a->entry = i;
>  
> -	r = pci_enable_msix(ioc->pdev, entries, ioc->reply_queue_count);
> +	r = pci_enable_msix_exact(ioc->pdev, entries, ioc->reply_queue_count);
>  	if (r) {
>  		dfailprintk(ioc, pr_info(MPT3SAS_FMT
> -			"pci_enable_msix failed (r=%d) !!!\n",
> +			"pci_enable_msix_exact failed (r=%d) !!!\n",
>  			ioc->name, r));
>  		kfree(entries);
>  		goto try_ioapic;
> -- 
> 1.7.7.6
> 

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

* Re: [PATCH v2 RESEND 17/23] pm8001: Fix invalid return when request_irq() failed
  2014-07-29 14:24             ` Christoph Hellwig
@ 2014-08-11  8:14               ` Alexander Gordeev
  0 siblings, 0 replies; 85+ messages in thread
From: Alexander Gordeev @ 2014-08-11  8:14 UTC (permalink / raw)
  To: Christoph Hellwig
  Cc: Tomas Henzl, linux-kernel, xjtuwjp, lindar_liu, linux-scsi,
	linux-pci, Suresh Thiagarajan

On Tue, Jul 29, 2014 at 07:24:03AM -0700, Christoph Hellwig wrote:
> On Tue, Jul 29, 2014 at 04:15:45PM +0200, Alexander Gordeev wrote:
> > Hmm.. 18/23 applies with a minor fuzz against
> > git://git.infradead.org/users/hch/scsi-queue.git drivers-for-3.17
> 
> Okay, it was just git-am being goofy then.  I'll take care of it.
> 

Anything I can help with?


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

* RE: [PATCH v2 RESEND 14/23] megaraid: Use pci_enable_msix_range() instead of pci_enable_msix()
  2014-08-11  8:09   ` Alexander Gordeev
@ 2014-08-11  8:29     ` Kashyap Desai
  0 siblings, 0 replies; 85+ messages in thread
From: Kashyap Desai @ 2014-08-11  8:29 UTC (permalink / raw)
  To: Alexander Gordeev, Neela Syam Kolli
  Cc: linux-scsi, linux-pci, linux-kernel, Christoph Hellwig

> -----Original Message-----
> From: Alexander Gordeev [mailto:agordeev@redhat.com]
> Sent: Monday, August 11, 2014 1:40 PM
> To: Kashyap Desai; Neela Syam Kolli
> Cc: linux-scsi@vger.kernel.org; linux-pci@vger.kernel.org; linux-
> kernel@vger.kernel.org; Christoph Hellwig
> Subject: Re: [PATCH v2 RESEND 14/23] megaraid: Use
> pci_enable_msix_range() instead of pci_enable_msix()
>
> On Wed, Jul 16, 2014 at 08:05:18PM +0200, Alexander Gordeev wrote:
> > As result of deprecation of MSI-X/MSI enablement functions
> > pci_enable_msix() and pci_enable_msi_block() all drivers using these
> > two interfaces need to be updated to use the new
> > pci_enable_msi_range()  or pci_enable_msi_exact() and
> > pci_enable_msix_range() or pci_enable_msix_exact() interfaces.
>
> Kashyap, Neela,
>
> Could you please reveiw this patch?

Review this patch. Please consider this patch Acked by Me.
 Acked-by: Kashyap Desai <Kashyap.desai@avagotech.com>

>
> Thanks!
>
> > Signed-off-by: Alexander Gordeev <agordeev@redhat.com>
> > Cc: Neela Syam Kolli <megaraidlinux@lsi.com>
> > Cc: linux-scsi@vger.kernel.org
> > Cc: linux-pci@vger.kernel.org
> > ---
> >  drivers/scsi/megaraid/megaraid_sas_base.c |   20 +++++++-------------
> >  1 files changed, 7 insertions(+), 13 deletions(-)
> >
> > diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c
> > b/drivers/scsi/megaraid/megaraid_sas_base.c
> > index ba06102..7a4e75e 100644
> > --- a/drivers/scsi/megaraid/megaraid_sas_base.c
> > +++ b/drivers/scsi/megaraid/megaraid_sas_base.c
> > @@ -4105,17 +4105,11 @@ static int megasas_init_fw(struct
> megasas_instance *instance)
> >  					     (unsigned
int)num_online_cpus());
> >  		for (i = 0; i < instance->msix_vectors; i++)
> >  			instance->msixentry[i].entry = i;
> > -		i = pci_enable_msix(instance->pdev, instance->msixentry,
> > -				    instance->msix_vectors);
> > -		if (i >= 0) {
> > -			if (i) {
> > -				if (!pci_enable_msix(instance->pdev,
> > -						     instance->msixentry,
i))
> > -					instance->msix_vectors = i;
> > -				else
> > -					instance->msix_vectors = 0;
> > -			}
> > -		} else
> > +		i = pci_enable_msix_range(instance->pdev, instance-
> >msixentry,
> > +					  1, instance->msix_vectors);
> > +		if (i)
> > +			instance->msix_vectors = i;
> > +		else
> >  			instance->msix_vectors = 0;
> >
> >  		dev_info(&instance->pdev->dev, "[scsi%d]: FW supports"
> > @@ -5135,8 +5129,8 @@ megasas_resume(struct pci_dev *pdev)
> >
> >  	/* Now re-enable MSI-X */
> >  	if (instance->msix_vectors &&
> > -	    pci_enable_msix(instance->pdev, instance->msixentry,
> > -			    instance->msix_vectors))
> > +	    pci_enable_msix_exact(instance->pdev, instance->msixentry,
> > +				  instance->msix_vectors))
> >  		goto fail_reenable_msix;
> >
> >  	switch (instance->pdev->device) {
> > --
> > 1.7.7.6
> >

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

* Re: [PATCH v2 RESEND 22/23] qla4xxx: Use pci_enable_msix_exact() instead of pci_enable_msix()
  2014-07-28 11:47       ` Vikas Chaudhary
  (?)
@ 2014-08-11  8:54       ` Alexander Gordeev
  2014-08-11  9:40         ` Christoph Hellwig
  -1 siblings, 1 reply; 85+ messages in thread
From: Alexander Gordeev @ 2014-08-11  8:54 UTC (permalink / raw)
  To: Christoph Hellwig
  Cc: linux-kernel, Dept-Eng iSCSI Driver, linux-scsi, linux-pci,
	Vikas Chaudhary

On Mon, Jul 28, 2014 at 11:47:19AM +0000, Vikas Chaudhary wrote:
> 
> Acked-By: Vikas Chaudhary <vikas.chaudhary@qlogic.com>

Christoph,

This patch seems ready..

> On 26/07/14 2:11 pm, "Alexander Gordeev" <agordeev@redhat.com> wrote:
> 
> >On Wed, Jul 16, 2014 at 08:05:26PM +0200, Alexander Gordeev wrote:
> >> As result of deprecation of MSI-X/MSI enablement functions
> >> pci_enable_msix() and pci_enable_msi_block() all drivers
> >> using these two interfaces need to be updated to use the
> >> new pci_enable_msi_range()  or pci_enable_msi_exact()
> >> and pci_enable_msix_range() or pci_enable_msix_exact()
> >> interfaces.
> >
> >Hi Vikas,
> >
> >Could you please reveiw this patch?
> >
> >Thanks!
> >
> >> Signed-off-by: Alexander Gordeev <agordeev@redhat.com>
> >> Cc: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
> >> Cc: iscsi-driver@qlogic.com
> >> Cc: linux-scsi@vger.kernel.org
> >> Cc: linux-pci@vger.kernel.org
> >> Acked-By: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
> >> ---
> >>  drivers/scsi/qla4xxx/ql4_nx.c |    2 +-
> >>  1 files changed, 1 insertions(+), 1 deletions(-)
> >> 
> >> diff --git a/drivers/scsi/qla4xxx/ql4_nx.c
> >>b/drivers/scsi/qla4xxx/ql4_nx.c
> >> index 9dbdb4b..7c33658 100644
> >> --- a/drivers/scsi/qla4xxx/ql4_nx.c
> >> +++ b/drivers/scsi/qla4xxx/ql4_nx.c
> >> @@ -4221,7 +4221,7 @@ qla4_8xxx_enable_msix(struct scsi_qla_host *ha)
> >>  	for (i = 0; i < QLA_MSIX_ENTRIES; i++)
> >>  		entries[i].entry = qla4_8xxx_msix_entries[i].entry;
> >>  
> >> -	ret = pci_enable_msix(ha->pdev, entries, ARRAY_SIZE(entries));
> >> +	ret = pci_enable_msix_exact(ha->pdev, entries, ARRAY_SIZE(entries));
> >>  	if (ret) {
> >>  		ql4_printk(KERN_WARNING, ha,
> >>  		    "MSI-X: Failed to enable support -- %d/%d\n",
> >> -- 
> >> 1.7.7.6
> >> 
> >
> >-- 
> >Regards,
> >Alexander Gordeev
> >agordeev@redhat.com
> 

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

* Re: [PATCH v2 RESEND 21/23] qla2xxx: Use pci_enable_msix_range() instead of pci_enable_msix()
  2014-07-16 18:05 ` [PATCH v2 RESEND 21/23] qla2xxx: " Alexander Gordeev
  2014-07-26  8:40   ` Alexander Gordeev
@ 2014-08-11  8:57   ` Alexander Gordeev
  2014-08-11 18:07       ` Chad Dupuis
  1 sibling, 1 reply; 85+ messages in thread
From: Alexander Gordeev @ 2014-08-11  8:57 UTC (permalink / raw)
  To: qla2xxx-upstream; +Cc: linux-scsi, linux-pci, linux-kernel

On Wed, Jul 16, 2014 at 08:05:25PM +0200, Alexander Gordeev wrote:
> As result of deprecation of MSI-X/MSI enablement functions
> pci_enable_msix() and pci_enable_msi_block() all drivers
> using these two interfaces need to be updated to use the
> new pci_enable_msi_range()  or pci_enable_msi_exact()
> and pci_enable_msix_range() or pci_enable_msix_exact()
> interfaces.
> 
> Log message code 0x00c6 preserved, although it is reported
> after successful call to pci_enable_msix_range(), not before
> possibly unsuccessful call to pci_enable_msix(). Consumers
> of the error code should not notice the difference.

Hello,

Please, anyone (from QLogic especially) review this patch.

Thanks!

> Signed-off-by: Alexander Gordeev <agordeev@redhat.com>
> Cc: qla2xxx-upstream@qlogic.com
> Cc: linux-scsi@vger.kernel.org
> Cc: linux-pci@vger.kernel.org
> ---
>  drivers/scsi/qla2xxx/qla_isr.c |   27 +++++++++++----------------
>  1 files changed, 11 insertions(+), 16 deletions(-)
> 
> diff --git a/drivers/scsi/qla2xxx/qla_isr.c b/drivers/scsi/qla2xxx/qla_isr.c
> index a56825c..52d420f 100644
> --- a/drivers/scsi/qla2xxx/qla_isr.c
> +++ b/drivers/scsi/qla2xxx/qla_isr.c
> @@ -2923,27 +2923,22 @@ qla24xx_enable_msix(struct qla_hw_data *ha, struct rsp_que *rsp)
>  	for (i = 0; i < ha->msix_count; i++)
>  		entries[i].entry = i;
>  
> -	ret = pci_enable_msix(ha->pdev, entries, ha->msix_count);
> -	if (ret) {
> -		if (ret < MIN_MSIX_COUNT)
> -			goto msix_failed;
> -
> +	ret = pci_enable_msix_range(ha->pdev,
> +				    entries, MIN_MSIX_COUNT, ha->msix_count);
> +	if (ret < 0) {
> +		ql_log(ql_log_fatal, vha, 0x00c7,
> +		    "MSI-X: Failed to enable support, "
> +		    "giving   up -- %d/%d.\n",
> +		    ha->msix_count, ret);
> +		goto msix_out;
> +	} else if (ret < ha->msix_count) {
>  		ql_log(ql_log_warn, vha, 0x00c6,
>  		    "MSI-X: Failed to enable support "
>  		    "-- %d/%d\n Retry with %d vectors.\n",
>  		    ha->msix_count, ret, ret);
> -		ha->msix_count = ret;
> -		ret = pci_enable_msix(ha->pdev, entries, ha->msix_count);
> -		if (ret) {
> -msix_failed:
> -			ql_log(ql_log_fatal, vha, 0x00c7,
> -			    "MSI-X: Failed to enable support, "
> -			    "giving   up -- %d/%d.\n",
> -			    ha->msix_count, ret);
> -			goto msix_out;
> -		}
> -		ha->max_rsp_queues = ha->msix_count - 1;
>  	}
> +	ha->msix_count = ret;
> +	ha->max_rsp_queues = ha->msix_count - 1;
>  	ha->msix_entries = kzalloc(sizeof(struct qla_msix_entry) *
>  				ha->msix_count, GFP_KERNEL);
>  	if (!ha->msix_entries) {
> -- 
> 1.7.7.6
> 

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

* Re: [PATCH v2 RESEND 22/23] qla4xxx: Use pci_enable_msix_exact() instead of pci_enable_msix()
  2014-08-11  8:54       ` Alexander Gordeev
@ 2014-08-11  9:40         ` Christoph Hellwig
  0 siblings, 0 replies; 85+ messages in thread
From: Christoph Hellwig @ 2014-08-11  9:40 UTC (permalink / raw)
  To: Alexander Gordeev
  Cc: Christoph Hellwig, linux-kernel, Dept-Eng iSCSI Driver,
	linux-scsi, linux-pci, Vikas Chaudhary

On Mon, Aug 11, 2014 at 10:54:34AM +0200, Alexander Gordeev wrote:
> On Mon, Jul 28, 2014 at 11:47:19AM +0000, Vikas Chaudhary wrote:
> > 
> > Acked-By: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
> 
> Christoph,
> 
> This patch seems ready..

I will apply all the patches that have gotten reviews once I open
up the queues for 3.18 which should be in about a week from now.


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

* RE: [PATCH v2 RESEND 04/23] bfa: Use pci_enable_msix_exact() instead of pci_enable_msix()
  2014-08-11  7:39   ` Alexander Gordeev
@ 2014-08-11 11:02       ` Anil Gurumurthy
  0 siblings, 0 replies; 85+ messages in thread
From: Anil Gurumurthy @ 2014-08-11 11:02 UTC (permalink / raw)
  To: Alexander Gordeev, linux-kernel
  Cc: Anil Gurumurthy, Vijaya Mohan Guvva, linux-scsi, linux-pci,
	Sudarsana Kalluru

Acked-by: Anil Gurumurthy <anil.gurumurthy@qlogic.com>


-----Original Message-----
From: Alexander Gordeev [mailto:agordeev@redhat.com] 
Sent: 11 August 2014 13:09
To: linux-kernel
Cc: Anil Gurumurthy; Vijaya Mohan Guvva; linux-scsi; linux-pci; Anil Gurumurthy; Sudarsana Kalluru
Subject: Re: [PATCH v2 RESEND 04/23] bfa: Use pci_enable_msix_exact() instead of pci_enable_msix()

On Wed, Jul 16, 2014 at 08:05:08PM +0200, Alexander Gordeev wrote:
> As result of deprecation of MSI-X/MSI enablement functions
> pci_enable_msix() and pci_enable_msi_block() all drivers using these 
> two interfaces need to be updated to use the new 
> pci_enable_msi_range()  or pci_enable_msi_exact() and 
> pci_enable_msix_range() or pci_enable_msix_exact() interfaces.

Anil, Sudarsana,

Could you please review bfa patches in this series?

Thanks!

> Signed-off-by: Alexander Gordeev <agordeev@redhat.com>
> Cc: Anil Gurumurthy <agurumur@brocade.com>
> Cc: Vijaya Mohan Guvva <vmohan@brocade.com>
> Cc: linux-scsi@vger.kernel.org
> Cc: linux-pci@vger.kernel.org
> Acked-by: Anil Gurumurthy <anil.gurumurthy@qlogic.com>
> ---
>  drivers/scsi/bfa/bfad.c |   20 ++++++--------------
>  1 files changed, 6 insertions(+), 14 deletions(-)
> 
> diff --git a/drivers/scsi/bfa/bfad.c b/drivers/scsi/bfa/bfad.c index 
> c18279f..e90a374 100644
> --- a/drivers/scsi/bfa/bfad.c
> +++ b/drivers/scsi/bfa/bfad.c
> @@ -1234,29 +1234,21 @@ bfad_setup_intr(struct bfad_s *bfad)
>  	if ((bfa_asic_id_ctc(pdev->device) && !msix_disable_ct) ||
>  	   (bfa_asic_id_cb(pdev->device) && !msix_disable_cb)) {
>  
> -		error = pci_enable_msix(bfad->pcidev, msix_entries, bfad->nvec);
> +		error = pci_enable_msix_exact(bfad->pcidev,
> +					      msix_entries, bfad->nvec);
>  		/* In CT1 & CT2, try to allocate just one vector */
> -		if (error > 0 && bfa_asic_id_ctc(pdev->device)) {
> +		if (error == -ENOSPC && bfa_asic_id_ctc(pdev->device)) {
>  			printk(KERN_WARNING "bfa %s: trying one msix "
>  			       "vector failed to allocate %d[%d]\n",
>  			       bfad->pci_name, bfad->nvec, error);
>  			bfad->nvec = 1;
> -			error = pci_enable_msix(bfad->pcidev,
> -						msix_entries, bfad->nvec);
> +			error = pci_enable_msix_exact(bfad->pcidev,
> +						      msix_entries, 1);
>  		}
>  
> -		/*
> -		 * Only error number of vector is available.
> -		 * We don't have a mechanism to map multiple
> -		 * interrupts into one vector, so even if we
> -		 * can try to request less vectors, we don't
> -		 * know how to associate interrupt events to
> -		 *  vectors. Linux doesn't duplicate vectors
> -		 * in the MSIX table for this case.
> -		 */
>  		if (error) {
>  			printk(KERN_WARNING "bfad%d: "
> -			       "pci_enable_msix failed (%d), "
> +			       "pci_enable_msix_exact failed (%d), "
>  			       "use line based.\n",
>  				bfad->inst_no, error);
>  			goto line_based;
> --
> 1.7.7.6
> 

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

* RE: [PATCH v2 RESEND 04/23] bfa: Use pci_enable_msix_exact() instead of pci_enable_msix()
@ 2014-08-11 11:02       ` Anil Gurumurthy
  0 siblings, 0 replies; 85+ messages in thread
From: Anil Gurumurthy @ 2014-08-11 11:02 UTC (permalink / raw)
  To: Alexander Gordeev, linux-kernel
  Cc: Anil Gurumurthy, Vijaya Mohan Guvva, linux-scsi, linux-pci,
	Sudarsana Kalluru

[-- Attachment #1: Type: text/plain, Size: 2949 bytes --]

Acked-by: Anil Gurumurthy <anil.gurumurthy@qlogic.com>


-----Original Message-----
From: Alexander Gordeev [mailto:agordeev@redhat.com] 
Sent: 11 August 2014 13:09
To: linux-kernel
Cc: Anil Gurumurthy; Vijaya Mohan Guvva; linux-scsi; linux-pci; Anil Gurumurthy; Sudarsana Kalluru
Subject: Re: [PATCH v2 RESEND 04/23] bfa: Use pci_enable_msix_exact() instead of pci_enable_msix()

On Wed, Jul 16, 2014 at 08:05:08PM +0200, Alexander Gordeev wrote:
> As result of deprecation of MSI-X/MSI enablement functions
> pci_enable_msix() and pci_enable_msi_block() all drivers using these 
> two interfaces need to be updated to use the new 
> pci_enable_msi_range()  or pci_enable_msi_exact() and 
> pci_enable_msix_range() or pci_enable_msix_exact() interfaces.

Anil, Sudarsana,

Could you please review bfa patches in this series?

Thanks!

> Signed-off-by: Alexander Gordeev <agordeev@redhat.com>
> Cc: Anil Gurumurthy <agurumur@brocade.com>
> Cc: Vijaya Mohan Guvva <vmohan@brocade.com>
> Cc: linux-scsi@vger.kernel.org
> Cc: linux-pci@vger.kernel.org
> Acked-by: Anil Gurumurthy <anil.gurumurthy@qlogic.com>
> ---
>  drivers/scsi/bfa/bfad.c |   20 ++++++--------------
>  1 files changed, 6 insertions(+), 14 deletions(-)
> 
> diff --git a/drivers/scsi/bfa/bfad.c b/drivers/scsi/bfa/bfad.c index 
> c18279f..e90a374 100644
> --- a/drivers/scsi/bfa/bfad.c
> +++ b/drivers/scsi/bfa/bfad.c
> @@ -1234,29 +1234,21 @@ bfad_setup_intr(struct bfad_s *bfad)
>  	if ((bfa_asic_id_ctc(pdev->device) && !msix_disable_ct) ||
>  	   (bfa_asic_id_cb(pdev->device) && !msix_disable_cb)) {
>  
> -		error = pci_enable_msix(bfad->pcidev, msix_entries, bfad->nvec);
> +		error = pci_enable_msix_exact(bfad->pcidev,
> +					      msix_entries, bfad->nvec);
>  		/* In CT1 & CT2, try to allocate just one vector */
> -		if (error > 0 && bfa_asic_id_ctc(pdev->device)) {
> +		if (error == -ENOSPC && bfa_asic_id_ctc(pdev->device)) {
>  			printk(KERN_WARNING "bfa %s: trying one msix "
>  			       "vector failed to allocate %d[%d]\n",
>  			       bfad->pci_name, bfad->nvec, error);
>  			bfad->nvec = 1;
> -			error = pci_enable_msix(bfad->pcidev,
> -						msix_entries, bfad->nvec);
> +			error = pci_enable_msix_exact(bfad->pcidev,
> +						      msix_entries, 1);
>  		}
>  
> -		/*
> -		 * Only error number of vector is available.
> -		 * We don't have a mechanism to map multiple
> -		 * interrupts into one vector, so even if we
> -		 * can try to request less vectors, we don't
> -		 * know how to associate interrupt events to
> -		 *  vectors. Linux doesn't duplicate vectors
> -		 * in the MSIX table for this case.
> -		 */
>  		if (error) {
>  			printk(KERN_WARNING "bfad%d: "
> -			       "pci_enable_msix failed (%d), "
> +			       "pci_enable_msix_exact failed (%d), "
>  			       "use line based.\n",
>  				bfad->inst_no, error);
>  			goto line_based;
> --
> 1.7.7.6
> 

[-- Attachment #2: winmail.dat --]
[-- Type: application/ms-tnef, Size: 5434 bytes --]

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

* Re: [PATCH v2 RESEND 15/23] mpt2sas: Use pci_enable_msix_exact() instead of pci_enable_msix()
  2014-07-16 18:05 ` [PATCH v2 RESEND 15/23] mpt2sas: Use pci_enable_msix_exact() " Alexander Gordeev
  2014-07-26  8:26   ` Alexander Gordeev
@ 2014-08-11 13:07   ` Tomas Henzl
  1 sibling, 0 replies; 85+ messages in thread
From: Tomas Henzl @ 2014-08-11 13:07 UTC (permalink / raw)
  To: Alexander Gordeev, linux-kernel
  Cc: Nagalakshmi Nandigama, Sreekanth Reddy, support,
	DL-MPTFusionLinux, linux-scsi, linux-pci

On 07/16/2014 08:05 PM, Alexander Gordeev wrote:
> As result of deprecation of MSI-X/MSI enablement functions
> pci_enable_msix() and pci_enable_msi_block() all drivers
> using these two interfaces need to be updated to use the
> new pci_enable_msi_range()  or pci_enable_msi_exact()
> and pci_enable_msix_range() or pci_enable_msix_exact()
> interfaces.
>
> Signed-off-by: Alexander Gordeev <agordeev@redhat.com>
> Cc: Nagalakshmi Nandigama <Nagalakshmi.Nandigama@lsi.com>
> Cc: Sreekanth Reddy <Sreekanth.Reddy@lsi.com>
> Cc: support@lsi.com
> Cc: DL-MPTFusionLinux@lsi.com
> Cc: linux-scsi@vger.kernel.org
> Cc: linux-pci@vger.kernel.org

Looks good

Reviewed-by: Tomas Henzl <thenzl@redhat.com>

> ---
>  drivers/scsi/mpt2sas/mpt2sas_base.c |    6 +++---
>  1 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/scsi/mpt2sas/mpt2sas_base.c b/drivers/scsi/mpt2sas/mpt2sas_base.c
> index 8b88118..6aca369 100644
> --- a/drivers/scsi/mpt2sas/mpt2sas_base.c
> +++ b/drivers/scsi/mpt2sas/mpt2sas_base.c
> @@ -1432,10 +1432,10 @@ _base_enable_msix(struct MPT2SAS_ADAPTER *ioc)
>  	for (i = 0, a = entries; i < ioc->reply_queue_count; i++, a++)
>  		a->entry = i;
>  
> -	r = pci_enable_msix(ioc->pdev, entries, ioc->reply_queue_count);
> +	r = pci_enable_msix_exact(ioc->pdev, entries, ioc->reply_queue_count);
>  	if (r) {
> -		dfailprintk(ioc, printk(MPT2SAS_INFO_FMT "pci_enable_msix "
> -		    "failed (r=%d) !!!\n", ioc->name, r));
> +		dfailprintk(ioc, printk(MPT2SAS_INFO_FMT
> +		    "pci_enable_msix_exact failed (r=%d) !!!\n", ioc->name, r));
>  		kfree(entries);
>  		goto try_ioapic;
>  	}


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

* Re: [PATCH v2 RESEND 16/23] mpt3sas: Use pci_enable_msix_exact() instead of pci_enable_msix()
  2014-07-16 18:05 ` [PATCH v2 RESEND 16/23] mpt3sas: " Alexander Gordeev
  2014-08-11  8:13   ` Alexander Gordeev
@ 2014-08-11 13:07   ` Tomas Henzl
  1 sibling, 0 replies; 85+ messages in thread
From: Tomas Henzl @ 2014-08-11 13:07 UTC (permalink / raw)
  To: Alexander Gordeev, linux-kernel
  Cc: Nagalakshmi Nandigama, Sreekanth Reddy, support,
	DL-MPTFusionLinux, linux-scsi, linux-pci

On 07/16/2014 08:05 PM, Alexander Gordeev wrote:
> As result of deprecation of MSI-X/MSI enablement functions
> pci_enable_msix() and pci_enable_msi_block() all drivers
> using these two interfaces need to be updated to use the
> new pci_enable_msi_range()  or pci_enable_msi_exact()
> and pci_enable_msix_range() or pci_enable_msix_exact()
> interfaces.
>
> Signed-off-by: Alexander Gordeev <agordeev@redhat.com>
> Cc: Nagalakshmi Nandigama <Nagalakshmi.Nandigama@lsi.com>
> Cc: Sreekanth Reddy <Sreekanth.Reddy@lsi.com>
> Cc: support@lsi.com
> Cc: DL-MPTFusionLinux@lsi.com
> Cc: linux-scsi@vger.kernel.org
> Cc: linux-pci@vger.kernel.org

Looks good

Reviewed-by: Tomas Henzl <thenzl@redhat.com>

> ---
>  drivers/scsi/mpt3sas/mpt3sas_base.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/scsi/mpt3sas/mpt3sas_base.c b/drivers/scsi/mpt3sas/mpt3sas_base.c
> index 0cf4f70..7b65ec2 100644
> --- a/drivers/scsi/mpt3sas/mpt3sas_base.c
> +++ b/drivers/scsi/mpt3sas/mpt3sas_base.c
> @@ -1747,10 +1747,10 @@ _base_enable_msix(struct MPT3SAS_ADAPTER *ioc)
>  	for (i = 0, a = entries; i < ioc->reply_queue_count; i++, a++)
>  		a->entry = i;
>  
> -	r = pci_enable_msix(ioc->pdev, entries, ioc->reply_queue_count);
> +	r = pci_enable_msix_exact(ioc->pdev, entries, ioc->reply_queue_count);
>  	if (r) {
>  		dfailprintk(ioc, pr_info(MPT3SAS_FMT
> -			"pci_enable_msix failed (r=%d) !!!\n",
> +			"pci_enable_msix_exact failed (r=%d) !!!\n",
>  			ioc->name, r));
>  		kfree(entries);
>  		goto try_ioapic;


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

* RE: [PATCH v2 RESEND 10/23] isci: Use pci_enable_msix_exact() instead of pci_enable_msix()
       [not found]   ` <718e4066d6294033a7590659cf0f3c4d@fmsmsx106.amr.corp.intel.com>
@ 2014-08-11 16:55       ` Jiang, Dave
  0 siblings, 0 replies; 85+ messages in thread
From: Jiang, Dave @ 2014-08-11 16:55 UTC (permalink / raw)
  To: Alexander Gordeev, intel-linux-scu, Paszkiewicz, Artur
  Cc: Dorau, Lukasz, Patelczyk, Maciej, intel-linux-scu, linux-scsi,
	linux-pci, Christoph Hellwig

> -----Original Message-----
> From: Alexander Gordeev [mailto:agordeev@redhat.com]
> Sent: Monday, August 11, 2014 12:57 AM
> To: intel-linux-scu; Paszkiewicz, Artur; Jiang, Dave
> Cc: Dorau, Lukasz; Patelczyk, Maciej; intel-linux-scu; linux-
> scsi@vger.kernel.org; linux-pci@vger.kernel.org; Christoph Hellwig
> Subject: Re: [PATCH v2 RESEND 10/23] isci: Use pci_enable_msix_exact()
> instead of pci_enable_msix()
> 
> On Wed, Jul 16, 2014 at 08:05:14PM +0200, Alexander Gordeev wrote:
> > As result of deprecation of MSI-X/MSI enablement functions
> > pci_enable_msix() and pci_enable_msi_block() all drivers using these
> > two interfaces need to be updated to use the new
> > pci_enable_msi_range()  or pci_enable_msi_exact() and
> > pci_enable_msix_range() or pci_enable_msix_exact() interfaces.
> 
> Artur, Dave,
> 
> Could you please review isci patches in this series?
> 
> Thanks!

Sorry. For some reason my spam filter decided to pick this up. 

Acked-by: Dave Jiang <dave.jiang@intel.com>

 
> > Signed-off-by: Alexander Gordeev <agordeev@redhat.com>
> > Cc: Lukasz Dorau <lukasz.dorau@intel.com>
> > Cc: Maciej Patelczyk <maciej.patelczyk@intel.com>
> > Cc: Dave Jiang <dave.jiang@intel.com>
> > Cc: intel-linux-scu@intel.com
> > Cc: linux-scsi@vger.kernel.org
> > Cc: linux-pci@vger.kernel.org
> > Acked-by: Artur Paszkiewicz <artur.paszkiewicz@intel.com>
> > ---
> >  drivers/scsi/isci/init.c |    2 +-
> >  1 files changed, 1 insertions(+), 1 deletions(-)
> >
> > diff --git a/drivers/scsi/isci/init.c b/drivers/scsi/isci/init.c index
> > 695b34e..4198e45 100644
> > --- a/drivers/scsi/isci/init.c
> > +++ b/drivers/scsi/isci/init.c
> > @@ -356,7 +356,7 @@ static int isci_setup_interrupts(struct pci_dev
> *pdev)
> >  	for (i = 0; i < num_msix; i++)
> >  		pci_info->msix_entries[i].entry = i;
> >
> > -	err = pci_enable_msix(pdev, pci_info->msix_entries, num_msix);
> > +	err = pci_enable_msix_exact(pdev, pci_info->msix_entries,
> num_msix);
> >  	if (err)
> >  		goto intx;
> >
> > --
> > 1.7.7.6
> >

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

* RE: [PATCH v2 RESEND 10/23] isci: Use pci_enable_msix_exact() instead of pci_enable_msix()
@ 2014-08-11 16:55       ` Jiang, Dave
  0 siblings, 0 replies; 85+ messages in thread
From: Jiang, Dave @ 2014-08-11 16:55 UTC (permalink / raw)
  To: Alexander Gordeev, Paszkiewicz, Artur
  Cc: Dorau, Lukasz, Patelczyk, Maciej, intel-linux-scu, linux-scsi,
	linux-pci, Christoph Hellwig

> -----Original Message-----
> From: Alexander Gordeev [mailto:agordeev@redhat.com]
> Sent: Monday, August 11, 2014 12:57 AM
> To: intel-linux-scu; Paszkiewicz, Artur; Jiang, Dave
> Cc: Dorau, Lukasz; Patelczyk, Maciej; intel-linux-scu; linux-
> scsi@vger.kernel.org; linux-pci@vger.kernel.org; Christoph Hellwig
> Subject: Re: [PATCH v2 RESEND 10/23] isci: Use pci_enable_msix_exact()
> instead of pci_enable_msix()
> 
> On Wed, Jul 16, 2014 at 08:05:14PM +0200, Alexander Gordeev wrote:
> > As result of deprecation of MSI-X/MSI enablement functions
> > pci_enable_msix() and pci_enable_msi_block() all drivers using these
> > two interfaces need to be updated to use the new
> > pci_enable_msi_range()  or pci_enable_msi_exact() and
> > pci_enable_msix_range() or pci_enable_msix_exact() interfaces.
> 
> Artur, Dave,
> 
> Could you please review isci patches in this series?
> 
> Thanks!

Sorry. For some reason my spam filter decided to pick this up. 

Acked-by: Dave Jiang <dave.jiang@intel.com>

 
> > Signed-off-by: Alexander Gordeev <agordeev@redhat.com>
> > Cc: Lukasz Dorau <lukasz.dorau@intel.com>
> > Cc: Maciej Patelczyk <maciej.patelczyk@intel.com>
> > Cc: Dave Jiang <dave.jiang@intel.com>
> > Cc: intel-linux-scu@intel.com
> > Cc: linux-scsi@vger.kernel.org
> > Cc: linux-pci@vger.kernel.org
> > Acked-by: Artur Paszkiewicz <artur.paszkiewicz@intel.com>
> > ---
> >  drivers/scsi/isci/init.c |    2 +-
> >  1 files changed, 1 insertions(+), 1 deletions(-)
> >
> > diff --git a/drivers/scsi/isci/init.c b/drivers/scsi/isci/init.c index
> > 695b34e..4198e45 100644
> > --- a/drivers/scsi/isci/init.c
> > +++ b/drivers/scsi/isci/init.c
> > @@ -356,7 +356,7 @@ static int isci_setup_interrupts(struct pci_dev
> *pdev)
> >  	for (i = 0; i < num_msix; i++)
> >  		pci_info->msix_entries[i].entry = i;
> >
> > -	err = pci_enable_msix(pdev, pci_info->msix_entries, num_msix);
> > +	err = pci_enable_msix_exact(pdev, pci_info->msix_entries,
> num_msix);
> >  	if (err)
> >  		goto intx;
> >
> > --
> > 1.7.7.6
> >

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

* Re: [PATCH v2 RESEND 12/23] lpfc: Use pci_enable_msix_range() instead of pci_enable_msix()
  2014-08-11  8:01     ` Alexander Gordeev
@ 2014-08-11 17:14         ` James Smart
  0 siblings, 0 replies; 85+ messages in thread
From: James Smart @ 2014-08-11 17:14 UTC (permalink / raw)
  To: Alexander Gordeev
  Cc: linux-kernel, Christoph Hellwig, linux-scsi, linux-pci, Smart, James

Alexander,

I haven't looked too deeply, but it's clear it doesn't jive with what 
we've discussed in the past. Your original patches missed several other 
similar sections for revision. I had sent a revised set of patches.

I was also unclear as to the merge path the patches were taking, as it 
was mod'ing areas that have already changed in the scsi misc tree, but 
the misc tree didn' have the pci mods.  I take it this is heading to 
Christoph's tree ?  and that it has picked up the pci mods ?

-- james s



On 8/11/2014 4:01 AM, Alexander Gordeev wrote:
> On Sat, Jul 26, 2014 at 09:22:27AM +0100, Alexander Gordeev wrote:
>> On Wed, Jul 16, 2014 at 08:05:16PM +0200, Alexander Gordeev wrote:
>>> As result of deprecation of MSI-X/MSI enablement functions
>>> pci_enable_msix() and pci_enable_msi_block() all drivers
>>> using these two interfaces need to be updated to use the
>>> new pci_enable_msi_range()  or pci_enable_msi_exact()
>>> and pci_enable_msix_range() or pci_enable_msix_exact()
>>> interfaces.
>> Hi James,
>>
>> Could you please review this patch?
> James?
>
>> Thanks!
>>
>>> Signed-off-by: Alexander Gordeev <agordeev@redhat.com>
>>> Cc: James Smart <james.smart@emulex.com>
>>> Cc: linux-scsi@vger.kernel.org
>>> Cc: linux-pci@vger.kernel.org
>>> ---
>>>   drivers/scsi/lpfc/lpfc_init.c |   38 +++++++++++++++++---------------------
>>>   1 files changed, 17 insertions(+), 21 deletions(-)
>>>
>>> diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c
>>> index a5769a9..d9caed9 100644
>>> --- a/drivers/scsi/lpfc/lpfc_init.c
>>> +++ b/drivers/scsi/lpfc/lpfc_init.c
>>> @@ -8211,9 +8211,9 @@ lpfc_sli4_pci_mem_unset(struct lpfc_hba *phba)
>>>    * @phba: pointer to lpfc hba data structure.
>>>    *
>>>    * This routine is invoked to enable the MSI-X interrupt vectors to device
>>> - * with SLI-3 interface specs. The kernel function pci_enable_msix() is
>>> - * called to enable the MSI-X vectors. Note that pci_enable_msix(), once
>>> - * invoked, enables either all or nothing, depending on the current
>>> + * with SLI-3 interface specs. The kernel function pci_enable_msix_exact()
>>> + * is called to enable the MSI-X vectors. Note that pci_enable_msix_exact(),
>>> + * once invoked, enables either all or nothing, depending on the current
>>>    * availability of PCI vector resources. The device driver is responsible
>>>    * for calling the individual request_irq() to register each MSI-X vector
>>>    * with a interrupt handler, which is done in this function. Note that
>>> @@ -8237,8 +8237,8 @@ lpfc_sli_enable_msix(struct lpfc_hba *phba)
>>>   		phba->msix_entries[i].entry = i;
>>>   
>>>   	/* Configure MSI-X capability structure */
>>> -	rc = pci_enable_msix(phba->pcidev, phba->msix_entries,
>>> -				ARRAY_SIZE(phba->msix_entries));
>>> +	rc = pci_enable_msix_exact(phba->pcidev, phba->msix_entries,
>>> +				   ARRAY_SIZE(phba->msix_entries));
>>>   	if (rc) {
>>>   		lpfc_printf_log(phba, KERN_INFO, LOG_INIT,
>>>   				"0420 PCI enable MSI-X failed (%d)\n", rc);
>>> @@ -8775,15 +8775,13 @@ out:
>>>    * @phba: pointer to lpfc hba data structure.
>>>    *
>>>    * This routine is invoked to enable the MSI-X interrupt vectors to device
>>> - * with SLI-4 interface spec. The kernel function pci_enable_msix() is called
>>> - * to enable the MSI-X vectors. Note that pci_enable_msix(), once invoked,
>>> - * enables either all or nothing, depending on the current availability of
>>> - * PCI vector resources. The device driver is responsible for calling the
>>> - * individual request_irq() to register each MSI-X vector with a interrupt
>>> - * handler, which is done in this function. Note that later when device is
>>> - * unloading, the driver should always call free_irq() on all MSI-X vectors
>>> - * it has done request_irq() on before calling pci_disable_msix(). Failure
>>> - * to do so results in a BUG_ON() and a device will be left with MSI-X
>>> + * with SLI-4 interface spec. The kernel function pci_enable_msix_range()
>>> + * is called to enable the MSI-X vectors. The device driver is responsible
>>> + * for calling the individual request_irq() to register each MSI-X vector
>>> + * with a interrupt handler, which is done in this function. Note that later
>>> + * when device is unloading, the driver should always call free_irq() on all
>>> + * MSI-X vectors it has done request_irq() on before calling pci_disable_msix()
>>> + * Failure to do so results in a BUG_ON() and a device will be left with MSI-X
>>>    * enabled and leaks its vectors.
>>>    *
>>>    * Return codes
>>> @@ -8805,18 +8803,16 @@ lpfc_sli4_enable_msix(struct lpfc_hba *phba)
>>>   		phba->sli4_hba.msix_entries[index].entry = index;
>>>   		vectors++;
>>>   	}
>>> -enable_msix_vectors:
>>> -	rc = pci_enable_msix(phba->pcidev, phba->sli4_hba.msix_entries,
>>> -			     vectors);
>>> -	if (rc > 1) {
>>> -		vectors = rc;
>>> -		goto enable_msix_vectors;
>>> -	} else if (rc) {
>>> +
>>> +	rc = pci_enable_msix_range(phba->pcidev, phba->sli4_hba.msix_entries,
>>> +				   2, vectors);
>>> +	if (rc < 0) {
>>>   		lpfc_printf_log(phba, KERN_INFO, LOG_INIT,
>>>   				"0484 PCI enable MSI-X failed (%d)\n", rc);
>>>   		goto vec_fail_out;
>>>   	}
>>>   
>>> +	vectors = rc;
>>>   	/* Log MSI-X vector assignment */
>>>   	for (index = 0; index < vectors; index++)
>>>   		lpfc_printf_log(phba, KERN_INFO, LOG_INIT,
>>> -- 
>>> 1.7.7.6
>>>
>> -- 
>> Regards,
>> Alexander Gordeev
>> agordeev@redhat.com
>


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

* Re: [PATCH v2 RESEND 12/23] lpfc: Use pci_enable_msix_range() instead of pci_enable_msix()
@ 2014-08-11 17:14         ` James Smart
  0 siblings, 0 replies; 85+ messages in thread
From: James Smart @ 2014-08-11 17:14 UTC (permalink / raw)
  To: Alexander Gordeev
  Cc: linux-kernel, Christoph Hellwig, linux-scsi, linux-pci, Smart, James

Alexander,

I haven't looked too deeply, but it's clear it doesn't jive with what 
we've discussed in the past. Your original patches missed several other 
similar sections for revision. I had sent a revised set of patches.

I was also unclear as to the merge path the patches were taking, as it 
was mod'ing areas that have already changed in the scsi misc tree, but 
the misc tree didn' have the pci mods.  I take it this is heading to 
Christoph's tree ?  and that it has picked up the pci mods ?

-- james s



On 8/11/2014 4:01 AM, Alexander Gordeev wrote:
> On Sat, Jul 26, 2014 at 09:22:27AM +0100, Alexander Gordeev wrote:
>> On Wed, Jul 16, 2014 at 08:05:16PM +0200, Alexander Gordeev wrote:
>>> As result of deprecation of MSI-X/MSI enablement functions
>>> pci_enable_msix() and pci_enable_msi_block() all drivers
>>> using these two interfaces need to be updated to use the
>>> new pci_enable_msi_range()  or pci_enable_msi_exact()
>>> and pci_enable_msix_range() or pci_enable_msix_exact()
>>> interfaces.
>> Hi James,
>>
>> Could you please review this patch?
> James?
>
>> Thanks!
>>
>>> Signed-off-by: Alexander Gordeev <agordeev@redhat.com>
>>> Cc: James Smart <james.smart@emulex.com>
>>> Cc: linux-scsi@vger.kernel.org
>>> Cc: linux-pci@vger.kernel.org
>>> ---
>>>   drivers/scsi/lpfc/lpfc_init.c |   38 +++++++++++++++++---------------------
>>>   1 files changed, 17 insertions(+), 21 deletions(-)
>>>
>>> diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c
>>> index a5769a9..d9caed9 100644
>>> --- a/drivers/scsi/lpfc/lpfc_init.c
>>> +++ b/drivers/scsi/lpfc/lpfc_init.c
>>> @@ -8211,9 +8211,9 @@ lpfc_sli4_pci_mem_unset(struct lpfc_hba *phba)
>>>    * @phba: pointer to lpfc hba data structure.
>>>    *
>>>    * This routine is invoked to enable the MSI-X interrupt vectors to device
>>> - * with SLI-3 interface specs. The kernel function pci_enable_msix() is
>>> - * called to enable the MSI-X vectors. Note that pci_enable_msix(), once
>>> - * invoked, enables either all or nothing, depending on the current
>>> + * with SLI-3 interface specs. The kernel function pci_enable_msix_exact()
>>> + * is called to enable the MSI-X vectors. Note that pci_enable_msix_exact(),
>>> + * once invoked, enables either all or nothing, depending on the current
>>>    * availability of PCI vector resources. The device driver is responsible
>>>    * for calling the individual request_irq() to register each MSI-X vector
>>>    * with a interrupt handler, which is done in this function. Note that
>>> @@ -8237,8 +8237,8 @@ lpfc_sli_enable_msix(struct lpfc_hba *phba)
>>>   		phba->msix_entries[i].entry = i;
>>>   
>>>   	/* Configure MSI-X capability structure */
>>> -	rc = pci_enable_msix(phba->pcidev, phba->msix_entries,
>>> -				ARRAY_SIZE(phba->msix_entries));
>>> +	rc = pci_enable_msix_exact(phba->pcidev, phba->msix_entries,
>>> +				   ARRAY_SIZE(phba->msix_entries));
>>>   	if (rc) {
>>>   		lpfc_printf_log(phba, KERN_INFO, LOG_INIT,
>>>   				"0420 PCI enable MSI-X failed (%d)\n", rc);
>>> @@ -8775,15 +8775,13 @@ out:
>>>    * @phba: pointer to lpfc hba data structure.
>>>    *
>>>    * This routine is invoked to enable the MSI-X interrupt vectors to device
>>> - * with SLI-4 interface spec. The kernel function pci_enable_msix() is called
>>> - * to enable the MSI-X vectors. Note that pci_enable_msix(), once invoked,
>>> - * enables either all or nothing, depending on the current availability of
>>> - * PCI vector resources. The device driver is responsible for calling the
>>> - * individual request_irq() to register each MSI-X vector with a interrupt
>>> - * handler, which is done in this function. Note that later when device is
>>> - * unloading, the driver should always call free_irq() on all MSI-X vectors
>>> - * it has done request_irq() on before calling pci_disable_msix(). Failure
>>> - * to do so results in a BUG_ON() and a device will be left with MSI-X
>>> + * with SLI-4 interface spec. The kernel function pci_enable_msix_range()
>>> + * is called to enable the MSI-X vectors. The device driver is responsible
>>> + * for calling the individual request_irq() to register each MSI-X vector
>>> + * with a interrupt handler, which is done in this function. Note that later
>>> + * when device is unloading, the driver should always call free_irq() on all
>>> + * MSI-X vectors it has done request_irq() on before calling pci_disable_msix()
>>> + * Failure to do so results in a BUG_ON() and a device will be left with MSI-X
>>>    * enabled and leaks its vectors.
>>>    *
>>>    * Return codes
>>> @@ -8805,18 +8803,16 @@ lpfc_sli4_enable_msix(struct lpfc_hba *phba)
>>>   		phba->sli4_hba.msix_entries[index].entry = index;
>>>   		vectors++;
>>>   	}
>>> -enable_msix_vectors:
>>> -	rc = pci_enable_msix(phba->pcidev, phba->sli4_hba.msix_entries,
>>> -			     vectors);
>>> -	if (rc > 1) {
>>> -		vectors = rc;
>>> -		goto enable_msix_vectors;
>>> -	} else if (rc) {
>>> +
>>> +	rc = pci_enable_msix_range(phba->pcidev, phba->sli4_hba.msix_entries,
>>> +				   2, vectors);
>>> +	if (rc < 0) {
>>>   		lpfc_printf_log(phba, KERN_INFO, LOG_INIT,
>>>   				"0484 PCI enable MSI-X failed (%d)\n", rc);
>>>   		goto vec_fail_out;
>>>   	}
>>>   
>>> +	vectors = rc;
>>>   	/* Log MSI-X vector assignment */
>>>   	for (index = 0; index < vectors; index++)
>>>   		lpfc_printf_log(phba, KERN_INFO, LOG_INIT,
>>> -- 
>>> 1.7.7.6
>>>
>> -- 
>> Regards,
>> Alexander Gordeev
>> agordeev@redhat.com
>

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

* Re: [PATCH v2 RESEND 21/23] qla2xxx: Use pci_enable_msix_range() instead of pci_enable_msix()
  2014-08-11  8:57   ` Alexander Gordeev
@ 2014-08-11 18:07       ` Chad Dupuis
  0 siblings, 0 replies; 85+ messages in thread
From: Chad Dupuis @ 2014-08-11 18:07 UTC (permalink / raw)
  To: Alexander Gordeev; +Cc: qla2xxx-upstream, linux-scsi, linux-pci, linux-kernel



On Mon, 11 Aug 2014, Alexander Gordeev wrote:

> On Wed, Jul 16, 2014 at 08:05:25PM +0200, Alexander Gordeev wrote:
>> As result of deprecation of MSI-X/MSI enablement functions
>> pci_enable_msix() and pci_enable_msi_block() all drivers
>> using these two interfaces need to be updated to use the
>> new pci_enable_msi_range()  or pci_enable_msi_exact()
>> and pci_enable_msix_range() or pci_enable_msix_exact()
>> interfaces.
>>
>> Log message code 0x00c6 preserved, although it is reported
>> after successful call to pci_enable_msix_range(), not before
>> possibly unsuccessful call to pci_enable_msix(). Consumers
>> of the error code should not notice the difference.
>
> Hello,
>
> Please, anyone (from QLogic especially) review this patch.
>
> Thanks!

Looks good.

Ack-by: Chad Dupuis <chad.dupuis@qlogic.com>

>
>> Signed-off-by: Alexander Gordeev <agordeev@redhat.com>
>> Cc: qla2xxx-upstream@qlogic.com
>> Cc: linux-scsi@vger.kernel.org
>> Cc: linux-pci@vger.kernel.org
>> ---
>>  drivers/scsi/qla2xxx/qla_isr.c |   27 +++++++++++----------------
>>  1 files changed, 11 insertions(+), 16 deletions(-)
>>
>> diff --git a/drivers/scsi/qla2xxx/qla_isr.c b/drivers/scsi/qla2xxx/qla_isr.c
>> index a56825c..52d420f 100644
>> --- a/drivers/scsi/qla2xxx/qla_isr.c
>> +++ b/drivers/scsi/qla2xxx/qla_isr.c
>> @@ -2923,27 +2923,22 @@ qla24xx_enable_msix(struct qla_hw_data *ha, struct rsp_que *rsp)
>>  	for (i = 0; i < ha->msix_count; i++)
>>  		entries[i].entry = i;
>>
>> -	ret = pci_enable_msix(ha->pdev, entries, ha->msix_count);
>> -	if (ret) {
>> -		if (ret < MIN_MSIX_COUNT)
>> -			goto msix_failed;
>> -
>> +	ret = pci_enable_msix_range(ha->pdev,
>> +				    entries, MIN_MSIX_COUNT, ha->msix_count);
>> +	if (ret < 0) {
>> +		ql_log(ql_log_fatal, vha, 0x00c7,
>> +		    "MSI-X: Failed to enable support, "
>> +		    "giving   up -- %d/%d.\n",
>> +		    ha->msix_count, ret);
>> +		goto msix_out;
>> +	} else if (ret < ha->msix_count) {
>>  		ql_log(ql_log_warn, vha, 0x00c6,
>>  		    "MSI-X: Failed to enable support "
>>  		    "-- %d/%d\n Retry with %d vectors.\n",
>>  		    ha->msix_count, ret, ret);
>> -		ha->msix_count = ret;
>> -		ret = pci_enable_msix(ha->pdev, entries, ha->msix_count);
>> -		if (ret) {
>> -msix_failed:
>> -			ql_log(ql_log_fatal, vha, 0x00c7,
>> -			    "MSI-X: Failed to enable support, "
>> -			    "giving   up -- %d/%d.\n",
>> -			    ha->msix_count, ret);
>> -			goto msix_out;
>> -		}
>> -		ha->max_rsp_queues = ha->msix_count - 1;
>>  	}
>> +	ha->msix_count = ret;
>> +	ha->max_rsp_queues = ha->msix_count - 1;
>>  	ha->msix_entries = kzalloc(sizeof(struct qla_msix_entry) *
>>  				ha->msix_count, GFP_KERNEL);
>>  	if (!ha->msix_entries) {
>> --
>> 1.7.7.6
>>
>

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

* Re: [PATCH v2 RESEND 21/23] qla2xxx: Use pci_enable_msix_range() instead of pci_enable_msix()
@ 2014-08-11 18:07       ` Chad Dupuis
  0 siblings, 0 replies; 85+ messages in thread
From: Chad Dupuis @ 2014-08-11 18:07 UTC (permalink / raw)
  To: Alexander Gordeev; +Cc: qla2xxx-upstream, linux-scsi, linux-pci, linux-kernel



On Mon, 11 Aug 2014, Alexander Gordeev wrote:

> On Wed, Jul 16, 2014 at 08:05:25PM +0200, Alexander Gordeev wrote:
>> As result of deprecation of MSI-X/MSI enablement functions
>> pci_enable_msix() and pci_enable_msi_block() all drivers
>> using these two interfaces need to be updated to use the
>> new pci_enable_msi_range()  or pci_enable_msi_exact()
>> and pci_enable_msix_range() or pci_enable_msix_exact()
>> interfaces.
>>
>> Log message code 0x00c6 preserved, although it is reported
>> after successful call to pci_enable_msix_range(), not before
>> possibly unsuccessful call to pci_enable_msix(). Consumers
>> of the error code should not notice the difference.
>
> Hello,
>
> Please, anyone (from QLogic especially) review this patch.
>
> Thanks!

Looks good.

Ack-by: Chad Dupuis <chad.dupuis@qlogic.com>

>
>> Signed-off-by: Alexander Gordeev <agordeev@redhat.com>
>> Cc: qla2xxx-upstream@qlogic.com
>> Cc: linux-scsi@vger.kernel.org
>> Cc: linux-pci@vger.kernel.org
>> ---
>>  drivers/scsi/qla2xxx/qla_isr.c |   27 +++++++++++----------------
>>  1 files changed, 11 insertions(+), 16 deletions(-)
>>
>> diff --git a/drivers/scsi/qla2xxx/qla_isr.c b/drivers/scsi/qla2xxx/qla_isr.c
>> index a56825c..52d420f 100644
>> --- a/drivers/scsi/qla2xxx/qla_isr.c
>> +++ b/drivers/scsi/qla2xxx/qla_isr.c
>> @@ -2923,27 +2923,22 @@ qla24xx_enable_msix(struct qla_hw_data *ha, struct rsp_que *rsp)
>>  	for (i = 0; i < ha->msix_count; i++)
>>  		entries[i].entry = i;
>>
>> -	ret = pci_enable_msix(ha->pdev, entries, ha->msix_count);
>> -	if (ret) {
>> -		if (ret < MIN_MSIX_COUNT)
>> -			goto msix_failed;
>> -
>> +	ret = pci_enable_msix_range(ha->pdev,
>> +				    entries, MIN_MSIX_COUNT, ha->msix_count);
>> +	if (ret < 0) {
>> +		ql_log(ql_log_fatal, vha, 0x00c7,
>> +		    "MSI-X: Failed to enable support, "
>> +		    "giving   up -- %d/%d.\n",
>> +		    ha->msix_count, ret);
>> +		goto msix_out;
>> +	} else if (ret < ha->msix_count) {
>>  		ql_log(ql_log_warn, vha, 0x00c6,
>>  		    "MSI-X: Failed to enable support "
>>  		    "-- %d/%d\n Retry with %d vectors.\n",
>>  		    ha->msix_count, ret, ret);
>> -		ha->msix_count = ret;
>> -		ret = pci_enable_msix(ha->pdev, entries, ha->msix_count);
>> -		if (ret) {
>> -msix_failed:
>> -			ql_log(ql_log_fatal, vha, 0x00c7,
>> -			    "MSI-X: Failed to enable support, "
>> -			    "giving   up -- %d/%d.\n",
>> -			    ha->msix_count, ret);
>> -			goto msix_out;
>> -		}
>> -		ha->max_rsp_queues = ha->msix_count - 1;
>>  	}
>> +	ha->msix_count = ret;
>> +	ha->max_rsp_queues = ha->msix_count - 1;
>>  	ha->msix_entries = kzalloc(sizeof(struct qla_msix_entry) *
>>  				ha->msix_count, GFP_KERNEL);
>>  	if (!ha->msix_entries) {
>> --
>> 1.7.7.6
>>
>

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

* [PATCH v3 12/23] lpfc: Use pci_enable_msix_range() instead of pci_enable_msix()
  2014-08-12  8:11         ` Alexander Gordeev
@ 2014-08-12  8:09           ` Alexander Gordeev
  0 siblings, 0 replies; 85+ messages in thread
From: Alexander Gordeev @ 2014-08-12  8:09 UTC (permalink / raw)
  To: James Smart; +Cc: linux-kernel, Christoph Hellwig, linux-scsi, linux-pci

As result of deprecation of MSI-X/MSI enablement functions
pci_enable_msix() and pci_enable_msi_block() all drivers
using these two interfaces need to be updated to use the
new pci_enable_msi_range()  or pci_enable_msi_exact()
and pci_enable_msix_range() or pci_enable_msix_exact()
interfaces.

Signed-off-by: Alexander Gordeev <agordeev@redhat.com>
Cc: James Smart <james.smart@emulex.com>
Cc: linux-scsi@vger.kernel.org
Cc: linux-pci@vger.kernel.org
---
 drivers/scsi/lpfc/lpfc_init.c | 39 +++++++++++++++++----------------------
 1 file changed, 17 insertions(+), 22 deletions(-)

diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c
index a5769a9..37f2a20 100644
--- a/drivers/scsi/lpfc/lpfc_init.c
+++ b/drivers/scsi/lpfc/lpfc_init.c
@@ -8211,9 +8211,9 @@ lpfc_sli4_pci_mem_unset(struct lpfc_hba *phba)
  * @phba: pointer to lpfc hba data structure.
  *
  * This routine is invoked to enable the MSI-X interrupt vectors to device
- * with SLI-3 interface specs. The kernel function pci_enable_msix() is
- * called to enable the MSI-X vectors. Note that pci_enable_msix(), once
- * invoked, enables either all or nothing, depending on the current
+ * with SLI-3 interface specs. The kernel function pci_enable_msix_exact()
+ * is called to enable the MSI-X vectors. Note that pci_enable_msix_exact(),
+ * once invoked, enables either all or nothing, depending on the current
  * availability of PCI vector resources. The device driver is responsible
  * for calling the individual request_irq() to register each MSI-X vector
  * with a interrupt handler, which is done in this function. Note that
@@ -8237,8 +8237,8 @@ lpfc_sli_enable_msix(struct lpfc_hba *phba)
 		phba->msix_entries[i].entry = i;
 
 	/* Configure MSI-X capability structure */
-	rc = pci_enable_msix(phba->pcidev, phba->msix_entries,
-				ARRAY_SIZE(phba->msix_entries));
+	rc = pci_enable_msix_exact(phba->pcidev, phba->msix_entries,
+				   LPFC_MSIX_VECTORS);
 	if (rc) {
 		lpfc_printf_log(phba, KERN_INFO, LOG_INIT,
 				"0420 PCI enable MSI-X failed (%d)\n", rc);
@@ -8775,16 +8775,14 @@ out:
  * @phba: pointer to lpfc hba data structure.
  *
  * This routine is invoked to enable the MSI-X interrupt vectors to device
- * with SLI-4 interface spec. The kernel function pci_enable_msix() is called
- * to enable the MSI-X vectors. Note that pci_enable_msix(), once invoked,
- * enables either all or nothing, depending on the current availability of
- * PCI vector resources. The device driver is responsible for calling the
- * individual request_irq() to register each MSI-X vector with a interrupt
- * handler, which is done in this function. Note that later when device is
- * unloading, the driver should always call free_irq() on all MSI-X vectors
- * it has done request_irq() on before calling pci_disable_msix(). Failure
- * to do so results in a BUG_ON() and a device will be left with MSI-X
- * enabled and leaks its vectors.
+ * with SLI-4 interface spec. The kernel function pci_enable_msix_range()
+ * is called to enable the MSI-X vectors. The device driver is responsible
+ * for calling the individual request_irq() to register each MSI-X vector
+ * with a interrupt handler, which is done in this function. Note that
+ * later when device is unloading, the driver should always call free_irq()
+ * on all MSI-X vectors it has done request_irq() on before calling
+ * pci_disable_msix(). Failure to do so results in a BUG_ON() and a device
+ * will be left with MSI-X enabled and leaks its vectors.
  *
  * Return codes
  * 0 - successful
@@ -8805,17 +8803,14 @@ lpfc_sli4_enable_msix(struct lpfc_hba *phba)
 		phba->sli4_hba.msix_entries[index].entry = index;
 		vectors++;
 	}
-enable_msix_vectors:
-	rc = pci_enable_msix(phba->pcidev, phba->sli4_hba.msix_entries,
-			     vectors);
-	if (rc > 1) {
-		vectors = rc;
-		goto enable_msix_vectors;
-	} else if (rc) {
+	rc = pci_enable_msix_range(phba->pcidev, phba->sli4_hba.msix_entries,
+				   2, vectors);
+	if (rc < 0) {
 		lpfc_printf_log(phba, KERN_INFO, LOG_INIT,
 				"0484 PCI enable MSI-X failed (%d)\n", rc);
 		goto vec_fail_out;
 	}
+	vectors = rc;
 
 	/* Log MSI-X vector assignment */
 	for (index = 0; index < vectors; index++)
-- 
1.9.3

-- 
Regards,
Alexander Gordeev
agordeev@redhat.com

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

* Re: [PATCH v2 RESEND 12/23] lpfc: Use pci_enable_msix_range() instead of pci_enable_msix()
  2014-08-11 17:14         ` James Smart
  (?)
@ 2014-08-12  8:11         ` Alexander Gordeev
  2014-08-12  8:09           ` [PATCH v3 " Alexander Gordeev
  -1 siblings, 1 reply; 85+ messages in thread
From: Alexander Gordeev @ 2014-08-12  8:11 UTC (permalink / raw)
  To: James Smart; +Cc: linux-kernel, Christoph Hellwig, linux-scsi, linux-pci

On Mon, Aug 11, 2014 at 01:14:54PM -0400, James Smart wrote:
> Alexander,
> 
> I haven't looked too deeply, but it's clear it doesn't jive with what we've
> discussed in the past. Your original patches missed several other similar
> sections for revision. I had sent a revised set of patches.
> 
> I was also unclear as to the merge path the patches were taking, as it was
> mod'ing areas that have already changed in the scsi misc tree, but the misc
> tree didn' have the pci mods.  I take it this is heading to Christoph's tree
> ?  and that it has picked up the pci mods ?

James,

I lost the context and not sure what PCI modifications you are referring :(
I will send a patch that combines your version shortly.

Thanks!

> -- james s

-- 
Regards,
Alexander Gordeev
agordeev@redhat.com

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

* Re: [PATCH v2 RESEND 04/23] bfa: Use pci_enable_msix_exact() instead of pci_enable_msix()
  2014-08-11 11:02       ` Anil Gurumurthy
  (?)
@ 2014-08-12 10:50       ` Alexander Gordeev
  2014-08-14  2:55           ` Anil Gurumurthy
  -1 siblings, 1 reply; 85+ messages in thread
From: Alexander Gordeev @ 2014-08-12 10:50 UTC (permalink / raw)
  To: Anil Gurumurthy
  Cc: linux-kernel, Anil Gurumurthy, Vijaya Mohan Guvva, linux-scsi,
	linux-pci, Sudarsana Kalluru

On Mon, Aug 11, 2014 at 11:02:56AM +0000, Anil Gurumurthy wrote:
> Acked-by: Anil Gurumurthy <anil.gurumurthy@qlogic.com>

Many thanks, Anil!

If your Ack apply to this patch only or to all three
'bfa' patches in this series?

Thanks!

> -----Original Message-----
> From: Alexander Gordeev [mailto:agordeev@redhat.com] 
> Sent: 11 August 2014 13:09
> To: linux-kernel
> Cc: Anil Gurumurthy; Vijaya Mohan Guvva; linux-scsi; linux-pci; Anil Gurumurthy; Sudarsana Kalluru
> Subject: Re: [PATCH v2 RESEND 04/23] bfa: Use pci_enable_msix_exact() instead of pci_enable_msix()
> 
> On Wed, Jul 16, 2014 at 08:05:08PM +0200, Alexander Gordeev wrote:
> > As result of deprecation of MSI-X/MSI enablement functions
> > pci_enable_msix() and pci_enable_msi_block() all drivers using these 
> > two interfaces need to be updated to use the new 
> > pci_enable_msi_range()  or pci_enable_msi_exact() and 
> > pci_enable_msix_range() or pci_enable_msix_exact() interfaces.
> 
> Anil, Sudarsana,
> 
> Could you please review bfa patches in this series?
> 
> Thanks!
> 
> > Signed-off-by: Alexander Gordeev <agordeev@redhat.com>
> > Cc: Anil Gurumurthy <agurumur@brocade.com>
> > Cc: Vijaya Mohan Guvva <vmohan@brocade.com>
> > Cc: linux-scsi@vger.kernel.org
> > Cc: linux-pci@vger.kernel.org
> > Acked-by: Anil Gurumurthy <anil.gurumurthy@qlogic.com>
> > ---
> >  drivers/scsi/bfa/bfad.c |   20 ++++++--------------
> >  1 files changed, 6 insertions(+), 14 deletions(-)
> > 
> > diff --git a/drivers/scsi/bfa/bfad.c b/drivers/scsi/bfa/bfad.c index 
> > c18279f..e90a374 100644
> > --- a/drivers/scsi/bfa/bfad.c
> > +++ b/drivers/scsi/bfa/bfad.c
> > @@ -1234,29 +1234,21 @@ bfad_setup_intr(struct bfad_s *bfad)
> >  	if ((bfa_asic_id_ctc(pdev->device) && !msix_disable_ct) ||
> >  	   (bfa_asic_id_cb(pdev->device) && !msix_disable_cb)) {
> >  
> > -		error = pci_enable_msix(bfad->pcidev, msix_entries, bfad->nvec);
> > +		error = pci_enable_msix_exact(bfad->pcidev,
> > +					      msix_entries, bfad->nvec);
> >  		/* In CT1 & CT2, try to allocate just one vector */
> > -		if (error > 0 && bfa_asic_id_ctc(pdev->device)) {
> > +		if (error == -ENOSPC && bfa_asic_id_ctc(pdev->device)) {
> >  			printk(KERN_WARNING "bfa %s: trying one msix "
> >  			       "vector failed to allocate %d[%d]\n",
> >  			       bfad->pci_name, bfad->nvec, error);
> >  			bfad->nvec = 1;
> > -			error = pci_enable_msix(bfad->pcidev,
> > -						msix_entries, bfad->nvec);
> > +			error = pci_enable_msix_exact(bfad->pcidev,
> > +						      msix_entries, 1);
> >  		}
> >  
> > -		/*
> > -		 * Only error number of vector is available.
> > -		 * We don't have a mechanism to map multiple
> > -		 * interrupts into one vector, so even if we
> > -		 * can try to request less vectors, we don't
> > -		 * know how to associate interrupt events to
> > -		 *  vectors. Linux doesn't duplicate vectors
> > -		 * in the MSIX table for this case.
> > -		 */
> >  		if (error) {
> >  			printk(KERN_WARNING "bfad%d: "
> > -			       "pci_enable_msix failed (%d), "
> > +			       "pci_enable_msix_exact failed (%d), "
> >  			       "use line based.\n",
> >  				bfad->inst_no, error);
> >  			goto line_based;
> > --
> > 1.7.7.6
> > 

-- 
Regards,
Alexander Gordeev
agordeev@redhat.com

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

* Re: [PATCH v2 RESEND 08/23] hpsa: Fallback to MSI rather than to INTx if MSI-X failed
  2014-07-16 18:05 ` [PATCH v2 RESEND 08/23] hpsa: Fallback to MSI rather than to INTx if MSI-X failed Alexander Gordeev
  2014-07-26  8:16   ` Alexander Gordeev
@ 2014-08-13 16:04   ` scameron
  2014-08-13 17:05     ` Alexander Gordeev
  1 sibling, 1 reply; 85+ messages in thread
From: scameron @ 2014-08-13 16:04 UTC (permalink / raw)
  To: Alexander Gordeev
  Cc: linux-kernel, iss_storagedev, linux-scsi, linux-pci, scameron

On Wed, Jul 16, 2014 at 08:05:12PM +0200, Alexander Gordeev wrote:
> Currently the driver falls back to INTx mode when MSI-X
> initialization failed. This is a suboptimal behaviour
> for chips that also support MSI. This update changes that
> behaviour and falls back to MSI mode in case MSI-X mode
> initialization failed.
> 
> Signed-off-by: Alexander Gordeev <agordeev@redhat.com>
> Cc: "Stephen M. Cameron" <scameron@beardog.cce.hp.com>
> Cc: iss_storagedev@hp.com
> Cc: linux-scsi@vger.kernel.org
> Cc: linux-pci@vger.kernel.org
> ---
>  drivers/scsi/hpsa.c |    1 -
>  1 files changed, 0 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c
> index 31184b3..648dec2 100644
> --- a/drivers/scsi/hpsa.c
> +++ b/drivers/scsi/hpsa.c
> @@ -6177,7 +6177,6 @@ static void hpsa_interrupt_mode(struct ctlr_info *h)
>  			dev_warn(&h->pdev->dev, "MSI-X init failed %d\n",
>  			       err);
>  			h->msix_vector = 0;
> -			goto default_int_mode;
>  		}
>  	}
>  	if (pci_find_capability(h->pdev, PCI_CAP_ID_MSI)) {
> -- 
> 1.7.7.6

Ack.

Sorry for the slow reply, this got lost in the tornadic maelstrom
I call my inbox.

I also tested this with a Smart Array P420, P420i, and P430 in
the system by ifdef'ing out the code for MSI-X and setting
h->msix_vector = 0, to force it down the MSI path, and that all
appears to work. 

-- steve


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

* Re: [PATCH v2 RESEND 08/23] hpsa: Fallback to MSI rather than to INTx if MSI-X failed
  2014-08-13 16:04   ` scameron
@ 2014-08-13 17:05     ` Alexander Gordeev
  0 siblings, 0 replies; 85+ messages in thread
From: Alexander Gordeev @ 2014-08-13 17:05 UTC (permalink / raw)
  To: scameron; +Cc: linux-kernel, iss_storagedev, linux-scsi, linux-pci

On Wed, Aug 13, 2014 at 11:04:54AM -0500, scameron@beardog.cce.hp.com wrote:
> On Wed, Jul 16, 2014 at 08:05:12PM +0200, Alexander Gordeev wrote:
> > Currently the driver falls back to INTx mode when MSI-X
> > initialization failed. This is a suboptimal behaviour
> > for chips that also support MSI. This update changes that
> > behaviour and falls back to MSI mode in case MSI-X mode
> > initialization failed.
> > 
> > Signed-off-by: Alexander Gordeev <agordeev@redhat.com>
> > Cc: "Stephen M. Cameron" <scameron@beardog.cce.hp.com>
> > Cc: iss_storagedev@hp.com
> > Cc: linux-scsi@vger.kernel.org
> > Cc: linux-pci@vger.kernel.org
> > ---
> >  drivers/scsi/hpsa.c |    1 -
> >  1 files changed, 0 insertions(+), 1 deletions(-)
> > 
> > diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c
> > index 31184b3..648dec2 100644
> > --- a/drivers/scsi/hpsa.c
> > +++ b/drivers/scsi/hpsa.c
> > @@ -6177,7 +6177,6 @@ static void hpsa_interrupt_mode(struct ctlr_info *h)
> >  			dev_warn(&h->pdev->dev, "MSI-X init failed %d\n",
> >  			       err);
> >  			h->msix_vector = 0;
> > -			goto default_int_mode;
> >  		}
> >  	}
> >  	if (pci_find_capability(h->pdev, PCI_CAP_ID_MSI)) {
> > -- 
> > 1.7.7.6
> 
> Ack.
> 
> Sorry for the slow reply, this got lost in the tornadic maelstrom
> I call my inbox.
> 
> I also tested this with a Smart Array P420, P420i, and P430 in
> the system by ifdef'ing out the code for MSI-X and setting
> h->msix_vector = 0, to force it down the MSI path, and that all
> appears to work. 

Thank you, Steve!
If your Ack apply to 08/23 or to 09/23 as well?

> -- steve
> 

-- 
Regards,
Alexander Gordeev
agordeev@redhat.com

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

* RE: [PATCH v2 RESEND 04/23] bfa: Use pci_enable_msix_exact() instead of pci_enable_msix()
  2014-08-12 10:50       ` Alexander Gordeev
@ 2014-08-14  2:55           ` Anil Gurumurthy
  0 siblings, 0 replies; 85+ messages in thread
From: Anil Gurumurthy @ 2014-08-14  2:55 UTC (permalink / raw)
  To: Alexander Gordeev; +Cc: linux-kernel, linux-scsi, linux-pci, Sudarsana Kalluru

Hi Alexander,
  I believe I acked the series already, if not, I am acking all the bfa patches in this series.

Thanks,
Anil

-----Original Message-----
From: Alexander Gordeev [mailto:agordeev@redhat.com] 
Sent: 12 August 2014 16:20
To: Anil Gurumurthy
Cc: linux-kernel; Anil Gurumurthy; Vijaya Mohan Guvva; linux-scsi; linux-pci; Sudarsana Kalluru
Subject: Re: [PATCH v2 RESEND 04/23] bfa: Use pci_enable_msix_exact() instead of pci_enable_msix()

On Mon, Aug 11, 2014 at 11:02:56AM +0000, Anil Gurumurthy wrote:
> Acked-by: Anil Gurumurthy <anil.gurumurthy@qlogic.com>

Many thanks, Anil!

If your Ack apply to this patch only or to all three 'bfa' patches in this series?

Thanks!

> -----Original Message-----
> From: Alexander Gordeev [mailto:agordeev@redhat.com]
> Sent: 11 August 2014 13:09
> To: linux-kernel
> Cc: Anil Gurumurthy; Vijaya Mohan Guvva; linux-scsi; linux-pci; Anil 
> Gurumurthy; Sudarsana Kalluru
> Subject: Re: [PATCH v2 RESEND 04/23] bfa: Use pci_enable_msix_exact() 
> instead of pci_enable_msix()
> 
> On Wed, Jul 16, 2014 at 08:05:08PM +0200, Alexander Gordeev wrote:
> > As result of deprecation of MSI-X/MSI enablement functions
> > pci_enable_msix() and pci_enable_msi_block() all drivers using these 
> > two interfaces need to be updated to use the new
> > pci_enable_msi_range()  or pci_enable_msi_exact() and
> > pci_enable_msix_range() or pci_enable_msix_exact() interfaces.
> 
> Anil, Sudarsana,
> 
> Could you please review bfa patches in this series?
> 
> Thanks!
> 
> > Signed-off-by: Alexander Gordeev <agordeev@redhat.com>
> > Cc: Anil Gurumurthy <agurumur@brocade.com>
> > Cc: Vijaya Mohan Guvva <vmohan@brocade.com>
> > Cc: linux-scsi@vger.kernel.org
> > Cc: linux-pci@vger.kernel.org
> > Acked-by: Anil Gurumurthy <anil.gurumurthy@qlogic.com>
> > ---
> >  drivers/scsi/bfa/bfad.c |   20 ++++++--------------
> >  1 files changed, 6 insertions(+), 14 deletions(-)
> > 
> > diff --git a/drivers/scsi/bfa/bfad.c b/drivers/scsi/bfa/bfad.c index
> > c18279f..e90a374 100644
> > --- a/drivers/scsi/bfa/bfad.c
> > +++ b/drivers/scsi/bfa/bfad.c
> > @@ -1234,29 +1234,21 @@ bfad_setup_intr(struct bfad_s *bfad)
> >  	if ((bfa_asic_id_ctc(pdev->device) && !msix_disable_ct) ||
> >  	   (bfa_asic_id_cb(pdev->device) && !msix_disable_cb)) {
> >  
> > -		error = pci_enable_msix(bfad->pcidev, msix_entries, bfad->nvec);
> > +		error = pci_enable_msix_exact(bfad->pcidev,
> > +					      msix_entries, bfad->nvec);
> >  		/* In CT1 & CT2, try to allocate just one vector */
> > -		if (error > 0 && bfa_asic_id_ctc(pdev->device)) {
> > +		if (error == -ENOSPC && bfa_asic_id_ctc(pdev->device)) {
> >  			printk(KERN_WARNING "bfa %s: trying one msix "
> >  			       "vector failed to allocate %d[%d]\n",
> >  			       bfad->pci_name, bfad->nvec, error);
> >  			bfad->nvec = 1;
> > -			error = pci_enable_msix(bfad->pcidev,
> > -						msix_entries, bfad->nvec);
> > +			error = pci_enable_msix_exact(bfad->pcidev,
> > +						      msix_entries, 1);
> >  		}
> >  
> > -		/*
> > -		 * Only error number of vector is available.
> > -		 * We don't have a mechanism to map multiple
> > -		 * interrupts into one vector, so even if we
> > -		 * can try to request less vectors, we don't
> > -		 * know how to associate interrupt events to
> > -		 *  vectors. Linux doesn't duplicate vectors
> > -		 * in the MSIX table for this case.
> > -		 */
> >  		if (error) {
> >  			printk(KERN_WARNING "bfad%d: "
> > -			       "pci_enable_msix failed (%d), "
> > +			       "pci_enable_msix_exact failed (%d), "
> >  			       "use line based.\n",
> >  				bfad->inst_no, error);
> >  			goto line_based;
> > --
> > 1.7.7.6
> > 

--
Regards,
Alexander Gordeev
agordeev@redhat.com

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

* RE: [PATCH v2 RESEND 04/23] bfa: Use pci_enable_msix_exact() instead of pci_enable_msix()
@ 2014-08-14  2:55           ` Anil Gurumurthy
  0 siblings, 0 replies; 85+ messages in thread
From: Anil Gurumurthy @ 2014-08-14  2:55 UTC (permalink / raw)
  To: Alexander Gordeev; +Cc: linux-kernel, linux-scsi, linux-pci, Sudarsana Kalluru

[-- Attachment #1: Type: text/plain, Size: 3802 bytes --]

Hi Alexander,
  I believe I acked the series already, if not, I am acking all the bfa patches in this series.

Thanks,
Anil

-----Original Message-----
From: Alexander Gordeev [mailto:agordeev@redhat.com] 
Sent: 12 August 2014 16:20
To: Anil Gurumurthy
Cc: linux-kernel; Anil Gurumurthy; Vijaya Mohan Guvva; linux-scsi; linux-pci; Sudarsana Kalluru
Subject: Re: [PATCH v2 RESEND 04/23] bfa: Use pci_enable_msix_exact() instead of pci_enable_msix()

On Mon, Aug 11, 2014 at 11:02:56AM +0000, Anil Gurumurthy wrote:
> Acked-by: Anil Gurumurthy <anil.gurumurthy@qlogic.com>

Many thanks, Anil!

If your Ack apply to this patch only or to all three 'bfa' patches in this series?

Thanks!

> -----Original Message-----
> From: Alexander Gordeev [mailto:agordeev@redhat.com]
> Sent: 11 August 2014 13:09
> To: linux-kernel
> Cc: Anil Gurumurthy; Vijaya Mohan Guvva; linux-scsi; linux-pci; Anil 
> Gurumurthy; Sudarsana Kalluru
> Subject: Re: [PATCH v2 RESEND 04/23] bfa: Use pci_enable_msix_exact() 
> instead of pci_enable_msix()
> 
> On Wed, Jul 16, 2014 at 08:05:08PM +0200, Alexander Gordeev wrote:
> > As result of deprecation of MSI-X/MSI enablement functions
> > pci_enable_msix() and pci_enable_msi_block() all drivers using these 
> > two interfaces need to be updated to use the new
> > pci_enable_msi_range()  or pci_enable_msi_exact() and
> > pci_enable_msix_range() or pci_enable_msix_exact() interfaces.
> 
> Anil, Sudarsana,
> 
> Could you please review bfa patches in this series?
> 
> Thanks!
> 
> > Signed-off-by: Alexander Gordeev <agordeev@redhat.com>
> > Cc: Anil Gurumurthy <agurumur@brocade.com>
> > Cc: Vijaya Mohan Guvva <vmohan@brocade.com>
> > Cc: linux-scsi@vger.kernel.org
> > Cc: linux-pci@vger.kernel.org
> > Acked-by: Anil Gurumurthy <anil.gurumurthy@qlogic.com>
> > ---
> >  drivers/scsi/bfa/bfad.c |   20 ++++++--------------
> >  1 files changed, 6 insertions(+), 14 deletions(-)
> > 
> > diff --git a/drivers/scsi/bfa/bfad.c b/drivers/scsi/bfa/bfad.c index
> > c18279f..e90a374 100644
> > --- a/drivers/scsi/bfa/bfad.c
> > +++ b/drivers/scsi/bfa/bfad.c
> > @@ -1234,29 +1234,21 @@ bfad_setup_intr(struct bfad_s *bfad)
> >  	if ((bfa_asic_id_ctc(pdev->device) && !msix_disable_ct) ||
> >  	   (bfa_asic_id_cb(pdev->device) && !msix_disable_cb)) {
> >  
> > -		error = pci_enable_msix(bfad->pcidev, msix_entries, bfad->nvec);
> > +		error = pci_enable_msix_exact(bfad->pcidev,
> > +					      msix_entries, bfad->nvec);
> >  		/* In CT1 & CT2, try to allocate just one vector */
> > -		if (error > 0 && bfa_asic_id_ctc(pdev->device)) {
> > +		if (error == -ENOSPC && bfa_asic_id_ctc(pdev->device)) {
> >  			printk(KERN_WARNING "bfa %s: trying one msix "
> >  			       "vector failed to allocate %d[%d]\n",
> >  			       bfad->pci_name, bfad->nvec, error);
> >  			bfad->nvec = 1;
> > -			error = pci_enable_msix(bfad->pcidev,
> > -						msix_entries, bfad->nvec);
> > +			error = pci_enable_msix_exact(bfad->pcidev,
> > +						      msix_entries, 1);
> >  		}
> >  
> > -		/*
> > -		 * Only error number of vector is available.
> > -		 * We don't have a mechanism to map multiple
> > -		 * interrupts into one vector, so even if we
> > -		 * can try to request less vectors, we don't
> > -		 * know how to associate interrupt events to
> > -		 *  vectors. Linux doesn't duplicate vectors
> > -		 * in the MSIX table for this case.
> > -		 */
> >  		if (error) {
> >  			printk(KERN_WARNING "bfad%d: "
> > -			       "pci_enable_msix failed (%d), "
> > +			       "pci_enable_msix_exact failed (%d), "
> >  			       "use line based.\n",
> >  				bfad->inst_no, error);
> >  			goto line_based;
> > --
> > 1.7.7.6
> > 

--
Regards,
Alexander Gordeev
agordeev@redhat.com

[-- Attachment #2: winmail.dat --]
[-- Type: application/ms-tnef, Size: 5934 bytes --]

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

* Re: [PATCH v2 RESEND 09/23] hpsa: Use pci_enable_msix_range() instead of pci_enable_msix()
  2014-07-16 18:05 ` [PATCH v2 RESEND 09/23] hpsa: Use pci_enable_msix_range() instead of pci_enable_msix() Alexander Gordeev
@ 2014-08-15 15:48   ` scameron
  0 siblings, 0 replies; 85+ messages in thread
From: scameron @ 2014-08-15 15:48 UTC (permalink / raw)
  To: Alexander Gordeev
  Cc: linux-kernel, iss_storagedev, linux-scsi, linux-pci, scameron

On Wed, Jul 16, 2014 at 08:05:13PM +0200, Alexander Gordeev wrote:
> As result of deprecation of MSI-X/MSI enablement functions
> pci_enable_msix() and pci_enable_msi_block() all drivers
> using these two interfaces need to be updated to use the
> new pci_enable_msi_range()  or pci_enable_msi_exact()
> and pci_enable_msix_range() or pci_enable_msix_exact()
> interfaces.
> 
> Cc: "Stephen M. Cameron" <scameron@beardog.cce.hp.com>
> Cc: iss_storagedev@hp.com
> Cc: linux-scsi@vger.kernel.org
> Cc: linux-pci@vger.kernel.org
> Signed-off-by: Alexander Gordeev <agordeev@redhat.com>
> ---
>  drivers/scsi/hpsa.c |   27 ++++++++++++---------------
>  1 files changed, 12 insertions(+), 15 deletions(-)
> 
> diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c
> index 648dec2..5c4ab6e 100644
> --- a/drivers/scsi/hpsa.c
> +++ b/drivers/scsi/hpsa.c
> @@ -6160,25 +6160,22 @@ static void hpsa_interrupt_mode(struct ctlr_info *h)
>  		h->msix_vector = MAX_REPLY_QUEUES;
>  		if (h->msix_vector > num_online_cpus())
>  			h->msix_vector = num_online_cpus();
> -		err = pci_enable_msix(h->pdev, hpsa_msix_entries,
> -				      h->msix_vector);
> -		if (err > 0) {
> +		err = pci_enable_msix_range(h->pdev, hpsa_msix_entries,
> +					    1, h->msix_vector);
> +		if (err < 0) {
> +			dev_warn(&h->pdev->dev, "MSI-X init failed %d\n", err);
> +			h->msix_vector = 0;
> +			goto single_msi_mode;
> +		} else if (err < h->msix_vector) {
>  			dev_warn(&h->pdev->dev, "only %d MSI-X vectors "
>  			       "available\n", err);
> -			h->msix_vector = err;
> -			err = pci_enable_msix(h->pdev, hpsa_msix_entries,
> -					      h->msix_vector);
> -		}
> -		if (!err) {
> -			for (i = 0; i < h->msix_vector; i++)
> -				h->intr[i] = hpsa_msix_entries[i].vector;
> -			return;
> -		} else {
> -			dev_warn(&h->pdev->dev, "MSI-X init failed %d\n",
> -			       err);
> -			h->msix_vector = 0;
>  		}
> +		h->msix_vector = err;
> +		for (i = 0; i < h->msix_vector; i++)
> +			h->intr[i] = hpsa_msix_entries[i].vector;
> +		return;
>  	}
> +single_msi_mode:
>  	if (pci_find_capability(h->pdev, PCI_CAP_ID_MSI)) {
>  		dev_info(&h->pdev->dev, "MSI\n");
>  		if (!pci_enable_msi(h->pdev))
> -- 
> 1.7.7.6

Ack. 

I had previously acked an older, but seemingly semantically identical patch.
Was requested to ack this one as well.

-- steve


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

* [PATCH v2 RESEND 07/23] fnic: Use pci_enable_msix_exact() instead of pci_enable_msix()
  2014-04-14  8:05 Alexander Gordeev
@ 2014-04-14  8:05 ` Alexander Gordeev
  0 siblings, 0 replies; 85+ messages in thread
From: Alexander Gordeev @ 2014-04-14  8:05 UTC (permalink / raw)
  To: linux-kernel
  Cc: Alexander Gordeev, Hiral Patel, Suma Ramars, Brian Uchino,
	linux-scsi, linux-pci

As result of deprecation of MSI-X/MSI enablement functions
pci_enable_msix() and pci_enable_msi_block() all drivers
using these two interfaces need to be updated to use the
new pci_enable_msi_range()  or pci_enable_msi_exact()
and pci_enable_msix_range() or pci_enable_msix_exact()
interfaces.

Signed-off-by: Alexander Gordeev <agordeev@redhat.com>
Cc: Hiral Patel <hiralpat@cisco.com>
Cc: Suma Ramars <sramars@cisco.com>
Cc: Brian Uchino <buchino@cisco.com>
Cc: linux-scsi@vger.kernel.org
Cc: linux-pci@vger.kernel.org
---
 drivers/scsi/fnic/fnic_isr.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/fnic/fnic_isr.c b/drivers/scsi/fnic/fnic_isr.c
index 7d9b54a..a0dd1b6 100644
--- a/drivers/scsi/fnic/fnic_isr.c
+++ b/drivers/scsi/fnic/fnic_isr.c
@@ -257,8 +257,8 @@ int fnic_set_intr_mode(struct fnic *fnic)
 	    fnic->raw_wq_count >= m &&
 	    fnic->wq_copy_count >= o &&
 	    fnic->cq_count >= n + m + o) {
-		if (!pci_enable_msix(fnic->pdev, fnic->msix_entry,
-				    n + m + o + 1)) {
+		if (!pci_enable_msix_exact(fnic->pdev, fnic->msix_entry,
+					   n + m + o + 1)) {
 			fnic->rq_count = n;
 			fnic->raw_wq_count = m;
 			fnic->wq_copy_count = o;
-- 
1.7.7.6


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

end of thread, other threads:[~2014-08-15 15:48 UTC | newest]

Thread overview: 85+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-07-16 18:05 [PATCH v2 RESEND 00/23] scsi: Use pci_enable_msix_range() instead of pci_enable_msix() Alexander Gordeev
2014-07-16 18:05 ` [PATCH v2 RESEND 01/23] be2iscsi: Use pci_enable_msix_exact() " Alexander Gordeev
2014-07-26  8:08   ` Alexander Gordeev
2014-07-28 23:29     ` Jayamohan Kallickal
2014-08-11  7:34       ` Alexander Gordeev
2014-07-16 18:05 ` [PATCH v2 RESEND 02/23] bfa: Do not call pci_enable_msix() after it failed once Alexander Gordeev
2014-07-16 18:05 ` [PATCH v2 RESEND 03/23] bfa: Cleanup bfad_setup_intr() function Alexander Gordeev
2014-07-16 18:05 ` [PATCH v2 RESEND 04/23] bfa: Use pci_enable_msix_exact() instead of pci_enable_msix() Alexander Gordeev
2014-08-11  7:39   ` Alexander Gordeev
2014-08-11 11:02     ` Anil Gurumurthy
2014-08-11 11:02       ` Anil Gurumurthy
2014-08-12 10:50       ` Alexander Gordeev
2014-08-14  2:55         ` Anil Gurumurthy
2014-08-14  2:55           ` Anil Gurumurthy
2014-07-16 18:05 ` [PATCH v2 RESEND 05/23] csiostor: Remove superfluous call to pci_disable_msix() Alexander Gordeev
2014-07-26  8:13   ` Alexander Gordeev
2014-07-16 18:05 ` [PATCH v2 RESEND 06/23] csiostor: Use pci_enable_msix_range() instead of pci_enable_msix() Alexander Gordeev
2014-08-11  7:49   ` Alexander Gordeev
2014-07-16 18:05 ` [PATCH v2 RESEND 07/23] fnic: Use pci_enable_msix_exact() " Alexander Gordeev
2014-07-26  8:15   ` Alexander Gordeev
2014-07-28  8:08     ` Suma Ramars (sramars)
2014-07-16 18:05 ` [PATCH v2 RESEND 08/23] hpsa: Fallback to MSI rather than to INTx if MSI-X failed Alexander Gordeev
2014-07-26  8:16   ` Alexander Gordeev
2014-08-11  7:53     ` Alexander Gordeev
2014-08-13 16:04   ` scameron
2014-08-13 17:05     ` Alexander Gordeev
2014-07-16 18:05 ` [PATCH v2 RESEND 09/23] hpsa: Use pci_enable_msix_range() instead of pci_enable_msix() Alexander Gordeev
2014-08-15 15:48   ` scameron
2014-07-16 18:05 ` [PATCH v2 RESEND 10/23] isci: Use pci_enable_msix_exact() " Alexander Gordeev
2014-08-11  7:57   ` Alexander Gordeev
2014-08-11  7:57     ` Alexander Gordeev
     [not found]   ` <718e4066d6294033a7590659cf0f3c4d@fmsmsx106.amr.corp.intel.com>
2014-08-11 16:55     ` Jiang, Dave
2014-08-11 16:55       ` Jiang, Dave
2014-07-16 18:05 ` [PATCH v2 RESEND 11/23] lpfc: Remove superfluous call to pci_disable_msix() Alexander Gordeev
2014-07-16 18:05 ` [PATCH v2 RESEND 12/23] lpfc: Use pci_enable_msix_range() instead of pci_enable_msix() Alexander Gordeev
2014-07-26  8:22   ` Alexander Gordeev
2014-08-11  8:01     ` Alexander Gordeev
2014-08-11 17:14       ` James Smart
2014-08-11 17:14         ` James Smart
2014-08-12  8:11         ` Alexander Gordeev
2014-08-12  8:09           ` [PATCH v3 " Alexander Gordeev
2014-07-16 18:05 ` [PATCH v2 RESEND 13/23] megaraid: Fail resume if MSI-X re-initialization failed Alexander Gordeev
2014-07-26  8:24   ` Alexander Gordeev
2014-07-28  5:56     ` Kashyap Desai
2014-08-11  8:07       ` Alexander Gordeev
2014-07-16 18:05 ` [PATCH v2 RESEND 14/23] megaraid: Use pci_enable_msix_range() instead of pci_enable_msix() Alexander Gordeev
2014-08-11  8:09   ` Alexander Gordeev
2014-08-11  8:29     ` Kashyap Desai
2014-07-16 18:05 ` [PATCH v2 RESEND 15/23] mpt2sas: Use pci_enable_msix_exact() " Alexander Gordeev
2014-07-26  8:26   ` Alexander Gordeev
2014-08-11 13:07   ` Tomas Henzl
2014-07-16 18:05 ` [PATCH v2 RESEND 16/23] mpt3sas: " Alexander Gordeev
2014-08-11  8:13   ` Alexander Gordeev
2014-08-11 13:07   ` Tomas Henzl
2014-07-16 18:05 ` [PATCH v2 RESEND 17/23] pm8001: Fix invalid return when request_irq() failed Alexander Gordeev
2014-07-29 13:13   ` Tomas Henzl
2014-07-29 13:20     ` Christoph Hellwig
2014-07-29 13:48       ` Tomas Henzl
2014-07-29 13:56         ` Christoph Hellwig
2014-07-29 14:15           ` Alexander Gordeev
2014-07-29 14:24             ` Christoph Hellwig
2014-08-11  8:14               ` Alexander Gordeev
2014-07-16 18:05 ` [PATCH v2 RESEND 18/23] pm8001: Use pci_enable_msix_exact() instead of pci_enable_msix() Alexander Gordeev
2014-07-26  8:33   ` Alexander Gordeev
2014-07-27 10:29     ` Jack Wang
2014-07-16 18:05 ` [PATCH v2 RESEND 19/23] pmcraid: Get rid of a redundant assignment Alexander Gordeev
2014-07-16 18:05 ` [PATCH v2 RESEND 20/23] pmcraid: Use pci_enable_msix_range() instead of pci_enable_msix() Alexander Gordeev
2014-07-26  8:37   ` Alexander Gordeev
2014-08-11  7:44   ` Alexander Gordeev
2014-07-16 18:05 ` [PATCH v2 RESEND 21/23] qla2xxx: " Alexander Gordeev
2014-07-26  8:40   ` Alexander Gordeev
2014-08-11  8:57   ` Alexander Gordeev
2014-08-11 18:07     ` Chad Dupuis
2014-08-11 18:07       ` Chad Dupuis
2014-07-16 18:05 ` [PATCH v2 RESEND 22/23] qla4xxx: Use pci_enable_msix_exact() " Alexander Gordeev
2014-07-26  8:41   ` Alexander Gordeev
2014-07-28 11:47     ` Vikas Chaudhary
2014-07-28 11:47       ` Vikas Chaudhary
2014-08-11  8:54       ` Alexander Gordeev
2014-08-11  9:40         ` Christoph Hellwig
2014-07-16 18:05 ` [PATCH v2 RESEND 23/23] vmw_pvscsi: " Alexander Gordeev
2014-07-16 18:23   ` Arvind Kumar
2014-07-17 20:28 ` [PATCH v2 RESEND 00/23] scsi: Use pci_enable_msix_range() " Christoph Hellwig
2014-07-29 12:38   ` Christoph Hellwig
  -- strict thread matches above, loose matches on Subject: below --
2014-04-14  8:05 Alexander Gordeev
2014-04-14  8:05 ` [PATCH v2 RESEND 07/23] fnic: Use pci_enable_msix_exact() " Alexander Gordeev

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.