Skip to content

Commit 034b060

Browse files
author
Paul Ely
committed
scsi: lpfc: Move clearing of HBA_SETUP flag to before lpfc_sli4_queue_unset
JIRA: https://issues.redhat.com/browse/RHEL-103751 commit a28d10a Author: Justin Tee <justin.tee@broadcom.com> Date: Wed Jun 18 12:21:34 2025 -0700 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> Signed-off-by: Paul Ely <paely@redhat.com>
1 parent 68ce87a commit 034b060

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

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
@@ -5160,7 +5160,6 @@ lpfc_sli4_brdreset(struct lpfc_hba *phba)
51605160
phba->link_events = 0;
51615161
phba->pport->fc_myDID = 0;
51625162
phba->pport->fc_prevDID = 0;
5163-
clear_bit(HBA_SETUP, &phba->hba_flag);
51645163

51655164
spin_lock_irq(&phba->hbalock);
51665165
psli->sli_flag &= ~(LPFC_PROCESS_LA);
@@ -5277,6 +5276,7 @@ lpfc_sli_brdrestart_s4(struct lpfc_hba *phba)
52775276
"0296 Restart HBA Data: x%x x%x\n",
52785277
phba->pport->port_state, psli->sli_flag);
52795278

5279+
clear_bit(HBA_SETUP, &phba->hba_flag);
52805280
lpfc_sli4_queue_unset(phba);
52815281

52825282
rc = lpfc_sli4_brdreset(phba);

0 commit comments

Comments
 (0)