mirror of https://gitee.com/openkylin/linux.git
scsi: qla2xxx: Tear down session if FW say it is down
The completion status 0x28 (ppc = be = 0x2800) below indicates session is not there, trigger session deletion. qla2xxx [000b:04:00.1]-8009:8: DEVICE RESET ISSUED nexus=8:1:51 cmd=c000001432d0f600. qla2xxx [000b:04:00.1]-5039:8: Async-tmf error - hdl=67b completion status(2800). qla2xxx [000b:04:00.1]-8030:8: TM IOCB failed (102). qla2xxx [000b:04:00.1]-800c:8: do_reset failed for cmd=c000001432d0f600. qla2xxx [000b:04:00.1]-800f:8: DEVICE RESET FAILED: Task management failed nexus=8:1:51 cmd=c000001432d0f600. qla2xxx [000b:04:00.1]-8009:8: DEVICE RESET ISSUED nexus=8:1:52 cmd=c000001432d0c200. qla2xxx [000b:04:00.1]-5039:8: Async-tmf error - hdl=67c completion status(2800). qla2xxx [000b:04:00.1]-8030:8: TM IOCB failed (102). Link: https://lore.kernel.org/r/20201202132312.19966-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>
This commit is contained in:
parent
a6dcfe0848
commit
e4fc78f48d
|
@ -2226,11 +2226,13 @@ qla24xx_tm_iocb_entry(scsi_qla_host_t *vha, struct req_que *req, void *tsk)
|
||||||
srb_t *sp;
|
srb_t *sp;
|
||||||
struct srb_iocb *iocb;
|
struct srb_iocb *iocb;
|
||||||
struct sts_entry_24xx *sts = (struct sts_entry_24xx *)tsk;
|
struct sts_entry_24xx *sts = (struct sts_entry_24xx *)tsk;
|
||||||
|
u16 comp_status;
|
||||||
|
|
||||||
sp = qla2x00_get_sp_from_handle(vha, func, req, tsk);
|
sp = qla2x00_get_sp_from_handle(vha, func, req, tsk);
|
||||||
if (!sp)
|
if (!sp)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
comp_status = le16_to_cpu(sts->comp_status);
|
||||||
iocb = &sp->u.iocb_cmd;
|
iocb = &sp->u.iocb_cmd;
|
||||||
type = sp->name;
|
type = sp->name;
|
||||||
fcport = sp->fcport;
|
fcport = sp->fcport;
|
||||||
|
@ -2244,7 +2246,7 @@ qla24xx_tm_iocb_entry(scsi_qla_host_t *vha, struct req_que *req, void *tsk)
|
||||||
} else if (sts->comp_status != cpu_to_le16(CS_COMPLETE)) {
|
} else if (sts->comp_status != cpu_to_le16(CS_COMPLETE)) {
|
||||||
ql_log(ql_log_warn, fcport->vha, 0x5039,
|
ql_log(ql_log_warn, fcport->vha, 0x5039,
|
||||||
"Async-%s error - hdl=%x completion status(%x).\n",
|
"Async-%s error - hdl=%x completion status(%x).\n",
|
||||||
type, sp->handle, sts->comp_status);
|
type, sp->handle, comp_status);
|
||||||
iocb->u.tmf.data = QLA_FUNCTION_FAILED;
|
iocb->u.tmf.data = QLA_FUNCTION_FAILED;
|
||||||
} else if ((le16_to_cpu(sts->scsi_status) &
|
} else if ((le16_to_cpu(sts->scsi_status) &
|
||||||
SS_RESPONSE_INFO_LEN_VALID)) {
|
SS_RESPONSE_INFO_LEN_VALID)) {
|
||||||
|
@ -2260,6 +2262,30 @@ qla24xx_tm_iocb_entry(scsi_qla_host_t *vha, struct req_que *req, void *tsk)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
switch (comp_status) {
|
||||||
|
case CS_PORT_LOGGED_OUT:
|
||||||
|
case CS_PORT_CONFIG_CHG:
|
||||||
|
case CS_PORT_BUSY:
|
||||||
|
case CS_INCOMPLETE:
|
||||||
|
case CS_PORT_UNAVAILABLE:
|
||||||
|
case CS_TIMEOUT:
|
||||||
|
case CS_RESET:
|
||||||
|
if (atomic_read(&fcport->state) == FCS_ONLINE) {
|
||||||
|
ql_dbg(ql_dbg_disc, fcport->vha, 0x3021,
|
||||||
|
"-Port to be marked lost on fcport=%02x%02x%02x, current port state= %s comp_status %x.\n",
|
||||||
|
fcport->d_id.b.domain, fcport->d_id.b.area,
|
||||||
|
fcport->d_id.b.al_pa,
|
||||||
|
port_state_str[FCS_ONLINE],
|
||||||
|
comp_status);
|
||||||
|
|
||||||
|
qlt_schedule_sess_for_deletion(fcport);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
if (iocb->u.tmf.data != QLA_SUCCESS)
|
if (iocb->u.tmf.data != QLA_SUCCESS)
|
||||||
ql_dump_buffer(ql_dbg_async + ql_dbg_buffer, sp->vha, 0x5055,
|
ql_dump_buffer(ql_dbg_async + ql_dbg_buffer, sp->vha, 0x5055,
|
||||||
sts, sizeof(*sts));
|
sts, sizeof(*sts));
|
||||||
|
|
Loading…
Reference in New Issue