Blame SOURCES/0018-scsi-scsi-qla2xxx-Fix-unload-when-NVMe-devices-are-c.patch

3c6e85
From 75c361cd6bc59eaca88eeebf44b73eb5fd9462e2 Mon Sep 17 00:00:00 2001
3c6e85
From: Himanshu Madhani <hmadhani@redhat.com>
3c6e85
Date: Thu, 1 Aug 2019 15:54:38 -0400
3c6e85
Subject: [PATCH 018/124] [scsi] scsi: qla2xxx: Fix unload when NVMe devices
3c6e85
 are configured
3c6e85
3c6e85
Message-id: <20190801155618.12650-19-hmadhani@redhat.com>
3c6e85
Patchwork-id: 267794
3c6e85
O-Subject: [RHEL 7.8 e-stor PATCH 018/118] scsi: qla2xxx: Fix unload when NVMe devices are configured
3c6e85
Bugzilla: 1729270
3c6e85
RH-Acked-by: Jarod Wilson <jarod@redhat.com>
3c6e85
RH-Acked-by: Tony Camuso <tcamuso@redhat.com>
3c6e85
3c6e85
From: Himanshu Madhani <hmadhani@marvell.com>
3c6e85
3c6e85
Bugzilla 1729270
3c6e85
3c6e85
This patch fixes driver unload issue when FC-NVMe devices are configured.
3c6e85
3c6e85
Signed-off-by: Himanshu Madhani <hmadhani@marvell.com>
3c6e85
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
3c6e85
(cherry picked from commit e476fe8af5ff2102ae622c8bf910d8f7e83eb84e)
3c6e85
Signed-off-by: Himanshu Madhani <hmadhani@redhat.com>
3c6e85
Signed-off-by: Jan Stancek <jstancek@redhat.com>
3c6e85
---
3c6e85
 drivers/scsi/qla2xxx/qla_nvme.c | 22 ++++++++++------------
3c6e85
 1 file changed, 10 insertions(+), 12 deletions(-)
3c6e85
3c6e85
diff --git a/drivers/scsi/qla2xxx/qla_nvme.c b/drivers/scsi/qla2xxx/qla_nvme.c
3c6e85
index 9c31d01ddd30..cfd5a68e6533 100644
3c6e85
--- a/drivers/scsi/qla2xxx/qla_nvme.c
3c6e85
+++ b/drivers/scsi/qla2xxx/qla_nvme.c
3c6e85
@@ -619,6 +619,7 @@ static void qla_nvme_unregister_remote_port(struct work_struct *work)
3c6e85
 	struct fc_port *fcport = container_of(work, struct fc_port,
3c6e85
 	    nvme_del_work);
3c6e85
 	struct qla_nvme_rport *qla_rport, *trport;
3c6e85
+	scsi_qla_host_t *base_vha;
3c6e85
 
3c6e85
 	if (!IS_ENABLED(CONFIG_NVME_FC))
3c6e85
 		return;
3c6e85
@@ -626,6 +627,15 @@ static void qla_nvme_unregister_remote_port(struct work_struct *work)
3c6e85
 	ql_log(ql_log_warn, NULL, 0x2112,
3c6e85
 	    "%s: unregister remoteport on %p\n",__func__, fcport);
3c6e85
 
3c6e85
+	base_vha = pci_get_drvdata(fcport->vha->hw->pdev);
3c6e85
+	if (test_bit(PFLG_DRIVER_REMOVING, &base_vha->pci_flags)) {
3c6e85
+		ql_dbg(ql_dbg_disc, fcport->vha, 0x2114,
3c6e85
+		    "%s: Notify FC-NVMe transport, set devloss=0\n",
3c6e85
+		    __func__);
3c6e85
+
3c6e85
+		nvme_fc_set_remoteport_devloss(fcport->nvme_remote_port, 0);
3c6e85
+	}
3c6e85
+
3c6e85
 	list_for_each_entry_safe(qla_rport, trport,
3c6e85
 	    &fcport->vha->nvme_rport_list, list) {
3c6e85
 		if (qla_rport->fcport == fcport) {
3c6e85
@@ -642,23 +652,11 @@ static void qla_nvme_unregister_remote_port(struct work_struct *work)
3c6e85
 
3c6e85
 void qla_nvme_delete(struct scsi_qla_host *vha)
3c6e85
 {
3c6e85
-	struct qla_nvme_rport *qla_rport, *trport;
3c6e85
-	fc_port_t *fcport;
3c6e85
 	int nv_ret;
3c6e85
 
3c6e85
 	if (!IS_ENABLED(CONFIG_NVME_FC))
3c6e85
 		return;
3c6e85
 
3c6e85
-	list_for_each_entry_safe(qla_rport, trport,
3c6e85
-	    &vha->nvme_rport_list, list) {
3c6e85
-		fcport = qla_rport->fcport;
3c6e85
-
3c6e85
-		ql_log(ql_log_info, fcport->vha, 0x2114, "%s: fcport=%p\n",
3c6e85
-		    __func__, fcport);
3c6e85
-
3c6e85
-		nvme_fc_set_remoteport_devloss(fcport->nvme_remote_port, 0);
3c6e85
-	}
3c6e85
-
3c6e85
 	if (vha->nvme_local_port) {
3c6e85
 		init_completion(&vha->nvme_del_done);
3c6e85
 		ql_log(ql_log_info, vha, 0x2116,
3c6e85
-- 
3c6e85
2.13.6
3c6e85