scsi: qla2xxx: edif: Synchronize NPIV deletion with authentication application
authorQuinn Tran <qutran@marvell.com>
Tue, 7 Jun 2022 04:46:22 +0000 (21:46 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 17 Aug 2022 12:23:39 +0000 (14:23 +0200)
[ Upstream commit cf79716e6636400ae38c37bc8a652b1e522abbba ]

Notify authentication application of a NPIV deletion event is about to
occur. This allows app to perform cleanup.

Link: https://lore.kernel.org/r/20220607044627.19563-7-njavali@marvell.com
Fixes: 9efea843a906 ("scsi: qla2xxx: edif: Add detection of secure device")
Signed-off-by: Quinn Tran <qutran@marvell.com>
Signed-off-by: Nilesh Javali <njavali@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/scsi/qla2xxx/qla_edif_bsg.h
drivers/scsi/qla2xxx/qla_mid.c

index 53026d8..af9f1ff 100644 (file)
@@ -217,4 +217,6 @@ struct auth_complete_cmd {
 
 #define RX_DELAY_DELETE_TIMEOUT 20
 
+#define FCH_EVT_VENDOR_UNIQUE_VPORT_DOWN  1
+
 #endif /* QLA_EDIF_BSG_H */
index e6b5c4c..eb43a5f 100644 (file)
@@ -166,9 +166,13 @@ qla24xx_disable_vp(scsi_qla_host_t *vha)
        int ret = QLA_SUCCESS;
        fc_port_t *fcport;
 
-       if (vha->hw->flags.edif_enabled)
+       if (vha->hw->flags.edif_enabled) {
+               if (DBELL_ACTIVE(vha))
+                       qla2x00_post_aen_work(vha, FCH_EVT_VENDOR_UNIQUE,
+                           FCH_EVT_VENDOR_UNIQUE_VPORT_DOWN);
                /* delete sessions and flush sa_indexes */
                qla2x00_wait_for_sess_deletion(vha);
+       }
 
        if (vha->hw->flags.fw_started)
                ret = qla24xx_control_vp(vha, VCE_COMMAND_DISABLE_VPS_LOGO_ALL);