Merge tag 'powerpc-5.9-3' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc...
[linux-2.6-microblaze.git] / drivers / scsi / qla2xxx / qla_nvme.c
index fa695a4..90bbc61 100644 (file)
@@ -536,6 +536,11 @@ static int qla_nvme_post_cmd(struct nvme_fc_local_port *lport,
        struct nvme_private *priv = fd->private;
        struct qla_nvme_rport *qla_rport = rport->private;
 
+       if (!priv) {
+               /* nvme association has been torn down */
+               return rval;
+       }
+
        fcport = qla_rport->fcport;
 
        if (!qpair || !fcport || (qpair && !qpair->fw_started) ||
@@ -687,7 +692,15 @@ int qla_nvme_register_hba(struct scsi_qla_host *vha)
        tmpl = &qla_nvme_fc_transport;
 
        WARN_ON(vha->nvme_local_port);
-       WARN_ON(ha->max_req_queues < 3);
+
+       if (ha->max_req_queues < 3) {
+               if (!ha->flags.max_req_queue_warned)
+                       ql_log(ql_log_info, vha, 0x2120,
+                              "%s: Disabling FC-NVME due to lack of free queue pairs (%d).\n",
+                              __func__, ha->max_req_queues);
+               ha->flags.max_req_queue_warned = 1;
+               return ret;
+       }
 
        qla_nvme_fc_transport.max_hw_queues =
            min((uint8_t)(qla_nvme_fc_transport.max_hw_queues),