public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH AUTOSEL 6.1 01/13] scsi: lpfc: Move NPIV's transport unregistration to after resource clean up
@ 2024-04-07 13:13 Sasha Levin
  2024-04-07 13:13 ` [PATCH AUTOSEL 6.1 02/13] scsi: lpfc: Update lpfc_ramp_down_queue_handler() logic Sasha Levin
                   ` (11 more replies)
  0 siblings, 12 replies; 13+ messages in thread
From: Sasha Levin @ 2024-04-07 13:13 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Justin Tee, Martin K . Petersen, Sasha Levin, james.smart,
	dick.kennedy, jejb, linux-scsi

From: Justin Tee <justin.tee@broadcom.com>

[ Upstream commit 4ddf01f2f1504fa08b766e8cfeec558e9f8eef6c ]

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 <justin.tee@broadcom.com>
Link: https://lore.kernel.org/r/20240305200503.57317-3-justintee8345@gmail.com
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/scsi/lpfc/lpfc_vport.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/scsi/lpfc/lpfc_vport.c b/drivers/scsi/lpfc/lpfc_vport.c
index 4d171f5c213f7..6b4259894584f 100644
--- a/drivers/scsi/lpfc/lpfc_vport.c
+++ b/drivers/scsi/lpfc/lpfc_vport.c
@@ -693,10 +693,6 @@ lpfc_vport_delete(struct fc_vport *fc_vport)
 	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)
@@ -740,6 +736,10 @@ lpfc_vport_delete(struct fc_vport *fc_vport)
 
 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. */
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2024-04-07 13:13 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-04-07 13:13 [PATCH AUTOSEL 6.1 01/13] scsi: lpfc: Move NPIV's transport unregistration to after resource clean up Sasha Levin
2024-04-07 13:13 ` [PATCH AUTOSEL 6.1 02/13] scsi: lpfc: Update lpfc_ramp_down_queue_handler() logic Sasha Levin
2024-04-07 13:13 ` [PATCH AUTOSEL 6.1 03/13] scsi: lpfc: Replace hbalock with ndlp lock in lpfc_nvme_unregister_port() Sasha Levin
2024-04-07 13:13 ` [PATCH AUTOSEL 6.1 04/13] scsi: lpfc: Release hbalock before calling lpfc_worker_wake_up() Sasha Levin
2024-04-07 13:13 ` [PATCH AUTOSEL 6.1 05/13] gfs2: Fix invalid metadata access in punch_hole Sasha Levin
2024-04-07 13:13 ` [PATCH AUTOSEL 6.1 06/13] wifi: mac80211: fix ieee80211_bss_*_flags kernel-doc Sasha Levin
2024-04-07 13:13 ` [PATCH AUTOSEL 6.1 07/13] wifi: cfg80211: fix rdev_dump_mpp() arguments order Sasha Levin
2024-04-07 13:13 ` [PATCH AUTOSEL 6.1 08/13] net: mark racy access on sk->sk_rcvbuf Sasha Levin
2024-04-07 13:13 ` [PATCH AUTOSEL 6.1 09/13] scsi: mpi3mr: Avoid memcpy field-spanning write WARNING Sasha Levin
2024-04-07 13:13 ` [PATCH AUTOSEL 6.1 10/13] scsi: bnx2fc: Remove spin_lock_bh while releasing resources after upload Sasha Levin
2024-04-07 13:13 ` [PATCH AUTOSEL 6.1 11/13] btrfs: return accurate error code on open failure in open_fs_devices() Sasha Levin
2024-04-07 13:13 ` [PATCH AUTOSEL 6.1 12/13] bpf: Check bloom filter map value size Sasha Levin
2024-04-07 13:13 ` [PATCH AUTOSEL 6.1 13/13] kbuild: Disable KCSAN for autogenerated *.mod.c intermediaries Sasha Levin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox