Skip to content

Commit 320c3a1

Browse files
Justin Teemartinkpetersen
authored andcommitted
scsi: lpfc: Relocate clearing initial phba flags from link up to link down hdlr
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>
1 parent 5a00dfc commit 320c3a1

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

drivers/scsi/lpfc/lpfc_els.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8376,9 +8376,9 @@ lpfc_els_rcv_flogi(struct lpfc_vport *vport, struct lpfc_iocbq *cmdiocb,
83768376
clear_bit(FC_PUBLIC_LOOP, &vport->fc_flag);
83778377
lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS,
83788378
"3311 Rcv Flogi PS x%x new PS x%x "
8379-
"fc_flag x%lx new fc_flag x%lx\n",
8379+
"fc_flag x%lx new fc_flag x%lx, hba_flag x%lx\n",
83808380
port_state, vport->port_state,
8381-
fc_flag, vport->fc_flag);
8381+
fc_flag, vport->fc_flag, phba->hba_flag);
83828382

83838383
/*
83848384
* We temporarily set fc_myDID to make it look like we are

drivers/scsi/lpfc/lpfc_hbadisc.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1266,6 +1266,10 @@ lpfc_linkdown(struct lpfc_hba *phba)
12661266
}
12671267
phba->defer_flogi_acc.flag = false;
12681268

1269+
/* reinitialize initial HBA flag */
1270+
clear_bit(HBA_FLOGI_ISSUED, &phba->hba_flag);
1271+
clear_bit(HBA_RHBA_CMPL, &phba->hba_flag);
1272+
12691273
/* Clear external loopback plug detected flag */
12701274
phba->link_flag &= ~LS_EXTERNAL_LOOPBACK;
12711275

@@ -1436,10 +1440,6 @@ lpfc_linkup(struct lpfc_hba *phba)
14361440
phba->pport->rcv_flogi_cnt = 0;
14371441
spin_unlock_irq(shost->host_lock);
14381442

1439-
/* reinitialize initial HBA flag */
1440-
clear_bit(HBA_FLOGI_ISSUED, &phba->hba_flag);
1441-
clear_bit(HBA_RHBA_CMPL, &phba->hba_flag);
1442-
14431443
return 0;
14441444
}
14451445

0 commit comments

Comments
 (0)