Skip to content

Commit

Permalink
scsi: qla2xxx: Fix login timeout
Browse files Browse the repository at this point in the history
[ Upstream commit abb31ae ]

Multipath errors were seen during failback due to login timeout.  The
remote device sent LOGO, the local host tore down the session and did
relogin. The RSCN arrived indicates remote device is going through failover
after which the relogin is in a 20s timeout phase.  At this point the
driver is stuck in the relogin process.  Add a fix to delete the session as
part of abort/flush the login.

Link: https://lore.kernel.org/r/20200806111014.28434-5-njavali@marvell.com
Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>
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>
  • Loading branch information
Quinn Tran authored and gregkh committed Sep 3, 2020
1 parent eb34d23 commit 3d24199
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
18 changes: 15 additions & 3 deletions drivers/scsi/qla2xxx/qla_gs.c
Expand Up @@ -3538,10 +3538,22 @@ void qla24xx_async_gnnft_done(scsi_qla_host_t *vha, srb_t *sp)
}

if (fcport->scan_state != QLA_FCPORT_FOUND) {
bool do_delete = false;

if (fcport->scan_needed &&
fcport->disc_state == DSC_LOGIN_PEND) {
/* Cable got disconnected after we sent
* a login. Do delete to prevent timeout.
*/
fcport->logout_on_delete = 1;
do_delete = true;
}

fcport->scan_needed = 0;
if ((qla_dual_mode_enabled(vha) ||
qla_ini_mode_enabled(vha)) &&
atomic_read(&fcport->state) == FCS_ONLINE) {
if (((qla_dual_mode_enabled(vha) ||
qla_ini_mode_enabled(vha)) &&
atomic_read(&fcport->state) == FCS_ONLINE) ||
do_delete) {
if (fcport->loop_id != FC_NO_LOOP_ID) {
if (fcport->flags & FCF_FCP2_DEVICE)
fcport->logout_on_delete = 0;
Expand Down
2 changes: 1 addition & 1 deletion drivers/scsi/qla2xxx/qla_target.c
Expand Up @@ -1270,7 +1270,7 @@ void qlt_schedule_sess_for_deletion(struct fc_port *sess)

qla24xx_chk_fcp_state(sess);

ql_dbg(ql_dbg_tgt, sess->vha, 0xe001,
ql_dbg(ql_dbg_disc, sess->vha, 0xe001,
"Scheduling sess %p for deletion %8phC\n",
sess, sess->port_name);

Expand Down

0 comments on commit 3d24199

Please sign in to comment.