Blob Blame History Raw
From f615a5c65929978d0c1192086b31c6fd3174170a Mon Sep 17 00:00:00 2001
From: Himanshu Madhani <hmadhani@redhat.com>
Date: Thu, 1 Aug 2019 15:56:17 -0400
Subject: [PATCH 117/124] [scsi] scsi: qla2xxx: Reject
 EH_{abort|device_reset|target_request}

Message-id: <20190801155618.12650-118-hmadhani@redhat.com>
Patchwork-id: 267881
O-Subject: [RHEL 7.8 e-stor PATCH 117/118] scsi: qla2xxx: Reject EH_{abort|device_reset|target_request}
Bugzilla: 1729270
RH-Acked-by: Jarod Wilson <jarod@redhat.com>
RH-Acked-by: Tony Camuso <tcamuso@redhat.com>

From: Quinn Tran <qutran@marvell.com>

Bugzilla 1729270

Reject eh_{abort|device_reset|target_reset} when rport is being torn down
or chip is down.

Signed-off-by: Quinn Tran <quinn.tran@cavium.com>
Signed-off-by: Himanshu Madhani <hmadhani@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 7f4374e67b3046c9628cf0ab93a117704a38e95d)
Signed-off-by: Himanshu Madhani <hmadhani@redhat.com>
Signed-off-by: Jan Stancek <jstancek@redhat.com>
---
 drivers/scsi/qla2xxx/qla_os.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c
index fee4975787ec..542a97d713cc 100644
--- a/drivers/scsi/qla2xxx/qla_os.c
+++ b/drivers/scsi/qla2xxx/qla_os.c
@@ -1344,6 +1344,9 @@ qla2xxx_eh_abort(struct scsi_cmnd *cmd)
 	if (!qpair)
 		return SUCCESS;
 
+	if (sp->fcport && sp->fcport->deleted)
+		return SUCCESS;
+
 	spin_lock_irqsave(qpair->qp_lock_ptr, flags);
 	if (sp->type != SRB_SCSI_CMD || GET_CMD_SP(sp) != cmd) {
 		/* there's a chance an interrupt could clear
@@ -1468,6 +1471,9 @@ __qla2xxx_eh_generic_reset(char *name, enum nexus_wait_type type,
 	if (err != 0)
 		return err;
 
+	if (fcport->deleted)
+		return SUCCESS;
+
 	ql_log(ql_log_info, vha, 0x8009,
 	    "%s RESET ISSUED nexus=%ld:%d:%d cmd=%p.\n", name, vha->host_no,
 	    cmd->device->id, cmd->device->lun, cmd);
@@ -1581,6 +1587,9 @@ qla2xxx_eh_bus_reset(struct scsi_cmnd *cmd)
 		return ret;
 	ret = FAILED;
 
+	if (qla2x00_chip_is_down(vha))
+		return ret;
+
 	ql_log(ql_log_info, vha, 0x8012,
 	    "BUS RESET ISSUED nexus=%ld:%d:%d.\n", vha->host_no, id, lun);
 
-- 
2.13.6