]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
scsi: lpfc: Delete NLP_TARGET_REMOVE flag due to obsolete usage
authorJustin Tee <justin.tee@broadcom.com>
Thu, 12 Dec 2024 23:33:02 +0000 (15:33 -0800)
committerMartin K. Petersen <martin.petersen@oracle.com>
Thu, 2 Jan 2025 20:01:22 +0000 (15:01 -0500)
Remove the NLP_TARGET_REMOVE flag as its usage is obsolete.  The current
framework is to rely on the lpfc_dev_loss_tmo_callbk from upper layer to
notify final ndlp kref release.  There's no need to specifically set
NLP_EVT_DEVICE_RM when a LOGO completes.  The dev_loss_tmo_callbk is
responsible for the final kref put.

Signed-off-by: Justin Tee <justin.tee@broadcom.com>
Link: https://lore.kernel.org/r/20241212233309.71356-4-justintee8345@gmail.com
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/lpfc/lpfc_disc.h
drivers/scsi/lpfc/lpfc_els.c
drivers/scsi/lpfc/lpfc_nportdisc.c

index 3e173b5d00e008e34f72677e77d7010eba456c51..81cfa35dab986df0e7a4990a6ac5ba02a7101346 100644 (file)
@@ -208,7 +208,6 @@ enum lpfc_nlp_flag {
                                           NPR list */
        NLP_RM_DFLT_RPI    = 26,        /* need to remove leftover dflt RPI */
        NLP_NODEV_REMOVE   = 27,        /* Defer removal till discovery ends */
-       NLP_TARGET_REMOVE  = 28,        /* Target remove in process */
        NLP_SC_REQ         = 29,        /* Target requires authentication */
        NLP_FIRSTBURST     = 30,        /* Target supports FirstBurst */
        NLP_RPI_REGISTERED = 31         /* nlp_rpi is valid */
index 37f0a930d46914fb8326cde77ac7f45949fed0b6..842b67e37f108c4b251e8e73bcc8fd05cab71890 100644 (file)
@@ -3035,19 +3035,6 @@ lpfc_cmpl_els_logo(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
        /* Call state machine. This will unregister the rpi if needed. */
        lpfc_disc_state_machine(vport, ndlp, cmdiocb, NLP_EVT_CMPL_LOGO);
 
-       if (skip_recovery)
-               goto out;
-
-       /* The driver sets this flag for an NPIV instance that doesn't want to
-        * log into the remote port.
-        */
-       if (test_bit(NLP_TARGET_REMOVE, &ndlp->nlp_flag)) {
-               clear_bit(NLP_NPR_2B_DISC, &ndlp->nlp_flag);
-               lpfc_disc_state_machine(vport, ndlp, cmdiocb,
-                                       NLP_EVT_DEVICE_RM);
-               goto out_rsrc_free;
-       }
-
 out:
        /* At this point, the LOGO processing is complete. NOTE: For a
         * pt2pt topology, we are assuming the NPortID will only change
@@ -3091,7 +3078,7 @@ out:
                lpfc_disc_state_machine(vport, ndlp, cmdiocb,
                                        NLP_EVT_DEVICE_RM);
        }
-out_rsrc_free:
+
        /* Driver is done with the I/O. */
        lpfc_els_free_iocb(phba, cmdiocb);
        lpfc_nlp_put(ndlp);
@@ -10411,8 +10398,6 @@ lpfc_els_unsol_buffer(struct lpfc_hba *phba, struct lpfc_sli_ring *pring,
                        }
                }
 
-               clear_bit(NLP_TARGET_REMOVE, &ndlp->nlp_flag);
-
                lpfc_disc_state_machine(vport, ndlp, elsiocb,
                                        NLP_EVT_RCV_PLOGI);
 
index 4d88cfe71caed398d376030c9ae06d3aad6ae00c..71c76d90e8e7455d89a3dee44f29db4081da2a20 100644 (file)
@@ -2255,11 +2255,13 @@ lpfc_cmpl_prli_prli_issue(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp,
            (vport->port_type == LPFC_NPIV_PORT) &&
             vport->cfg_restrict_login) {
 out:
-               set_bit(NLP_TARGET_REMOVE, &ndlp->nlp_flag);
+               lpfc_printf_vlog(vport, KERN_INFO,
+                                LOG_ELS | LOG_DISCOVERY | LOG_NODE,
+                                "6228 Sending LOGO, determined nlp_type "
+                                "0x%x nlp_flag x%lx refcnt %u\n",
+                                ndlp->nlp_type, ndlp->nlp_flag,
+                                kref_read(&ndlp->kref));
                lpfc_issue_els_logo(vport, ndlp, 0);
-
-               ndlp->nlp_prev_state = NLP_STE_PRLI_ISSUE;
-               lpfc_nlp_set_state(vport, ndlp, NLP_STE_NPR_NODE);
                return ndlp->nlp_state;
        }