Commit ca35c5a1 authored by Quinn Tran's avatar Quinn Tran Committed by Greg Kroah-Hartman

scsi: qla2xxx: Use correct qpair for ABTS/CMD

[ Upstream commit 49cecca7 ]

On Abort of initiator scsi command, the abort needs to follow the same qpair
as the the scsi command to prevent out of order processing.
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>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent a1f14df3
...@@ -1772,18 +1772,18 @@ int ...@@ -1772,18 +1772,18 @@ int
qla24xx_async_abort_cmd(srb_t *cmd_sp, bool wait) qla24xx_async_abort_cmd(srb_t *cmd_sp, bool wait)
{ {
scsi_qla_host_t *vha = cmd_sp->vha; scsi_qla_host_t *vha = cmd_sp->vha;
fc_port_t *fcport = cmd_sp->fcport;
struct srb_iocb *abt_iocb; struct srb_iocb *abt_iocb;
srb_t *sp; srb_t *sp;
int rval = QLA_FUNCTION_FAILED; int rval = QLA_FUNCTION_FAILED;
sp = qla2x00_get_sp(vha, fcport, GFP_KERNEL); sp = qla2xxx_get_qpair_sp(cmd_sp->qpair, cmd_sp->fcport, GFP_KERNEL);
if (!sp) if (!sp)
goto done; goto done;
abt_iocb = &sp->u.iocb_cmd; abt_iocb = &sp->u.iocb_cmd;
sp->type = SRB_ABT_CMD; sp->type = SRB_ABT_CMD;
sp->name = "abort"; sp->name = "abort";
sp->qpair = cmd_sp->qpair;
if (wait) if (wait)
sp->flags = SRB_WAKEUP_ON_COMP; sp->flags = SRB_WAKEUP_ON_COMP;
...@@ -1792,18 +1792,13 @@ qla24xx_async_abort_cmd(srb_t *cmd_sp, bool wait) ...@@ -1792,18 +1792,13 @@ qla24xx_async_abort_cmd(srb_t *cmd_sp, bool wait)
qla2x00_init_timer(sp, qla2x00_get_async_timeout(vha)); qla2x00_init_timer(sp, qla2x00_get_async_timeout(vha));
abt_iocb->u.abt.cmd_hndl = cmd_sp->handle; abt_iocb->u.abt.cmd_hndl = cmd_sp->handle;
abt_iocb->u.abt.req_que_no = cpu_to_le16(cmd_sp->qpair->req->id);
if (vha->flags.qpairs_available && cmd_sp->qpair)
abt_iocb->u.abt.req_que_no =
cpu_to_le16(cmd_sp->qpair->req->id);
else
abt_iocb->u.abt.req_que_no = cpu_to_le16(vha->req->id);
sp->done = qla24xx_abort_sp_done; sp->done = qla24xx_abort_sp_done;
ql_dbg(ql_dbg_async, vha, 0x507c, ql_dbg(ql_dbg_async, vha, 0x507c,
"Abort command issued - hdl=%x, target_id=%x\n", "Abort command issued - hdl=%x, type=%x\n",
cmd_sp->handle, fcport->tgt_id); cmd_sp->handle, cmd_sp->type);
rval = qla2x00_start_sp(sp); rval = qla2x00_start_sp(sp);
if (rval != QLA_SUCCESS) if (rval != QLA_SUCCESS)
......
...@@ -3297,19 +3297,21 @@ qla24xx_abort_iocb(srb_t *sp, struct abort_entry_24xx *abt_iocb) ...@@ -3297,19 +3297,21 @@ qla24xx_abort_iocb(srb_t *sp, struct abort_entry_24xx *abt_iocb)
{ {
struct srb_iocb *aio = &sp->u.iocb_cmd; struct srb_iocb *aio = &sp->u.iocb_cmd;
scsi_qla_host_t *vha = sp->vha; scsi_qla_host_t *vha = sp->vha;
struct req_que *req = vha->req; struct req_que *req = sp->qpair->req;
memset(abt_iocb, 0, sizeof(struct abort_entry_24xx)); memset(abt_iocb, 0, sizeof(struct abort_entry_24xx));
abt_iocb->entry_type = ABORT_IOCB_TYPE; abt_iocb->entry_type = ABORT_IOCB_TYPE;
abt_iocb->entry_count = 1; abt_iocb->entry_count = 1;
abt_iocb->handle = cpu_to_le32(MAKE_HANDLE(req->id, sp->handle)); abt_iocb->handle = cpu_to_le32(MAKE_HANDLE(req->id, sp->handle));
if (sp->fcport) {
abt_iocb->nport_handle = cpu_to_le16(sp->fcport->loop_id); abt_iocb->nport_handle = cpu_to_le16(sp->fcport->loop_id);
abt_iocb->handle_to_abort =
cpu_to_le32(MAKE_HANDLE(aio->u.abt.req_que_no,
aio->u.abt.cmd_hndl));
abt_iocb->port_id[0] = sp->fcport->d_id.b.al_pa; abt_iocb->port_id[0] = sp->fcport->d_id.b.al_pa;
abt_iocb->port_id[1] = sp->fcport->d_id.b.area; abt_iocb->port_id[1] = sp->fcport->d_id.b.area;
abt_iocb->port_id[2] = sp->fcport->d_id.b.domain; abt_iocb->port_id[2] = sp->fcport->d_id.b.domain;
}
abt_iocb->handle_to_abort =
cpu_to_le32(MAKE_HANDLE(aio->u.abt.req_que_no,
aio->u.abt.cmd_hndl));
abt_iocb->vp_index = vha->vp_idx; abt_iocb->vp_index = vha->vp_idx;
abt_iocb->req_que_no = cpu_to_le16(aio->u.abt.req_que_no); abt_iocb->req_que_no = cpu_to_le16(aio->u.abt.req_que_no);
/* Send the command to the firmware */ /* Send the command to the firmware */
......
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