Merge tag 'phy-for-5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/phy/linux...
[linux-2.6-microblaze.git] / drivers / scsi / lpfc / lpfc_els.c
index db5ccae..f936833 100644 (file)
@@ -1072,7 +1072,8 @@ stop_rr_fcf_flogi:
 
                /* FLOGI failed, so there is no fabric */
                spin_lock_irq(shost->host_lock);
-               vport->fc_flag &= ~(FC_FABRIC | FC_PUBLIC_LOOP);
+               vport->fc_flag &= ~(FC_FABRIC | FC_PUBLIC_LOOP |
+                                   FC_PT2PT_NO_NVME);
                spin_unlock_irq(shost->host_lock);
 
                /* If private loop, then allow max outstanding els to be
@@ -4607,6 +4608,23 @@ lpfc_els_retry(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
                /* Added for Vendor specifc support
                 * Just keep retrying for these Rsn / Exp codes
                 */
+               if ((vport->fc_flag & FC_PT2PT) &&
+                   cmd == ELS_CMD_NVMEPRLI) {
+                       switch (stat.un.b.lsRjtRsnCode) {
+                       case LSRJT_UNABLE_TPC:
+                       case LSRJT_INVALID_CMD:
+                       case LSRJT_LOGICAL_ERR:
+                       case LSRJT_CMD_UNSUPPORTED:
+                               lpfc_printf_vlog(vport, KERN_WARNING, LOG_ELS,
+                                                "0168 NVME PRLI LS_RJT "
+                                                "reason %x port doesn't "
+                                                "support NVME, disabling NVME\n",
+                                                stat.un.b.lsRjtRsnCode);
+                               retry = 0;
+                               vport->fc_flag |= FC_PT2PT_NO_NVME;
+                               goto out_retry;
+                       }
+               }
                switch (stat.un.b.lsRjtRsnCode) {
                case LSRJT_UNABLE_TPC:
                        /* The driver has a VALID PLOGI but the rport has