Commit 861d483d authored by Quinn Tran's avatar Quinn Tran Committed by Martin K. Petersen

scsi: qla2xxx: Fix stuck session in PLOGI state

On PLOGI complete + RSCN received, driver tries to handle RSCN but failed to
reset the session back to the beginning to restart the login process. Instead
the session was left in the Plogi complete without moving forward.  This patch
will push the session state back to the delete state and restart the
connection.
Signed-off-by: default avatarQuinn Tran <quinn.tran@cavium.com>
Signed-off-by: default avatarHimanshu Madhani <himanshu.madhani@cavium.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 8235f4b5
...@@ -414,6 +414,7 @@ void qla24xx_handle_adisc_event(scsi_qla_host_t *vha, struct event_arg *ea) ...@@ -414,6 +414,7 @@ void qla24xx_handle_adisc_event(scsi_qla_host_t *vha, struct event_arg *ea)
return; return;
} else if (ea->sp->gen1 != ea->fcport->rscn_gen) { } else if (ea->sp->gen1 != ea->fcport->rscn_gen) {
qla_rscn_replay(fcport); qla_rscn_replay(fcport);
qlt_schedule_sess_for_deletion(fcport);
return; return;
} }
...@@ -538,6 +539,7 @@ static void qla24xx_handle_gnl_done_event(scsi_qla_host_t *vha, ...@@ -538,6 +539,7 @@ static void qla24xx_handle_gnl_done_event(scsi_qla_host_t *vha,
if (fcport->last_rscn_gen != fcport->rscn_gen) { if (fcport->last_rscn_gen != fcport->rscn_gen) {
qla_rscn_replay(fcport); qla_rscn_replay(fcport);
qlt_schedule_sess_for_deletion(fcport);
return; return;
} else if (fcport->last_login_gen != fcport->login_gen) { } else if (fcport->last_login_gen != fcport->login_gen) {
ql_dbg(ql_dbg_disc, vha, 0x20e0, ql_dbg(ql_dbg_disc, vha, 0x20e0,
...@@ -1229,6 +1231,7 @@ void qla24xx_handle_gpdb_event(scsi_qla_host_t *vha, struct event_arg *ea) ...@@ -1229,6 +1231,7 @@ void qla24xx_handle_gpdb_event(scsi_qla_host_t *vha, struct event_arg *ea)
return; return;
} else if (ea->sp->gen1 != fcport->rscn_gen) { } else if (ea->sp->gen1 != fcport->rscn_gen) {
qla_rscn_replay(fcport); qla_rscn_replay(fcport);
qlt_schedule_sess_for_deletion(fcport);
return; return;
} }
...@@ -1699,9 +1702,7 @@ void qla_rscn_replay(fc_port_t *fcport) ...@@ -1699,9 +1702,7 @@ void qla_rscn_replay(fc_port_t *fcport)
#else #else
qla24xx_post_gpnid_work(fcport->vha, &ea.id); qla24xx_post_gpnid_work(fcport->vha, &ea.id);
#endif #endif
} else { }
qla24xx_post_gnl_work(fcport->vha, fcport);
}
} }
static void static void
...@@ -1938,7 +1939,7 @@ qla24xx_handle_plogi_done_event(struct scsi_qla_host *vha, struct event_arg *ea) ...@@ -1938,7 +1939,7 @@ qla24xx_handle_plogi_done_event(struct scsi_qla_host *vha, struct event_arg *ea)
"%s %8phC DS %d LS %d rc %d login %d|%d rscn %d|%d data %x|%x iop %x|%x\n", "%s %8phC DS %d LS %d rc %d login %d|%d rscn %d|%d data %x|%x iop %x|%x\n",
__func__, fcport->port_name, fcport->disc_state, __func__, fcport->port_name, fcport->disc_state,
fcport->fw_login_state, ea->rc, ea->sp->gen2, fcport->login_gen, fcport->fw_login_state, ea->rc, ea->sp->gen2, fcport->login_gen,
ea->sp->gen2, fcport->rscn_gen|ea->sp->gen1, ea->sp->gen1, fcport->rscn_gen,
ea->data[0], ea->data[1], ea->iop[0], ea->iop[1]); ea->data[0], ea->data[1], ea->iop[0], ea->iop[1]);
if ((fcport->fw_login_state == DSC_LS_PLOGI_PEND) || if ((fcport->fw_login_state == DSC_LS_PLOGI_PEND) ||
...@@ -1960,7 +1961,11 @@ qla24xx_handle_plogi_done_event(struct scsi_qla_host *vha, struct event_arg *ea) ...@@ -1960,7 +1961,11 @@ qla24xx_handle_plogi_done_event(struct scsi_qla_host *vha, struct event_arg *ea)
set_bit(RELOGIN_NEEDED, &vha->dpc_flags); set_bit(RELOGIN_NEEDED, &vha->dpc_flags);
return; return;
} else if (ea->sp->gen1 != fcport->rscn_gen) { } else if (ea->sp->gen1 != fcport->rscn_gen) {
ql_dbg(ql_dbg_disc, vha, 0x20d3,
"%s %8phC RSCN generation changed\n",
__func__, fcport->port_name);
qla_rscn_replay(fcport); qla_rscn_replay(fcport);
qlt_schedule_sess_for_deletion(fcport);
return; return;
} }
......
...@@ -1260,9 +1260,6 @@ void qlt_schedule_sess_for_deletion(struct fc_port *sess) ...@@ -1260,9 +1260,6 @@ void qlt_schedule_sess_for_deletion(struct fc_port *sess)
break; break;
} }
if (sess->deleted == QLA_SESS_DELETED)
sess->logout_on_delete = 0;
spin_lock_irqsave(&sess->vha->work_lock, flags); spin_lock_irqsave(&sess->vha->work_lock, flags);
if (sess->deleted == QLA_SESS_DELETION_IN_PROGRESS) { if (sess->deleted == QLA_SESS_DELETION_IN_PROGRESS) {
spin_unlock_irqrestore(&sess->vha->work_lock, flags); spin_unlock_irqrestore(&sess->vha->work_lock, flags);
...@@ -4080,7 +4077,6 @@ static void qlt_do_ctio_completion(struct scsi_qla_host *vha, ...@@ -4080,7 +4077,6 @@ static void qlt_do_ctio_completion(struct scsi_qla_host *vha,
* Session is already logged out, but we need * Session is already logged out, but we need
* to notify initiator, who's not aware of this * to notify initiator, who's not aware of this
*/ */
cmd->sess->logout_on_delete = 0;
cmd->sess->send_els_logo = 1; cmd->sess->send_els_logo = 1;
ql_dbg(ql_dbg_disc, vha, 0x20f8, ql_dbg(ql_dbg_disc, vha, 0x20f8,
"%s %d %8phC post del sess\n", "%s %d %8phC post del sess\n",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment