]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
scsi: qla2xxx: Fix NPIV handling for FC-NVMe
authorHimanshu Madhani <hmadhani@marvell.com>
Mon, 10 Dec 2018 20:36:23 +0000 (12:36 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 5 Dec 2019 08:20:03 +0000 (09:20 +0100)
[ Upstream commit 5e6803b409ba3c18434de6693062d98a470bcb1e ]

This patch fixes issues with NPIV port with FC-NVMe. Clean up code for
remoteport delete and also call nvme_delete when deleting VPs.

Signed-off-by: Himanshu Madhani <hmadhani@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/scsi/qla2xxx/qla_nvme.c
drivers/scsi/qla2xxx/qla_os.c

index e6545cb9a2c199f903f949d07bce79ea997699ef..5590d6e8b57624404df0cb481ab134f2e3374a5d 100644 (file)
@@ -474,21 +474,10 @@ static int qla_nvme_post_cmd(struct nvme_fc_local_port *lport,
        int rval = -ENODEV;
        srb_t *sp;
        struct qla_qpair *qpair = hw_queue_handle;
-       struct nvme_private *priv;
+       struct nvme_private *priv = fd->private;
        struct qla_nvme_rport *qla_rport = rport->private;
 
-       if (!fd || !qpair) {
-               ql_log(ql_log_warn, NULL, 0x2134,
-                   "NO NVMe request or Queue Handle\n");
-               return rval;
-       }
-
-       priv = fd->private;
        fcport = qla_rport->fcport;
-       if (!fcport) {
-               ql_log(ql_log_warn, NULL, 0x210e, "No fcport ptr\n");
-               return rval;
-       }
 
        vha = fcport->vha;
 
@@ -517,6 +506,7 @@ static int qla_nvme_post_cmd(struct nvme_fc_local_port *lport,
        sp->name = "nvme_cmd";
        sp->done = qla_nvme_sp_done;
        sp->qpair = qpair;
+       sp->vha = vha;
        nvme = &sp->u.iocb_cmd;
        nvme->u.nvme.desc = fd;
 
@@ -564,7 +554,7 @@ static void qla_nvme_remoteport_delete(struct nvme_fc_remote_port *rport)
                schedule_work(&fcport->free_work);
        }
 
-       fcport->nvme_flag &= ~(NVME_FLAG_REGISTERED | NVME_FLAG_DELETING);
+       fcport->nvme_flag &= ~NVME_FLAG_DELETING;
        ql_log(ql_log_info, fcport->vha, 0x2110,
            "remoteport_delete of %p completed.\n", fcport);
 }
index 3e892e013658d2cdedb0a5e29f53b1e1ecd18ad9..183bfda8f5d112885b1938698e1f0a00df8fa759 100644 (file)
@@ -3538,6 +3538,8 @@ qla2x00_delete_all_vps(struct qla_hw_data *ha, scsi_qla_host_t *base_vha)
                spin_unlock_irqrestore(&ha->vport_slock, flags);
                mutex_unlock(&ha->vport_lock);
 
+               qla_nvme_delete(vha);
+
                fc_vport_terminate(vha->fc_vport);
                scsi_host_put(vha->host);