Commit 5f4fde24 authored by Andrew Vasquez's avatar Andrew Vasquez Committed by James Bottomley

[PATCH] [10/18] qla2xxx: Additional tape handling fixes

  Issue a big-hammer after link-down-timeout expires in order
  properly return tape commands to the mid-layer.
Signed-off-by: default avatarAndrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@SteelEye.com>
parent 6f1bbfb9
......@@ -4112,9 +4112,9 @@ qla2x00_abort_isp(scsi_qla_host_t *ha)
"Performing ISP error recovery - ha= %p.\n", ha);
qla2x00_reset_chip(ha);
atomic_set(&ha->loop_down_timer, LOOP_DOWN_TIME);
if (atomic_read(&ha->loop_state) != LOOP_DOWN) {
atomic_set(&ha->loop_state, LOOP_DOWN);
atomic_set(&ha->loop_down_timer, LOOP_DOWN_TIME);
qla2x00_mark_all_devices_lost(ha);
} else {
if (!atomic_read(&ha->loop_down_timer))
......@@ -4131,23 +4131,27 @@ qla2x00_abort_isp(scsi_qla_host_t *ha)
if (ha->actthreads)
ha->actthreads--;
sp->lun_queue->out_cnt--;
sp->flags = 0;
/*
* Set the cmd host_byte status depending on
* whether the scsi_error_handler is
* active or not.
*/
if (ha->host->eh_active != EH_ACTIVE) {
sp->cmd->result = DID_BUS_BUSY << 16;
if (sp->flags & SRB_TAPE) {
sp->cmd->result = DID_NO_CONNECT << 16;
} else {
sp->cmd->result = DID_RESET << 16;
if (ha->host->eh_active != EH_ACTIVE)
sp->cmd->result =
DID_BUS_BUSY << 16;
else
sp->cmd->result =
DID_RESET << 16;
}
sp->flags = 0;
sp->cmd->host_scribble = (unsigned char *)NULL;
add_to_done_queue(ha, sp);
}
}
spin_unlock_irqrestore(&ha->hardware_lock, flags);
qla2x00_nvram_config(ha);
......
......@@ -3609,6 +3609,8 @@ qla2x00_timer(scsi_qla_host_t *ha)
os_lun_t *lq;
os_tgt_t *tq;
int start_dpc = 0;
int index;
srb_t *sp;
/*
* We try and restart any request in the retry queue every second.
......@@ -3712,7 +3714,6 @@ qla2x00_timer(scsi_qla_host_t *ha)
if (atomic_read(&ha->loop_down_timer) > 0 &&
!(test_bit(ABORT_ISP_ACTIVE, &ha->dpc_flags)) && ha->flags.online) {
/* dg 10/30 if (atomic_read(&ha->loop_down_timer) == LOOP_DOWN_TIME) { */
if (atomic_read(&ha->loop_down_timer) ==
ha->loop_down_abort_time) {
......@@ -3723,6 +3724,22 @@ qla2x00_timer(scsi_qla_host_t *ha)
if (!IS_QLA2100(ha) && ha->link_down_timeout)
atomic_set(&ha->loop_state, LOOP_DEAD);
/* Schedule an ISP abort to return any tape commands. */
spin_lock_irqsave(&ha->hardware_lock, cpu_flags);
for (index = 1; index < MAX_OUTSTANDING_COMMANDS;
index++) {
sp = ha->outstanding_cmds[index];
if (!sp)
continue;
if (!(sp->fclun->fcport->flags &
FCF_TAPE_PRESENT))
continue;
set_bit(ISP_ABORT_NEEDED, &ha->dpc_flags);
break;
}
spin_unlock_irqrestore(&ha->hardware_lock, cpu_flags);
set_bit(ABORT_QUEUES_NEEDED, &ha->dpc_flags);
start_dpc++;
}
......
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