Re: [PATCH 1/2] scsi: lpfc: Test FC_UNLOADING in load_flag
From: Paul Ely
Date: Thu Nov 12 2026 - 14:55:23 EST
From: Yang Xiuwei <yangxiuwei@xxxxxxxxxx>
To: "James E . J . Bottomley" <James.Bottomley@xxxxxxxxxxxxxxxxxxxxx>,
"Martin K . Petersen" <mkp@xxxxxxxxxx>
Cc: Justin Tee <justin.tee@xxxxxxxxxxxx>,
Paul Ely <paul.ely@xxxxxxxxxxxx>,
linux-scsi@xxxxxxxxxxxxxxx
Subject: [PATCH 1/2] scsi: lpfc: Test FC_UNLOADING in load_flag
Date: Thu, 12 Nov 2026 15:59:18 +0800 [thread overview]
Message-ID: <20261112075919.1247605-2-yangxiuwei@xxxxxxxxxx> (raw)
In-Reply-To: <20261112075919.1247605-1-yangxiuwei@xxxxxxxxxx>
lpfc_check_unload_and_clr_rscn() tests FC_UNLOADING in vport->fc_flag.
That bit is FC_PT2PT_PLOGI. FC_UNLOADING is set only in
vport->load_flag.
Pass the vport and test load_flag.
Fixes: bf81e9cd1767 ("scsi: lpfc: Clear deferred RSCN processing flag
when driver is unloading")
Signed-off-by: Yang Xiuwei <yangxiuwei@xxxxxxxxxx>
---
drivers/scsi/lpfc/lpfc_nportdisc.c | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/drivers/scsi/lpfc/lpfc_nportdisc.c
b/drivers/scsi/lpfc/lpfc_nportdisc.c
index fb8844c69491..7d53d3c88aa7 100644
--- a/drivers/scsi/lpfc/lpfc_nportdisc.c
+++ b/drivers/scsi/lpfc/lpfc_nportdisc.c
@@ -49,14 +49,14 @@
/* Called to clear RSCN discovery flags when driver is unloading. */
static bool
-lpfc_check_unload_and_clr_rscn(unsigned long *fc_flag)
+lpfc_check_unload_and_clr_rscn(struct lpfc_vport *vport)
{
/* If unloading, then clear the FC_RSCN_DEFERRED flag */
- if (test_bit(FC_UNLOADING, fc_flag)) {
- clear_bit(FC_RSCN_DEFERRED, fc_flag);
+ if (test_bit(FC_UNLOADING, &vport->load_flag)) {
+ clear_bit(FC_RSCN_DEFERRED, &vport->fc_flag);
return false;
}
- return test_bit(FC_RSCN_DEFERRED, fc_flag);
+ return test_bit(FC_RSCN_DEFERRED, &vport->fc_flag);
}
/* Called to verify a rcv'ed ADISC was intended for us. */
@@ -1619,7 +1619,7 @@ lpfc_device_recov_plogi_issue(struct lpfc_vport *vport,
struct lpfc_hba *phba = vport->phba;
/* Don't do anything that disrupts the RSCN unless lpfc is unloading. */
- if (lpfc_check_unload_and_clr_rscn(&vport->fc_flag))
+ if (lpfc_check_unload_and_clr_rscn(vport))
return ndlp->nlp_state;
/* software abort outstanding PLOGI */
@@ -1794,7 +1794,7 @@ lpfc_device_recov_adisc_issue(struct lpfc_vport *vport,
struct lpfc_hba *phba = vport->phba;
/* Don't do anything that disrupts the RSCN unless lpfc is unloading. */
- if (lpfc_check_unload_and_clr_rscn(&vport->fc_flag))
+ if (lpfc_check_unload_and_clr_rscn(vport))
return ndlp->nlp_state;
/* software abort outstanding ADISC */
@@ -2055,7 +2055,7 @@ lpfc_device_recov_reglogin_issue(struct lpfc_vport *vport,
uint32_t evt)
{
/* Don't do anything that disrupts the RSCN unless lpfc is unloading. */
- if (lpfc_check_unload_and_clr_rscn(&vport->fc_flag))
+ if (lpfc_check_unload_and_clr_rscn(vport))
return ndlp->nlp_state;
ndlp->nlp_prev_state = NLP_STE_REG_LOGIN_ISSUE;
@@ -2366,7 +2366,7 @@ lpfc_device_recov_prli_issue(struct lpfc_vport *vport,
struct lpfc_hba *phba = vport->phba;
/* Don't do anything that disrupts the RSCN unless lpfc is unloading. */
- if (lpfc_check_unload_and_clr_rscn(&vport->fc_flag))
+ if (lpfc_check_unload_and_clr_rscn(vport))
return ndlp->nlp_state;
/* software abort outstanding PRLI */
@@ -2902,7 +2902,7 @@ lpfc_device_recov_npr_node(struct lpfc_vport
*vport, struct lpfc_nodelist *ndlp,
void *arg, uint32_t evt)
{
/* Don't do anything that disrupts the RSCN unless lpfc is unloading. */
- if (lpfc_check_unload_and_clr_rscn(&vport->fc_flag))
+ if (lpfc_check_unload_and_clr_rscn(vport))
return ndlp->nlp_state;
lpfc_cancel_retry_delay_tmo(vport, ndlp);
Yang - Broadcom has already fixed these issues and is preparing a
follow up push. We were delayed pushing it because of our learning
curve with Sashiko.
Thanks
Paul
Attachment:
smime.p7s
Description: S/MIME Cryptographic Signature