All of lore.kernel.org
 help / color / mirror / Atom feed
From: Himanshu Madhani <hmadhani@marvell.com>
To: <James.Bottomley@HansenPartnership.com>, <martin.petersen@oracle.com>
Cc: <hmadhani@marvell.com>, <linux-scsi@vger.kernel.org>
Subject: [PATCH 07/18] qla2xxx: Use a dedicated interrupt handler for 'handshake-required' ISPs
Date: Wed, 26 Feb 2020 14:40:11 -0800	[thread overview]
Message-ID: <20200226224022.24518-8-hmadhani@marvell.com> (raw)
In-Reply-To: <20200226224022.24518-1-hmadhani@marvell.com>

From: Andrew Vasquez <andrewv@marvell.com>

There's no point checking flags.disable_msix_handshake in the
interrupt handler hot-path.  Instead perform the check during
queue-pair instantiation and use the proper interrupt handler.

Signed-off-by: Andrew Vasquez <andrewv@marvell.com>
Signed-off-by: Himanshu Madhani <hmadhani@marvell.com>
---
 drivers/scsi/qla2xxx/qla_def.h |  1 +
 drivers/scsi/qla2xxx/qla_gbl.h |  2 ++
 drivers/scsi/qla2xxx/qla_isr.c | 31 ++++++++++++++++++++++++-------
 drivers/scsi/qla2xxx/qla_mid.c |  3 ++-
 4 files changed, 29 insertions(+), 8 deletions(-)

diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h
index 17367639953c..1104b7837450 100644
--- a/drivers/scsi/qla2xxx/qla_def.h
+++ b/drivers/scsi/qla2xxx/qla_def.h
@@ -3250,6 +3250,7 @@ struct isp_operations {
 #define QLA_MSIX_RSP_Q			0x01
 #define QLA_ATIO_VECTOR		0x02
 #define QLA_MSIX_QPAIR_MULTIQ_RSP_Q	0x03
+#define QLA_MSIX_QPAIR_MULTIQ_RSP_Q_HS	0x04
 
 #define QLA_MIDX_DEFAULT	0
 #define QLA_MIDX_RSP_Q		1
diff --git a/drivers/scsi/qla2xxx/qla_gbl.h b/drivers/scsi/qla2xxx/qla_gbl.h
index 73b663defee1..33ea79181dd7 100644
--- a/drivers/scsi/qla2xxx/qla_gbl.h
+++ b/drivers/scsi/qla2xxx/qla_gbl.h
@@ -565,6 +565,8 @@ qla2x00_process_completed_request(struct scsi_qla_host *, struct req_que *,
 	uint32_t);
 extern irqreturn_t
 qla2xxx_msix_rsp_q(int irq, void *dev_id);
+extern irqreturn_t
+qla2xxx_msix_rsp_q_hs(int irq, void *dev_id);
 fc_port_t *qla2x00_find_fcport_by_loopid(scsi_qla_host_t *, uint16_t);
 fc_port_t *qla2x00_find_fcport_by_wwpn(scsi_qla_host_t *, u8 *, u8);
 fc_port_t *qla2x00_find_fcport_by_nportid(scsi_qla_host_t *, port_id_t *, u8);
diff --git a/drivers/scsi/qla2xxx/qla_isr.c b/drivers/scsi/qla2xxx/qla_isr.c
index 7c0c32d5d6ec..2c6e25f831f3 100644
--- a/drivers/scsi/qla2xxx/qla_isr.c
+++ b/drivers/scsi/qla2xxx/qla_isr.c
@@ -3601,6 +3601,25 @@ qla2xxx_msix_rsp_q(int irq, void *dev_id)
 {
 	struct qla_hw_data *ha;
 	struct qla_qpair *qpair;
+
+	qpair = dev_id;
+	if (!qpair) {
+		ql_log(ql_log_info, NULL, 0x505b,
+		    "%s: NULL response queue pointer.\n", __func__);
+		return IRQ_NONE;
+	}
+	ha = qpair->hw;
+
+	queue_work(ha->wq, &qpair->q_work);
+
+	return IRQ_HANDLED;
+}
+
+irqreturn_t
+qla2xxx_msix_rsp_q_hs(int irq, void *dev_id)
+{
+	struct qla_hw_data *ha;
+	struct qla_qpair *qpair;
 	struct device_reg_24xx __iomem *reg;
 	unsigned long flags;
 
@@ -3612,13 +3631,10 @@ qla2xxx_msix_rsp_q(int irq, void *dev_id)
 	}
 	ha = qpair->hw;
 
-	/* Clear the interrupt, if enabled, for this response queue */
-	if (unlikely(!ha->flags.disable_msix_handshake)) {
-		reg = &ha->iobase->isp24;
-		spin_lock_irqsave(&ha->hardware_lock, flags);
-		WRT_REG_DWORD(&reg->hccr, HCCRX_CLR_RISC_INT);
-		spin_unlock_irqrestore(&ha->hardware_lock, flags);
-	}
+	reg = &ha->iobase->isp24;
+	spin_lock_irqsave(&ha->hardware_lock, flags);
+	WRT_REG_DWORD(&reg->hccr, HCCRX_CLR_RISC_INT);
+	spin_unlock_irqrestore(&ha->hardware_lock, flags);
 
 	queue_work(ha->wq, &qpair->q_work);
 
@@ -3637,6 +3653,7 @@ static const struct qla_init_msix_entry msix_entries[] = {
 	{ "rsp_q", qla24xx_msix_rsp_q },
 	{ "atio_q", qla83xx_msix_atio_q },
 	{ "qpair_multiq", qla2xxx_msix_rsp_q },
+	{ "qpair_multiq_hs", qla2xxx_msix_rsp_q_hs },
 };
 
 static const struct qla_init_msix_entry qla82xx_msix_entries[] = {
diff --git a/drivers/scsi/qla2xxx/qla_mid.c b/drivers/scsi/qla2xxx/qla_mid.c
index e86c94f78196..d82e92da529a 100644
--- a/drivers/scsi/qla2xxx/qla_mid.c
+++ b/drivers/scsi/qla2xxx/qla_mid.c
@@ -896,7 +896,8 @@ qla25xx_create_rsp_que(struct qla_hw_data *ha, uint16_t options,
 	    rsp->rsp_q_out);
 
 	ret = qla25xx_request_irq(ha, qpair, qpair->msix,
-	    QLA_MSIX_QPAIR_MULTIQ_RSP_Q);
+		ha->flags.disable_msix_handshake ?
+		QLA_MSIX_QPAIR_MULTIQ_RSP_Q : QLA_MSIX_QPAIR_MULTIQ_RSP_Q_HS);
 	if (ret)
 		goto que_failed;
 
-- 
2.12.0


  parent reply	other threads:[~2020-02-26 22:40 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-26 22:40 [PATCH 00/18] qla2xxx: fixes for the driver Himanshu Madhani
2020-02-26 22:40 ` [PATCH 01/18] qla2xxX: Add 16.0GT for PCI String Himanshu Madhani
2020-02-26 22:40 ` [PATCH 02/18] qla2xxx: Avoid setting firmware options twice in 24xx_update_fw_options Himanshu Madhani
2020-02-26 22:40 ` [PATCH 03/18] qla2xxx: Use FC generic update firmware options routine for ISP27xx Himanshu Madhani
2020-02-26 22:40 ` [PATCH 04/18] qla2xxx: Fix FCP-SCSI FC4 flag passing error Himanshu Madhani
2020-02-26 22:40 ` [PATCH 05/18] qla2xxx: Improved secure flash support messages Himanshu Madhani
2020-02-26 22:40 ` [PATCH 06/18] qla2xxx: Return appropriate failure through BSG Interface Himanshu Madhani
2020-02-26 22:40 ` Himanshu Madhani [this message]
2020-02-26 22:40 ` [PATCH 08/18] qla2xxx: fix FW resource count values Himanshu Madhani
2020-02-26 22:40 ` [PATCH 09/18] qla2xxx: Update BPM enablement semantics Himanshu Madhani
2020-02-26 22:40 ` [PATCH 10/18] qla2xxx: add more FW debug information Himanshu Madhani
2020-02-26 22:40 ` [PATCH 11/18] qla2xxx: Force semaphore on flash validation failure Himanshu Madhani
2020-02-26 22:40 ` [PATCH 12/18] qla2xxx: Fix RDP respond data format Himanshu Madhani
2020-02-26 22:40 ` [PATCH 13/18] qla2xxx: Fix NPIV instantiation after FW dump Himanshu Madhani
2020-02-26 22:40 ` [PATCH 14/18] qla2xxx: Serialize fc_port alloc in N2N Himanshu Madhani
2020-02-26 22:40 ` [PATCH 15/18] qla2xxx: Remove restriction of FC T10-PI and FC-NVMe Himanshu Madhani
2020-02-26 22:40 ` [PATCH 16/18] qla2xxx: Handle NVME status iocb correctly Himanshu Madhani
2020-02-26 22:40 ` [PATCH 17/18] qla2xxx: Set Nport ID for N2N Himanshu Madhani
2020-02-26 22:40 ` [PATCH 18/18] qla2xxx: Update driver version to 10.01.00.25-k Himanshu Madhani
2020-02-29  1:33 ` [PATCH 00/18] qla2xxx: fixes for the driver Martin K. Petersen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200226224022.24518-8-hmadhani@marvell.com \
    --to=hmadhani@marvell.com \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.