Skip to content

Commit a28d10a

Browse files
Justin Teemartinkpetersen
authored andcommitted
scsi: lpfc: Move clearing of HBA_SETUP flag to before lpfc_sli4_queue_unset
Move clearing of HBA_SETUP flag out of lpfc_sli_brdrestart_s4 and before lpfc_sli4_queue_unset. lpfc_sli4_queue_unset kfrees phba queues, so clear the HBA_SETUP atomic flag to signal that the phba struct is no longer initialized. Also, add a check for the HBA_SETUP flag in the lpfc_sli4_io_xri_aborted routine before dereferencing the ELS WQ. Signed-off-by: Justin Tee <justin.tee@broadcom.com> Link: https://lore.kernel.org/r/20250618192138.124116-10-justintee8345@gmail.com Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
1 parent 1cced57 commit a28d10a

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

drivers/scsi/lpfc/lpfc_scsi.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -536,7 +536,8 @@ lpfc_sli4_io_xri_aborted(struct lpfc_hba *phba,
536536
psb = container_of(iocbq, struct lpfc_io_buf, cur_iocbq);
537537
psb->flags &= ~LPFC_SBUF_XBUSY;
538538
spin_unlock_irqrestore(&phba->hbalock, iflag);
539-
if (!list_empty(&pring->txq))
539+
if (test_bit(HBA_SETUP, &phba->hba_flag) &&
540+
!list_empty(&pring->txq))
540541
lpfc_worker_wake_up(phba);
541542
return;
542543
}

drivers/scsi/lpfc/lpfc_sli.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5167,7 +5167,6 @@ lpfc_sli4_brdreset(struct lpfc_hba *phba)
51675167
phba->link_events = 0;
51685168
phba->pport->fc_myDID = 0;
51695169
phba->pport->fc_prevDID = 0;
5170-
clear_bit(HBA_SETUP, &phba->hba_flag);
51715170

51725171
spin_lock_irq(&phba->hbalock);
51735172
psli->sli_flag &= ~(LPFC_PROCESS_LA);
@@ -5284,6 +5283,7 @@ lpfc_sli_brdrestart_s4(struct lpfc_hba *phba)
52845283
"0296 Restart HBA Data: x%x x%x\n",
52855284
phba->pport->port_state, psli->sli_flag);
52865285

5286+
clear_bit(HBA_SETUP, &phba->hba_flag);
52875287
lpfc_sli4_queue_unset(phba);
52885288

52895289
rc = lpfc_sli4_brdreset(phba);

0 commit comments

Comments
 (0)