]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
scsi: lpfc: Relocate clearing initial phba flags from link up to link down hdlr
authorJustin Tee <justin.tee@broadcom.com>
Wed, 18 Jun 2025 19:21:32 +0000 (12:21 -0700)
committerMartin K. Petersen <martin.petersen@oracle.com>
Mon, 23 Jun 2025 17:10:33 +0000 (13:10 -0400)
Port wide initialization flags FLOGI_ISSUED and RHBA_CMPL make more sense
to be cleared upon a link down event rather than waiting for a link up
event.  By moving clearing of these initializatin flags to a link down
handler, future confusion on the state of initialization is avoided.

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

index f7ed245aece55cee5229678d53a43107224e9251..fca81e0c7c2e1a3cf6be4db6941fe2d8e0c28439 100644 (file)
@@ -8376,9 +8376,9 @@ lpfc_els_rcv_flogi(struct lpfc_vport *vport, struct lpfc_iocbq *cmdiocb,
        clear_bit(FC_PUBLIC_LOOP, &vport->fc_flag);
        lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS,
                         "3311 Rcv Flogi PS x%x new PS x%x "
-                        "fc_flag x%lx new fc_flag x%lx\n",
+                        "fc_flag x%lx new fc_flag x%lx, hba_flag x%lx\n",
                         port_state, vport->port_state,
-                        fc_flag, vport->fc_flag);
+                        fc_flag, vport->fc_flag, phba->hba_flag);
 
        /*
         * We temporarily set fc_myDID to make it look like we are
index b88e54a7e65c65218aaeb2cc2b93840da192de0a..690eacc5f739764f30fb4a3bd2bc29ce3a116789 100644 (file)
@@ -1266,6 +1266,10 @@ lpfc_linkdown(struct lpfc_hba *phba)
        }
        phba->defer_flogi_acc.flag = false;
 
+       /* reinitialize initial HBA flag */
+       clear_bit(HBA_FLOGI_ISSUED, &phba->hba_flag);
+       clear_bit(HBA_RHBA_CMPL, &phba->hba_flag);
+
        /* Clear external loopback plug detected flag */
        phba->link_flag &= ~LS_EXTERNAL_LOOPBACK;
 
@@ -1436,10 +1440,6 @@ lpfc_linkup(struct lpfc_hba *phba)
        phba->pport->rcv_flogi_cnt = 0;
        spin_unlock_irq(shost->host_lock);
 
-       /* reinitialize initial HBA flag */
-       clear_bit(HBA_FLOGI_ISSUED, &phba->hba_flag);
-       clear_bit(HBA_RHBA_CMPL, &phba->hba_flag);
-
        return 0;
 }