Skip to content

Commit 2a6bfa9

Browse files
Anil Gurumurthygregkh
authored andcommitted
scsi: qla2xxx: Query FW again before proceeding with login
commit 42b2dab upstream. Issue occurred during a continuous reboot test of several thousand iterations specific to a fabric topo with dual mode target where it sends a PLOGI/PRLI and then sends a LOGO. The initiator was also in the process of discovery and sent a PLOGI to the switch. It then queried a list of ports logged in via mbx 75h and the GPDB response indicated that the target was logged in. This caused a mismatch in the states between the driver and FW. Requery the FW for the state and proceed with the rest of discovery process. Fixes: a423994 ("scsi: qla2xxx: Add switch command to simplify fabric discovery") Cc: stable@vger.kernel.org Signed-off-by: Anil Gurumurthy <agurumurthy@marvell.com> Signed-off-by: Nilesh Javali <njavali@marvell.com> Reviewed-by: Himanshu Madhani <hmadhani2024@gmail.com> Link: https://patch.msgid.link/20251210101604.431868-11-njavali@marvell.com Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 05fcd59 commit 2a6bfa9

2 files changed

Lines changed: 34 additions & 4 deletions

File tree

drivers/scsi/qla2xxx/qla_init.c

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2462,8 +2462,23 @@ qla24xx_handle_plogi_done_event(struct scsi_qla_host *vha, struct event_arg *ea)
24622462
ea->sp->gen1, fcport->rscn_gen,
24632463
ea->data[0], ea->data[1], ea->iop[0], ea->iop[1]);
24642464

2465-
if ((fcport->fw_login_state == DSC_LS_PLOGI_PEND) ||
2466-
(fcport->fw_login_state == DSC_LS_PRLI_PEND)) {
2465+
if (fcport->fw_login_state == DSC_LS_PLOGI_PEND) {
2466+
ql_dbg(ql_dbg_disc, vha, 0x20ea,
2467+
"%s %d %8phC Remote is trying to login\n",
2468+
__func__, __LINE__, fcport->port_name);
2469+
/*
2470+
* If we get here, there is port thats already logged in,
2471+
* but it's state has not moved ahead. Recheck with FW on
2472+
* what state it is in and proceed ahead
2473+
*/
2474+
if (!N2N_TOPO(vha->hw)) {
2475+
fcport->fw_login_state = DSC_LS_PRLI_COMP;
2476+
qla24xx_post_gpdb_work(vha, fcport, 0);
2477+
}
2478+
return;
2479+
}
2480+
2481+
if (fcport->fw_login_state == DSC_LS_PRLI_PEND) {
24672482
ql_dbg(ql_dbg_disc, vha, 0x20ea,
24682483
"%s %d %8phC Remote is trying to login\n",
24692484
__func__, __LINE__, fcport->port_name);

drivers/scsi/qla2xxx/qla_isr.c

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1676,13 +1676,28 @@ qla2x00_async_event(scsi_qla_host_t *vha, struct rsp_que *rsp, uint16_t *mb)
16761676

16771677
/* Port logout */
16781678
fcport = qla2x00_find_fcport_by_loopid(vha, mb[1]);
1679-
if (!fcport)
1679+
if (!fcport) {
1680+
ql_dbg(ql_dbg_async, vha, 0x5011,
1681+
"Could not find fcport:%04x %04x %04x\n",
1682+
mb[1], mb[2], mb[3]);
16801683
break;
1681-
if (atomic_read(&fcport->state) != FCS_ONLINE)
1684+
}
1685+
1686+
if (atomic_read(&fcport->state) != FCS_ONLINE) {
1687+
ql_dbg(ql_dbg_async, vha, 0x5012,
1688+
"Port state is not online State:0x%x \n",
1689+
atomic_read(&fcport->state));
1690+
ql_dbg(ql_dbg_async, vha, 0x5012,
1691+
"Scheduling session for deletion \n");
1692+
fcport->logout_on_delete = 0;
1693+
qlt_schedule_sess_for_deletion(fcport);
16821694
break;
1695+
}
1696+
16831697
ql_dbg(ql_dbg_async, vha, 0x508a,
16841698
"Marking port lost loopid=%04x portid=%06x.\n",
16851699
fcport->loop_id, fcport->d_id.b24);
1700+
16861701
if (qla_ini_mode_enabled(vha)) {
16871702
fcport->logout_on_delete = 0;
16881703
qlt_schedule_sess_for_deletion(fcport);

0 commit comments

Comments
 (0)