]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
scsi: lpfc: Allow DEVICE_RECOVERY mode after RSCN receipt if in PRLI_ISSUE state
authorJustin Tee <justin.tee@broadcom.com>
Fri, 28 Jun 2024 17:20:05 +0000 (10:20 -0700)
committerMartin K. Petersen <martin.petersen@oracle.com>
Fri, 5 Jul 2024 03:24:51 +0000 (23:24 -0400)
Certain vendor specific targets initially register with the fabric as an
initiator function first and then re-register as a target function
afterwards.

The timing of the target function re-registration can cause a race
condition such that the driver is stuck assuming the remote port as an
initiator function and never discovers the target's hosted LUNs.

Expand the nlp_state qualifier to also include NLP_STE_PRLI_ISSUE because
the state means that PRLI was issued but we have not quite reached
MAPPED_NODE state yet.  If we received an RSCN in the PRLI_ISSUE state,
then we should restart discovery again by going into DEVICE_RECOVERY.

Fixes: dded1dc31aa4 ("scsi: lpfc: Modify when a node should be put in device recovery mode during RSCN")
Cc: <stable@vger.kernel.org> # v6.6+
Signed-off-by: Justin Tee <justin.tee@broadcom.com>
Link: https://lore.kernel.org/r/20240628172011.25921-3-justintee8345@gmail.com
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/lpfc/lpfc_hbadisc.c

index 153770bdc56ab64bf79a5f9db3b5fa9af354e9a5..13b08c85440fec5beae218c479aeb9b33edaa3f7 100644 (file)
@@ -5725,7 +5725,7 @@ lpfc_setup_disc_node(struct lpfc_vport *vport, uint32_t did)
                                return ndlp;
 
                        if (ndlp->nlp_state > NLP_STE_UNUSED_NODE &&
-                           ndlp->nlp_state < NLP_STE_PRLI_ISSUE) {
+                           ndlp->nlp_state <= NLP_STE_PRLI_ISSUE) {
                                lpfc_disc_state_machine(vport, ndlp, NULL,
                                                        NLP_EVT_DEVICE_RECOVERY);
                        }