diff mbox series

[v2,06/11] qla2xxx: Fix stalled login

Message ID 20221219110748.7039-7-njavali@marvell.com
State New
Headers show
Series Misc. qla2xxx driver bug fixes | expand

Commit Message

Nilesh Javali Dec. 19, 2022, 11:07 a.m. UTC
From: Quinn Tran <qutran@marvell.com>

If a login failed due to low FW resource, the session can stall
from being connected. Reset session state to allow relogin
logic to re-drive the connection.

Signed-off-by: Quinn Tran <qutran@marvell.com>
Signed-off-by: Nilesh Javali <njavali@marvell.com>
Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>
---
 drivers/scsi/qla2xxx/qla_init.c | 6 ++++++
 1 file changed, 6 insertions(+)
diff mbox series

Patch

diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c
index fd27fb511479..745fee298d56 100644
--- a/drivers/scsi/qla2xxx/qla_init.c
+++ b/drivers/scsi/qla2xxx/qla_init.c
@@ -390,6 +390,12 @@  qla2x00_async_login(struct scsi_qla_host *vha, fc_port_t *fcport,
 	fcport->flags &= ~FCF_ASYNC_SENT;
 done:
 	fcport->flags &= ~FCF_ASYNC_ACTIVE;
+
+	/*
+	 * async login failed. Could be due to iocb/exchange resource
+	 * being low. Set state DELETED for re-login process to start again.
+	 */
+	qla2x00_set_fcport_disc_state(fcport, DSC_DELETED);
 	return rval;
 }