diff options
author | Quinn Tran <quinn.tran@cavium.com> | 2017-06-13 20:47:16 -0700 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2017-06-27 21:21:40 -0400 |
commit | c5419e2618b951a73d590e0752810686d52c45cf (patch) | |
tree | ea981f272872c554b543bf31b0f5d5d542829cd7 /drivers/scsi/qla2xxx/qla_os.c | |
parent | 8ba1ddb31f528cb45be39b7f3b600261afaa7920 (diff) |
scsi: qla2xxx: Combine Active command arrays.
Merge active/outstanding cmd arrays from target side and initiator side
together in prepration for Target Multi Queue support.
Signed-off-by: Quinn Tran <quinn.tran@cavium.com>
Signed-off-by: Himanshu Madhani <himanshu.madhani@cavium.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/qla2xxx/qla_os.c')
-rw-r--r-- | drivers/scsi/qla2xxx/qla_os.c | 75 |
1 files changed, 54 insertions, 21 deletions
diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c index dcf50aa61e9d..d92e65b40c44 100644 --- a/drivers/scsi/qla2xxx/qla_os.c +++ b/drivers/scsi/qla2xxx/qla_os.c @@ -1649,8 +1649,9 @@ qla2x00_abort_all_cmds(scsi_qla_host_t *vha, int res) srb_t *sp; struct qla_hw_data *ha = vha->hw; struct req_que *req; - - qlt_host_reset_handler(ha); + struct qla_tgt *tgt = vha->vha_tgt.qla_tgt; + struct qla_tgt_cmd *cmd; + uint8_t trace = 0; spin_lock_irqsave(&ha->hardware_lock, flags); for (que = 0; que < ha->max_req_queues; que++) { @@ -1662,27 +1663,57 @@ qla2x00_abort_all_cmds(scsi_qla_host_t *vha, int res) for (cnt = 1; cnt < req->num_outstanding_cmds; cnt++) { sp = req->outstanding_cmds[cnt]; if (sp) { - /* Don't abort commands in adapter during EEH - * recovery as it's not accessible/responding. - */ - if (GET_CMD_SP(sp) && !ha->flags.eeh_busy && - (sp->type == SRB_SCSI_CMD)) { - /* Get a reference to the sp and drop the lock. - * The reference ensures this sp->done() call - * - and not the call in qla2xxx_eh_abort() - - * ends the SCSI command (with result 'res'). + req->outstanding_cmds[cnt] = NULL; + if (sp->cmd_type == TYPE_SRB) { + /* + * Don't abort commands in adapter + * during EEH recovery as it's not + * accessible/responding. */ - sp_get(sp); - spin_unlock_irqrestore(&ha->hardware_lock, flags); - status = qla2xxx_eh_abort(GET_CMD_SP(sp)); - spin_lock_irqsave(&ha->hardware_lock, flags); - /* Get rid of extra reference if immediate exit - * from ql2xxx_eh_abort */ - if (status == FAILED && (qla2x00_isp_reg_stat(ha))) - atomic_dec(&sp->ref_count); + if (GET_CMD_SP(sp) && + !ha->flags.eeh_busy && + (sp->type == SRB_SCSI_CMD)) { + /* + * Get a reference to the sp + * and drop the lock. The + * reference ensures this + * sp->done() call and not the + * call in qla2xxx_eh_abort() + * ends the SCSI command (with + * result 'res'). + */ + sp_get(sp); + spin_unlock_irqrestore( + &ha->hardware_lock, flags); + status = qla2xxx_eh_abort( + GET_CMD_SP(sp)); + spin_lock_irqsave( + &ha->hardware_lock, flags); + /* + * Get rid of extra reference + * if immediate exit from + * ql2xxx_eh_abort + */ + if (status == FAILED && + (qla2x00_isp_reg_stat(ha))) + atomic_dec( + &sp->ref_count); + } + sp->done(sp, res); + } else { + if (!vha->hw->tgt.tgt_ops || !tgt || + qla_ini_mode_enabled(vha)) { + if (!trace) + ql_dbg(ql_dbg_tgt_mgt, + vha, 0xf003, + "HOST-ABORT-HNDLR: dpc_flags=%lx. Target mode disabled\n", + vha->dpc_flags); + continue; + } + cmd = (struct qla_tgt_cmd *)sp; + qlt_abort_cmd_on_host_reset(cmd->vha, + cmd); } - req->outstanding_cmds[cnt] = NULL; - sp->done(sp, res); } } } @@ -5862,6 +5893,8 @@ qla2x00_timer(scsi_qla_host_t *vha) sp = req->outstanding_cmds[index]; if (!sp) continue; + if (sp->cmd_type != TYPE_SRB) + continue; if (sp->type != SRB_SCSI_CMD) continue; sfcp = sp->fcport; |