public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Justin Tee <justintee8345@gmail.com>
To: linux-scsi@vger.kernel.org
Cc: jsmart2021@gmail.com, justin.tee@broadcom.com,
	Justin Tee <justintee8345@gmail.com>
Subject: [PATCH 04/11] lpfc: Update lpfc_els_flush_cmd to check for SLI_ACTIVE before BSG flag
Date: Thu, 31 Oct 2024 15:32:12 -0700	[thread overview]
Message-ID: <20241031223219.152342-5-justintee8345@gmail.com> (raw)
In-Reply-To: <20241031223219.152342-1-justintee8345@gmail.com>

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 <justin.tee@broadcom.com>
---
 drivers/scsi/lpfc/lpfc_els.c | 22 ++++++++++++++++------
 1 file changed, 16 insertions(+), 6 deletions(-)

diff --git a/drivers/scsi/lpfc/lpfc_els.c b/drivers/scsi/lpfc/lpfc_els.c
index d737b897ddd8..3d965c0fd0c6 100644
--- a/drivers/scsi/lpfc/lpfc_els.c
+++ b/drivers/scsi/lpfc/lpfc_els.c
@@ -1236,9 +1236,9 @@ lpfc_cmpl_els_link_down(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
 
 	lpfc_printf_log(phba, KERN_INFO, LOG_ELS,
 			"6445 ELS completes after LINK_DOWN: "
-			" Status %x/%x cmd x%x flg x%x\n",
+			" Status %x/%x cmd x%x flg x%x iotag x%x\n",
 			ulp_status, ulp_word4, cmd,
-			cmdiocb->cmd_flag);
+			cmdiocb->cmd_flag, cmdiocb->iotag);
 
 	if (cmdiocb->cmd_flag & LPFC_IO_FABRIC) {
 		cmdiocb->cmd_flag &= ~LPFC_IO_FABRIC;
@@ -9642,14 +9642,24 @@ lpfc_els_flush_cmd(struct lpfc_vport *vport)
 	mbx_tmo_err = test_bit(MBX_TMO_ERR, &phba->bit_flags);
 	/* First we need to issue aborts to outstanding cmds on txcmpl */
 	list_for_each_entry_safe(piocb, tmp_iocb, &pring->txcmplq, list) {
-		if (piocb->cmd_flag & LPFC_IO_LIBDFC && !mbx_tmo_err)
-			continue;
+		lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS,
+				 "2243 iotag = 0x%x cmd_flag = 0x%x "
+				 "ulp_command = 0x%x this_vport %x "
+				 "sli_flag = 0x%x\n",
+				 piocb->iotag, piocb->cmd_flag,
+				 get_job_cmnd(phba, piocb),
+				 (piocb->vport == vport),
+				 phba->sli.sli_flag);
 
 		if (piocb->vport != vport)
 			continue;
 
-		if (piocb->cmd_flag & LPFC_DRIVER_ABORTED && !mbx_tmo_err)
-			continue;
+		if ((phba->sli.sli_flag & LPFC_SLI_ACTIVE) && !mbx_tmo_err) {
+			if (piocb->cmd_flag & LPFC_IO_LIBDFC)
+				continue;
+			if (piocb->cmd_flag & LPFC_DRIVER_ABORTED)
+				continue;
+		}
 
 		/* On the ELS ring we can have ELS_REQUESTs, ELS_RSPs,
 		 * or GEN_REQUESTs waiting for a CQE response.
-- 
2.38.0


  parent reply	other threads:[~2024-10-31 22:15 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-31 22:32 [PATCH 00/11] Update lpfc to revision 14.4.0.6 Justin Tee
2024-10-31 22:32 ` [PATCH 01/11] lpfc: Modify cgn warning signal calculation based on EDC response Justin Tee
2024-10-31 22:32 ` [PATCH 02/11] lpfc: Check devloss callbk done flag for potential stale ndlp ptrs Justin Tee
2024-10-31 22:32 ` [PATCH 03/11] lpfc: Call lpfc_sli4_queue_unset in restart and rmmod paths Justin Tee
2024-10-31 22:32 ` Justin Tee [this message]
2024-10-31 22:32 ` [PATCH 05/11] lpfc: Check SLI_ACTIVE flag in FDMI cmpl before submitting follow up FDMI Justin Tee
2024-10-31 22:32 ` [PATCH 06/11] lpfc: Add cleanup of nvmels_wq after HBA reset Justin Tee
2024-10-31 22:32 ` [PATCH 07/11] lpfc: Prevent ndlp reference count underflow in dev_loss_tmo callback Justin Tee
2024-10-31 22:32 ` [PATCH 08/11] lpfc: Remove NLP_RELEASE_RPI flag from nodelist structure Justin Tee
2024-10-31 22:32 ` [PATCH 09/11] lpfc: Change lpfc_nodelist nlp_flag member into a bitmask Justin Tee
2024-10-31 22:32 ` [PATCH 10/11] lpfc: Update lpfc version to 14.4.0.6 Justin Tee
2024-10-31 22:32 ` [PATCH 11/11] lpfc: Copyright updates for 14.4.0.6 patches Justin Tee
2024-11-03  1:47 ` [PATCH 00/11] Update lpfc to revision 14.4.0.6 Martin K. Petersen
2024-11-14  2:49 ` Martin K. Petersen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20241031223219.152342-5-justintee8345@gmail.com \
    --to=justintee8345@gmail.com \
    --cc=jsmart2021@gmail.com \
    --cc=justin.tee@broadcom.com \
    --cc=linux-scsi@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox