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 05/11] lpfc: Check SLI_ACTIVE flag in FDMI cmpl before submitting follow up FDMI
Date: Thu, 31 Oct 2024 15:32:13 -0700 [thread overview]
Message-ID: <20241031223219.152342-6-justintee8345@gmail.com> (raw)
In-Reply-To: <20241031223219.152342-1-justintee8345@gmail.com>
The lpfc_cmpl_ct_disc_fdmi routine has incorrect logic that treats an FDMI
completion with error LOCAL_REJECT/SLI_ABORTED as a success status. Under
the erroneous assumption of successful completion, the routine proceeds to
issue follow up FDMI commands, which may never complete if the HBA is in
an errata state as indicated by the errored completion status. Fix by
freeing FDMI cmd resources and early return when the LPFC_SLI_ACTIVE flag
is not set and a LOCAL_REJECT/SLI_ABORTED or SLI_DOWN status is received.
Signed-off-by: Justin Tee <justin.tee@broadcom.com>
---
drivers/scsi/lpfc/lpfc_ct.c | 21 ++++++++++++++-------
1 file changed, 14 insertions(+), 7 deletions(-)
diff --git a/drivers/scsi/lpfc/lpfc_ct.c b/drivers/scsi/lpfc/lpfc_ct.c
index 134bc96dd134..ce3a1f42713d 100644
--- a/drivers/scsi/lpfc/lpfc_ct.c
+++ b/drivers/scsi/lpfc/lpfc_ct.c
@@ -2226,6 +2226,11 @@ lpfc_cmpl_ct_disc_fdmi(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
ulp_status, ulp_word4, latt);
if (latt || ulp_status) {
+ lpfc_printf_vlog(vport, KERN_WARNING, LOG_DISCOVERY,
+ "0229 FDMI cmd %04x failed, latt = %d "
+ "ulp_status: (x%x/x%x), sli_flag x%x\n",
+ be16_to_cpu(fdmi_cmd), latt, ulp_status,
+ ulp_word4, phba->sli.sli_flag);
/* Look for a retryable error */
if (ulp_status == IOSTAT_LOCAL_REJECT) {
@@ -2234,8 +2239,16 @@ lpfc_cmpl_ct_disc_fdmi(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
case IOERR_SLI_DOWN:
/* Driver aborted this IO. No retry as error
* is likely Offline->Online or some adapter
- * error. Recovery will try again.
+ * error. Recovery will try again, but if port
+ * is not active there's no point to continue
+ * issuing follow up FDMI commands.
*/
+ if (!(phba->sli.sli_flag & LPFC_SLI_ACTIVE)) {
+ free_ndlp = cmdiocb->ndlp;
+ lpfc_ct_free_iocb(phba, cmdiocb);
+ lpfc_nlp_put(free_ndlp);
+ return;
+ }
break;
case IOERR_ABORT_IN_PROGRESS:
case IOERR_SEQUENCE_TIMEOUT:
@@ -2256,12 +2269,6 @@ lpfc_cmpl_ct_disc_fdmi(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
break;
}
}
-
- lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY,
- "0229 FDMI cmd %04x latt = %d "
- "ulp_status: x%x, rid x%x\n",
- be16_to_cpu(fdmi_cmd), latt, ulp_status,
- ulp_word4);
}
free_ndlp = cmdiocb->ndlp;
--
2.38.0
next prev 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 ` [PATCH 04/11] lpfc: Update lpfc_els_flush_cmd to check for SLI_ACTIVE before BSG flag Justin Tee
2024-10-31 22:32 ` Justin Tee [this message]
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-6-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