From 7fcc1f6be3fc02c49ef97ed8cb592bffc9237cfa Mon Sep 17 00:00:00 2001 From: Daniel Wagner Date: Mar 28 2024 14:37:49 +0000 Subject: scsi: lpfc: Move NPIV's transport unregistration to after resource clean up (bsc#1221777). --- diff --git a/patches.suse/scsi-lpfc-Move-NPIV-s-transport-unregistration-to-af.patch b/patches.suse/scsi-lpfc-Move-NPIV-s-transport-unregistration-to-af.patch new file mode 100644 index 0000000..7135ed2 --- /dev/null +++ b/patches.suse/scsi-lpfc-Move-NPIV-s-transport-unregistration-to-af.patch @@ -0,0 +1,54 @@ +From: Justin Tee +Date: Tue, 5 Mar 2024 12:04:53 -0800 +Subject: scsi: lpfc: Move NPIV's transport unregistration to after resource + clean up +Patch-mainline: Queued in subsystem maintainer repository +Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git +Git-commit: 4ddf01f2f1504fa08b766e8cfeec558e9f8eef6c +References: bsc#1221777 + +There are cases after NPIV deletion where the fabric switch still believes +the NPIV is logged into the fabric. This occurs when a vport is +unregistered before the Remove All DA_ID CT and LOGO ELS are sent to the +fabric. + +Currently fc_remove_host(), which calls dev_loss_tmo for all D_IDs including +the fabric D_ID, removes the last ndlp reference and frees the ndlp rport +object. This sometimes causes the race condition where the final DA_ID and +LOGO are skipped from being sent to the fabric switch. + +Fix by moving the fc_remove_host() and scsi_remove_host() calls after DA_ID +and LOGO are sent. + +Signed-off-by: Justin Tee +Link: https://lore.kernel.org/r/20240305200503.57317-3-justintee8345@gmail.com +Signed-off-by: Martin K. Petersen +Acked-by: Daniel Wagner +--- + drivers/scsi/lpfc/lpfc_vport.c | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +--- a/drivers/scsi/lpfc/lpfc_vport.c ++++ b/drivers/scsi/lpfc/lpfc_vport.c +@@ -674,10 +674,6 @@ lpfc_vport_delete(struct fc_vport *fc_vp + lpfc_free_sysfs_attr(vport); + lpfc_debugfs_terminate(vport); + +- /* Remove FC host to break driver binding. */ +- fc_remove_host(shost); +- scsi_remove_host(shost); +- + /* Send the DA_ID and Fabric LOGO to cleanup Nameserver entries. */ + ndlp = lpfc_findnode_did(vport, Fabric_DID); + if (!ndlp) +@@ -721,6 +717,10 @@ lpfc_vport_delete(struct fc_vport *fc_vp + + skip_logo: + ++ /* Remove FC host to break driver binding. */ ++ fc_remove_host(shost); ++ scsi_remove_host(shost); ++ + lpfc_cleanup(vport); + + /* Remove scsi host now. The nodes are cleaned up. */ diff --git a/series.conf b/series.conf index 987acb5..ac118a3 100644 --- a/series.conf +++ b/series.conf @@ -20069,6 +20069,7 @@ patches.suse/scsi-qla2xxx-Delay-I-O-Abort-on-PCI-error.patch patches.suse/scsi-qla2xxx-Update-version-to-10.02.09.200-k.patch patches.suse/scsi-lpfc-Remove-unnecessary-log-message-in-queuecom.patch + patches.suse/scsi-lpfc-Move-NPIV-s-transport-unregistration-to-af.patch ######################################################## # end of sorted patches