Skip to content

Commit 940ddac

Browse files
Justin Teemartinkpetersen
authored andcommitted
scsi: lpfc: Update lpfc_els_flush_cmd() to check for SLI_ACTIVE before BSG flag
During firmware errata events, the lpfc_els_flush_cmd() routine is responsible for the clean up of outstanding ELS and CT command submissions. Thus, move the LPFC_SLI_ACTIVE flag check into the txcmplq list walk and mark a piocb object for canceling if determined the HBA is not active. Clean up should be regardless of application or driver layer origin. Signed-off-by: Justin Tee <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Martin K. Petersen <[email protected]>
1 parent d35f767 commit 940ddac

File tree

1 file changed

+16
-6
lines changed

1 file changed

+16
-6
lines changed

drivers/scsi/lpfc/lpfc_els.c

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1236,9 +1236,9 @@ lpfc_cmpl_els_link_down(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
12361236

12371237
lpfc_printf_log(phba, KERN_INFO, LOG_ELS,
12381238
"6445 ELS completes after LINK_DOWN: "
1239-
" Status %x/%x cmd x%x flg x%x\n",
1239+
" Status %x/%x cmd x%x flg x%x iotag x%x\n",
12401240
ulp_status, ulp_word4, cmd,
1241-
cmdiocb->cmd_flag);
1241+
cmdiocb->cmd_flag, cmdiocb->iotag);
12421242

12431243
if (cmdiocb->cmd_flag & LPFC_IO_FABRIC) {
12441244
cmdiocb->cmd_flag &= ~LPFC_IO_FABRIC;
@@ -9642,14 +9642,24 @@ lpfc_els_flush_cmd(struct lpfc_vport *vport)
96429642
mbx_tmo_err = test_bit(MBX_TMO_ERR, &phba->bit_flags);
96439643
/* First we need to issue aborts to outstanding cmds on txcmpl */
96449644
list_for_each_entry_safe(piocb, tmp_iocb, &pring->txcmplq, list) {
9645-
if (piocb->cmd_flag & LPFC_IO_LIBDFC && !mbx_tmo_err)
9646-
continue;
9645+
lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS,
9646+
"2243 iotag = 0x%x cmd_flag = 0x%x "
9647+
"ulp_command = 0x%x this_vport %x "
9648+
"sli_flag = 0x%x\n",
9649+
piocb->iotag, piocb->cmd_flag,
9650+
get_job_cmnd(phba, piocb),
9651+
(piocb->vport == vport),
9652+
phba->sli.sli_flag);
96479653

96489654
if (piocb->vport != vport)
96499655
continue;
96509656

9651-
if (piocb->cmd_flag & LPFC_DRIVER_ABORTED && !mbx_tmo_err)
9652-
continue;
9657+
if ((phba->sli.sli_flag & LPFC_SLI_ACTIVE) && !mbx_tmo_err) {
9658+
if (piocb->cmd_flag & LPFC_IO_LIBDFC)
9659+
continue;
9660+
if (piocb->cmd_flag & LPFC_DRIVER_ABORTED)
9661+
continue;
9662+
}
96539663

96549664
/* On the ELS ring we can have ELS_REQUESTs, ELS_RSPs,
96559665
* or GEN_REQUESTs waiting for a CQE response.

0 commit comments

Comments
 (0)