Blob Blame History Raw
From 2a6ba2926dce7aa598e3800f6395a51ea5ca3cea Mon Sep 17 00:00:00 2001
From: Himanshu Madhani <hmadhani@redhat.com>
Date: Thu, 1 Aug 2019 15:56:11 -0400
Subject: [PATCH 111/124] [scsi] scsi: qla2xxx: Allow NVMe IO to resume with
 short cable pull

Message-id: <20190801155618.12650-112-hmadhani@redhat.com>
Patchwork-id: 267897
O-Subject: [RHEL 7.8 e-stor PATCH 111/118] scsi: qla2xxx: Allow NVMe IO to resume with short cable pull
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

Current driver report dev_loss_tmo to 0 for NVMe devices with short cable
pull.  This causes NVMe controller to be freed along with NVMe namespace.
The side affect is IO would stop.  By not setting dev_loss_tmo to 0, NVMe
namespace would stay until cable is plugged back in.  This allows IO to
resume afterward.

[mkp: commit desc]

Signed-off-by: Arun Easi <aeasi@marvell.com>
Signed-off-by: Quinn Tran <qutran@marvell.com>
Signed-off-by: Himanshu Madhani <hmadhani@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 727e9a39a33b1547e4b2091dd79b5596de451810)
Signed-off-by: Himanshu Madhani <hmadhani@redhat.com>
Signed-off-by: Jan Stancek <jstancek@redhat.com>
---
 drivers/scsi/qla2xxx/qla_nvme.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/scsi/qla2xxx/qla_nvme.c b/drivers/scsi/qla2xxx/qla_nvme.c
index 74fbe38eaae2..ad406511f2ec 100644
--- a/drivers/scsi/qla2xxx/qla_nvme.c
+++ b/drivers/scsi/qla2xxx/qla_nvme.c
@@ -671,7 +671,9 @@ void qla_nvme_unregister_remote_port(struct fc_port *fcport)
 	    "%s: unregister remoteport on %p %8phN\n",
 	    __func__, fcport, fcport->port_name);
 
-	nvme_fc_set_remoteport_devloss(fcport->nvme_remote_port, 0);
+	if (test_bit(PFLG_DRIVER_REMOVING, &fcport->vha->pci_flags))
+		nvme_fc_set_remoteport_devloss(fcport->nvme_remote_port, 0);
+
 	init_completion(&fcport->nvme_del_done);
 	ret = nvme_fc_unregister_remoteport(fcport->nvme_remote_port);
 	if (ret)
-- 
2.13.6