From e8f9ff32faea671534f95bab7ae4ac35a1961dd5 Mon Sep 17 00:00:00 2001
From: Himanshu Madhani <hmadhani@redhat.com>
Date: Thu, 1 Aug 2019 15:54:39 -0400
Subject: [PATCH 019/124] [scsi] scsi: qla2xxx: Check for FW started flag
before aborting
Message-id: <20190801155618.12650-20-hmadhani@redhat.com>
Patchwork-id: 267796
O-Subject: [RHEL 7.8 e-stor PATCH 019/118] scsi: qla2xxx: Check for FW started flag before aborting
Bugzilla: 1729270
RH-Acked-by: Jarod Wilson <jarod@redhat.com>
RH-Acked-by: Tony Camuso <tcamuso@redhat.com>
From: Himanshu Madhani <hmadhani@marvell.com>
Bugzilla 1729270
For FC-NVMe, if the fw_started flag is not set or fcport is deleted, then
do not send Abort command
Signed-off-by: Himanshu Madhani <hmadhani@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 471f8e03d74d9ea1084e7fbbba66ea2488b0c14f)
Signed-off-by: Himanshu Madhani <hmadhani@redhat.com>
Signed-off-by: Jan Stancek <jstancek@redhat.com>
---
drivers/scsi/qla2xxx/qla_nvme.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/drivers/scsi/qla2xxx/qla_nvme.c b/drivers/scsi/qla2xxx/qla_nvme.c
index cfd5a68e6533..53496b1bafb6 100644
--- a/drivers/scsi/qla2xxx/qla_nvme.c
+++ b/drivers/scsi/qla2xxx/qla_nvme.c
@@ -185,6 +185,14 @@ static void qla_nvme_abort_work(struct work_struct *work)
struct qla_hw_data *ha = fcport->vha->hw;
int rval;
+ if (fcport)
+ ql_dbg(ql_dbg_io, fcport->vha, 0xffff,
+ "%s called for sp=%p, hndl=%x on fcport=%p deleted=%d\n",
+ __func__, sp, sp->handle, fcport, fcport->deleted);
+
+ if (!ha->flags.fw_started && (fcport && fcport->deleted))
+ return;
+
rval = ha->isp_ops->abort_command(sp);
ql_dbg(ql_dbg_io, fcport->vha, 0x212b,
--
2.13.6