Blame SOURCES/0123-scsi-scsi-qla2xxx-Fix-driver-reload-for-ISP82xx.patch

3c6e85
From 7aa925496676369431b45e4ec82bd419df9b3e8b Mon Sep 17 00:00:00 2001
3c6e85
From: Himanshu Madhani <hmadhani@redhat.com>
3c6e85
Date: Tue, 10 Sep 2019 01:07:19 -0400
3c6e85
Subject: [PATCH 123/124] [scsi] scsi: qla2xxx: Fix driver reload for ISP82xx
3c6e85
3c6e85
Message-id: <20190910010719.22540-3-hmadhani@redhat.com>
3c6e85
Patchwork-id: 271159
3c6e85
O-Subject: [RHEL7.8 e-stor PATCH 2/2] scsi: qla2xxx: Fix driver reload for ISP82xx
3c6e85
Bugzilla: 1743185
3c6e85
RH-Acked-by: Jarod Wilson <jarod@redhat.com>
3c6e85
RH-Acked-by: Ewan Milne <emilne@redhat.com>
3c6e85
3c6e85
From: Himanshu Madhani <hmadhani@marvell.com>
3c6e85
3c6e85
Bugzilla 1743185
3c6e85
3c6e85
HINT_MBX_INT_PENDING is not guaranteed to be cleared by firmware. Remove
3c6e85
check that prevent driver load with ISP82XX.
3c6e85
3c6e85
Signed-off-by: Quinn Tran <qutran@marvell.com>
3c6e85
Signed-off-by: Himanshu Madhani <hmadhani@marvell.com>
3c6e85
Reviewed-by: Ewan D. Milne <emilne@redhat.com>
3c6e85
Link: https://lore.kernel.org/r/20190830222402.23688-4-hmadhani@marvell.com
3c6e85
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
3c6e85
(cherry picked from commit 32a13df21668b92f70f0673387f29251e0f285ec)
3c6e85
Signed-off-by: Himanshu Madhani <hmadhani@redhat.com>
3c6e85
Signed-off-by: Jan Stancek <jstancek@redhat.com>
3c6e85
---
3c6e85
 drivers/scsi/qla2xxx/qla_mbx.c | 16 ++--------------
3c6e85
 drivers/scsi/qla2xxx/qla_nx.c  |  3 ++-
3c6e85
 2 files changed, 4 insertions(+), 15 deletions(-)
3c6e85
3c6e85
diff --git a/drivers/scsi/qla2xxx/qla_mbx.c b/drivers/scsi/qla2xxx/qla_mbx.c
3c6e85
index 88ff41dd40cd..11a4c4bd62fc 100644
3c6e85
--- a/drivers/scsi/qla2xxx/qla_mbx.c
3c6e85
+++ b/drivers/scsi/qla2xxx/qla_mbx.c
3c6e85
@@ -253,21 +253,9 @@ qla2x00_mailbox_command(scsi_qla_host_t *vha, mbx_cmd_t *mcp)
3c6e85
 	if ((!abort_active && io_lock_on) || IS_NOPOLLING_TYPE(ha)) {
3c6e85
 		set_bit(MBX_INTR_WAIT, &ha->mbx_cmd_flags);
3c6e85
 
3c6e85
-		if (IS_P3P_TYPE(ha)) {
3c6e85
-			if (RD_REG_DWORD(&reg->isp82.hint) &
3c6e85
-				HINT_MBX_INT_PENDING) {
3c6e85
-				ha->flags.mbox_busy = 0;
3c6e85
-				spin_unlock_irqrestore(&ha->hardware_lock,
3c6e85
-					flags);
3c6e85
-
3c6e85
-				atomic_dec(&ha->num_pend_mbx_stage2);
3c6e85
-				ql_dbg(ql_dbg_mbx, vha, 0x1010,
3c6e85
-				    "Pending mailbox timeout, exiting.\n");
3c6e85
-				rval = QLA_FUNCTION_TIMEOUT;
3c6e85
-				goto premature_exit;
3c6e85
-			}
3c6e85
+		if (IS_P3P_TYPE(ha))
3c6e85
 			WRT_REG_DWORD(&reg->isp82.hint, HINT_MBX_INT_PENDING);
3c6e85
-		} else if (IS_FWI2_CAPABLE(ha))
3c6e85
+		else if (IS_FWI2_CAPABLE(ha))
3c6e85
 			WRT_REG_DWORD(&reg->isp24.hccr, HCCRX_SET_HOST_INT);
3c6e85
 		else
3c6e85
 			WRT_REG_WORD(&reg->isp.hccr, HCCR_SET_HOST_INT);
3c6e85
diff --git a/drivers/scsi/qla2xxx/qla_nx.c b/drivers/scsi/qla2xxx/qla_nx.c
3c6e85
index e90de07a0ee2..397226994341 100644
3c6e85
--- a/drivers/scsi/qla2xxx/qla_nx.c
3c6e85
+++ b/drivers/scsi/qla2xxx/qla_nx.c
3c6e85
@@ -2283,7 +2283,8 @@ qla82xx_disable_intrs(struct qla_hw_data *ha)
3c6e85
 {
3c6e85
 	scsi_qla_host_t *vha = pci_get_drvdata(ha->pdev);
3c6e85
 
3c6e85
-	qla82xx_mbx_intr_disable(vha);
3c6e85
+	if (ha->interrupts_on)
3c6e85
+		qla82xx_mbx_intr_disable(vha);
3c6e85
 
3c6e85
 	spin_lock_irq(&ha->hardware_lock);
3c6e85
 	if (IS_QLA8044(ha))
3c6e85
-- 
3c6e85
2.13.6
3c6e85