Commit b027a5ac authored by Darren Trapp's avatar Darren Trapp Committed by Martin K. Petersen

scsi: qla2xxx: Fix queue ID for async abort with Multiqueue

[mkp: sparse warning]
Signed-off-by: default avatarDarren Trapp <darren.trapp@cavium.com>
Signed-off-by: default avatarHimanshu Madhani <himanshu.madhani@cavium.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 8a7eac2f
...@@ -442,6 +442,7 @@ struct srb_iocb { ...@@ -442,6 +442,7 @@ struct srb_iocb {
struct { struct {
uint32_t cmd_hndl; uint32_t cmd_hndl;
__le16 comp_status; __le16 comp_status;
__le16 req_que_no;
struct completion comp; struct completion comp;
} abt; } abt;
struct ct_arg ctarg; struct ct_arg ctarg;
......
...@@ -1565,6 +1565,13 @@ qla24xx_async_abort_cmd(srb_t *cmd_sp) ...@@ -1565,6 +1565,13 @@ qla24xx_async_abort_cmd(srb_t *cmd_sp)
sp->name = "abort"; sp->name = "abort";
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;
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;
abt_iocb->timeout = qla24xx_abort_iocb_timeout; abt_iocb->timeout = qla24xx_abort_iocb_timeout;
init_completion(&abt_iocb->u.abt.comp); init_completion(&abt_iocb->u.abt.comp);
...@@ -1599,6 +1606,9 @@ qla24xx_async_abort_command(srb_t *sp) ...@@ -1599,6 +1606,9 @@ qla24xx_async_abort_command(srb_t *sp)
struct qla_hw_data *ha = vha->hw; struct qla_hw_data *ha = vha->hw;
struct req_que *req = vha->req; struct req_que *req = vha->req;
if (vha->flags.qpairs_available && sp->qpair)
req = sp->qpair->req;
spin_lock_irqsave(&ha->hardware_lock, flags); spin_lock_irqsave(&ha->hardware_lock, flags);
for (handle = 1; handle < req->num_outstanding_cmds; handle++) { for (handle = 1; handle < req->num_outstanding_cmds; handle++) {
if (req->outstanding_cmds[handle] == sp) if (req->outstanding_cmds[handle] == sp)
......
...@@ -3275,7 +3275,9 @@ qla24xx_abort_iocb(srb_t *sp, struct abort_entry_24xx *abt_iocb) ...@@ -3275,7 +3275,9 @@ qla24xx_abort_iocb(srb_t *sp, struct abort_entry_24xx *abt_iocb)
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(aio->u.abt.req_que_no,
aio->u.abt.cmd_hndl));
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 = abt_iocb->handle_to_abort =
cpu_to_le32(MAKE_HANDLE(req->id, aio->u.abt.cmd_hndl)); cpu_to_le32(MAKE_HANDLE(req->id, aio->u.abt.cmd_hndl));
...@@ -3283,7 +3285,7 @@ qla24xx_abort_iocb(srb_t *sp, struct abort_entry_24xx *abt_iocb) ...@@ -3283,7 +3285,7 @@ qla24xx_abort_iocb(srb_t *sp, struct abort_entry_24xx *abt_iocb)
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->vp_index = vha->vp_idx; abt_iocb->vp_index = vha->vp_idx;
abt_iocb->req_que_no = cpu_to_le16(req->id); 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 */
wmb(); wmb();
} }
......
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