From 9ef04479106df2aafab87d19aa4e3466bca5c8c5 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Sat, 15 May 2021 22:29:59 +0000 Subject: [PATCH] qla2x00t-32gbit: Fix stuck session Session was stuck due to explicit logout to target timing out. The target was in an unresponsive state. This timeout induced an error to the GNL command from moving forward. Link: https://lore.kernel.org/r/20210329085229.4367-4-njavali@marvell.com Tested-by: Laurence Oberman Signed-off-by: Quinn Tran Signed-off-by: Nilesh Javali Signed-off-by: Martin K. Petersen [ commit c358a3d92b32be89ea1c44fe75721448c0a0fec1 upstream ] git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9403 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- qla2x00t-32gbit/qla_init.c | 1 + qla2x00t-32gbit/qla_target.c | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/qla2x00t-32gbit/qla_init.c b/qla2x00t-32gbit/qla_init.c index e8ceff270..6eb22fd50 100644 --- a/qla2x00t-32gbit/qla_init.c +++ b/qla2x00t-32gbit/qla_init.c @@ -718,6 +718,7 @@ static void qla24xx_handle_gnl_done_event(scsi_qla_host_t *vha, ql_dbg(ql_dbg_disc, vha, 0x20e0, "%s %8phC login gen changed\n", __func__, fcport->port_name); + set_bit(RELOGIN_NEEDED, &vha->dpc_flags); return; } diff --git a/qla2x00t-32gbit/qla_target.c b/qla2x00t-32gbit/qla_target.c index 868662611..659bdbb6e 100644 --- a/qla2x00t-32gbit/qla_target.c +++ b/qla2x00t-32gbit/qla_target.c @@ -1044,7 +1044,12 @@ void qlt_free_session_done(struct work_struct *work) } msleep(100); cnt++; - if (cnt > 200) + /* + * Driver timeout is set to 22 Sec, update count value to loop + * long enough for log-out to complete before advancing. Otherwise, + * straddling logout can interfere with re-login attempt. + */ + if (cnt > 230) break; }