Commit 25ad76b7 authored by Quinn Tran's avatar Quinn Tran Committed by Martin K. Petersen

scsi: qla2xxx: Retry switch command on time out

Retry GID_PN & GPN_ID switch commands for time out case.

Fixes: 726b8548 ("qla2xxx: Add framework for async fabric discovery")
Cc: <stable@vger.kernel.org> # 4.10+
Signed-off-by: default avatarQuinn Tran <quinn.tran@cavium.com>
Signed-off-by: default avatarHimanshu Madhani <himanshu.madhani@cavium.com>
Reviewed-by: default avatarHannes Reinecke <hare@suse.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent a084fd68
...@@ -175,6 +175,9 @@ qla2x00_chk_ms_status(scsi_qla_host_t *vha, ms_iocb_entry_t *ms_pkt, ...@@ -175,6 +175,9 @@ qla2x00_chk_ms_status(scsi_qla_host_t *vha, ms_iocb_entry_t *ms_pkt,
set_bit(LOCAL_LOOP_UPDATE, &vha->dpc_flags); set_bit(LOCAL_LOOP_UPDATE, &vha->dpc_flags);
} }
break; break;
case CS_TIMEOUT:
rval = QLA_FUNCTION_TIMEOUT;
/* drop through */
default: default:
ql_dbg(ql_dbg_disc, vha, 0x2033, ql_dbg(ql_dbg_disc, vha, 0x2033,
"%s failed, completion status (%x) on port_id: " "%s failed, completion status (%x) on port_id: "
...@@ -2889,9 +2892,22 @@ static void qla2x00_async_gidpn_sp_done(void *s, int res) ...@@ -2889,9 +2892,22 @@ static void qla2x00_async_gidpn_sp_done(void *s, int res)
ea.rc = res; ea.rc = res;
ea.event = FCME_GIDPN_DONE; ea.event = FCME_GIDPN_DONE;
if (res == QLA_FUNCTION_TIMEOUT) {
ql_dbg(ql_dbg_disc, sp->vha, 0xffff,
"Async done-%s WWPN %8phC timed out.\n",
sp->name, fcport->port_name);
qla24xx_post_gidpn_work(sp->vha, fcport);
sp->free(sp);
return;
} else if (res) {
ql_dbg(ql_dbg_disc, sp->vha, 0xffff,
"Async done-%s fail res %x, WWPN %8phC\n",
sp->name, res, fcport->port_name);
} else {
ql_dbg(ql_dbg_disc, vha, 0x204f, ql_dbg(ql_dbg_disc, vha, 0x204f,
"Async done-%s res %x, WWPN %8phC ID %3phC \n", "Async done-%s good WWPN %8phC ID %3phC\n",
sp->name, res, fcport->port_name, id); sp->name, fcport->port_name, id);
}
qla2x00_fcport_event_handler(vha, &ea); qla2x00_fcport_event_handler(vha, &ea);
...@@ -3217,11 +3233,6 @@ static void qla2x00_async_gpnid_sp_done(void *s, int res) ...@@ -3217,11 +3233,6 @@ static void qla2x00_async_gpnid_sp_done(void *s, int res)
sp->name, ct_req->req.port_id.port_id, sp->name, ct_req->req.port_id.port_id,
ct_rsp->rsp.gpn_id.port_name); ct_rsp->rsp.gpn_id.port_name);
if (res) {
sp->free(sp);
return;
}
memset(&ea, 0, sizeof(ea)); memset(&ea, 0, sizeof(ea));
memcpy(ea.port_name, ct_rsp->rsp.gpn_id.port_name, WWN_SIZE); memcpy(ea.port_name, ct_rsp->rsp.gpn_id.port_name, WWN_SIZE);
ea.sp = sp; ea.sp = sp;
...@@ -3231,6 +3242,13 @@ static void qla2x00_async_gpnid_sp_done(void *s, int res) ...@@ -3231,6 +3242,13 @@ static void qla2x00_async_gpnid_sp_done(void *s, int res)
ea.rc = res; ea.rc = res;
ea.event = FCME_GPNID_DONE; ea.event = FCME_GPNID_DONE;
if (res) {
if (res == QLA_FUNCTION_TIMEOUT)
qla24xx_post_gpnid_work(sp->vha, &ea.id);
sp->free(sp);
return;
}
qla2x00_fcport_event_handler(vha, &ea); qla2x00_fcport_event_handler(vha, &ea);
e = qla2x00_alloc_work(vha, QLA_EVT_GPNID_DONE); e = qla2x00_alloc_work(vha, QLA_EVT_GPNID_DONE);
......
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