]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
scsi: fnic: Refactor in_remove flag and call to fnic_fcpio_reset()
authorKaran Tilak Kumar <kartilak@cisco.com>
Tue, 17 Feb 2026 22:39:42 +0000 (14:39 -0800)
committerMartin K. Petersen <martin.petersen@oracle.com>
Tue, 24 Feb 2026 19:09:24 +0000 (14:09 -0500)
Modify logic to remove unnecessary acquire/release of spinlock to set
in_remove flag. There's also no need to check for init status to call
fnic_fcpio_reset.

Tested-by: Karan Tilak Kumar <kartilak@cisco.com>
Reviewed-by: Sesidhar Baddela <sebaddel@cisco.com>
Reviewed-by: Arulprabhu Ponnusamy <arulponn@cisco.com>
Reviewed-by: Gian Carlo Boffa <gcboffa@cisco.com>
Reviewed-by: Arun Easi <aeasi@cisco.com>
Reviewed-by: Hannes Reinecke <hare@kernel.org>
Signed-off-by: Karan Tilak Kumar <kartilak@cisco.com>
Co-developed-by: Hannes Reinecke <hare@kernel.org>
Link: https://patch.msgid.link/20260217223943.7938-4-kartilak@cisco.com
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/fnic/fnic_scsi.c

index 05b203b9b69bfb558a169cc71f06a584ec839e0c..7e41bb8a7628466cfd4cfd63b95890939aa217de 100644 (file)
@@ -1972,14 +1972,11 @@ void fnic_scsi_unload(struct fnic *fnic)
         */
        spin_lock_irqsave(&fnic->fnic_lock, flags);
        fnic->iport.state = FNIC_IPORT_STATE_LINK_WAIT;
-       spin_unlock_irqrestore(&fnic->fnic_lock, flags);
-
-       if (fdls_get_state(&fnic->iport.fabric) != FDLS_STATE_INIT)
-               fnic_fcpio_reset(fnic);
-       spin_lock_irqsave(&fnic->fnic_lock, flags);
        fnic->in_remove = 1;
        spin_unlock_irqrestore(&fnic->fnic_lock, flags);
 
+       fnic_fcpio_reset(fnic);
+
        fnic_flush_tport_event_list(fnic);
        fnic_delete_fcp_tports(fnic);
 }