Skip to content

Commit 37c893e

Browse files
Justin Teemartinkpetersen
authored andcommitted
scsi: lpfc: Skip RSCN processing when FC_UNLOADING flag is set
During rmmod, all ndlp objects are cleaned up and marked with the NLP_DROPPED flag indicating that an ndlp object is currently being released. Thus, if an RSCN is received during driver unload, then walking the fc_nodes list to process the RSCN is unnecessary because the ndlp objects are very shortly going to be released. In the lpfc_rscn_recovery_check routine, early return if the driver is in the middle of unloading by checking for the FC_UNLOADING flag. Signed-off-by: Justin Tee <justin.tee@broadcom.com> Link: https://lore.kernel.org/r/20250618192138.124116-5-justintee8345@gmail.com Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
1 parent 6698796 commit 37c893e

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

drivers/scsi/lpfc/lpfc_els.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7861,6 +7861,13 @@ lpfc_rscn_recovery_check(struct lpfc_vport *vport)
78617861

78627862
/* Move all affected nodes by pending RSCNs to NPR state. */
78637863
list_for_each_entry_safe(ndlp, n, &vport->fc_nodes, nlp_listp) {
7864+
if (test_bit(FC_UNLOADING, &vport->load_flag)) {
7865+
lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS,
7866+
"1000 %s Unloading set\n",
7867+
__func__);
7868+
return 0;
7869+
}
7870+
78647871
if ((ndlp->nlp_state == NLP_STE_UNUSED_NODE) ||
78657872
!lpfc_rscn_payload_check(vport, ndlp->nlp_DID))
78667873
continue;

0 commit comments

Comments
 (0)