+ spin_lock_irqsave(&dest_ha->list_lock, cpu_flags);
+ if (sp->state == SRB_DONE_STATE) {
+ /* IO in done_q -- leave it */
+ DEBUG(printk("scsi(%ld): Found in Done queue pid %ld sp=%p.\n",
+ dest_ha->host_no, cmd->serial_number, sp));
+ } else if (sp->state == SRB_SUSPENDED_STATE) {
+ DEBUG(printk("scsi(%ld): Found SP %p in suspended state "
+ "- pid %ld:\n",
+ dest_ha->host_no, sp, cmd->serial_number));
+ DEBUG(qla2x00_dump_buffer((uint8_t *)sp, sizeof(srb_t));)
+ } else if (sp->state == SRB_ACTIVE_STATE) {
+ /*
+ * IO is with ISP find the command in our active list.
+ */
+ spin_unlock_irqrestore(&dest_ha->list_lock, cpu_flags);
+ spin_lock_irqsave(&dest_ha->hardware_lock, flags);
+ if (sp == dest_ha->outstanding_cmds[
+ (unsigned long)sp->cmd->host_scribble]) {
+
+ DEBUG(printk("cmd_timeout: Found in ISP \n"));
+
+ if (sp->flags & SRB_TAPE) {
+ /*
+ * We cannot allow the midlayer error handler
+ * to wakeup and begin the abort process.
+ * Extend the timer so that the firmware can
+ * properly return the IOCB.
+ */
+ DEBUG(printk("cmd_timeout: Extending timeout "
+ "of FCP2 tape command!\n"));
+ qla2x00_extend_timeout(sp->cmd,
+ EXTEND_CMD_TIMEOUT);
+ }
+ sp->state = SRB_ACTIVE_TIMEOUT_STATE;
+ spin_unlock_irqrestore(&dest_ha->hardware_lock, flags);
+ } else {
+ spin_unlock_irqrestore(&dest_ha->hardware_lock, flags);
+ printk(KERN_INFO
+ "qla_cmd_timeout: State indicates it is with "
+ "ISP, But not in active array\n");
+ }
+ spin_lock_irqsave(&dest_ha->list_lock, cpu_flags);
+ } else if (sp->state == SRB_ACTIVE_TIMEOUT_STATE) {
+ DEBUG(printk("qla2100%ld: Found in Active timeout state"
+ "pid %ld, State = %x., \n",
+ dest_ha->host_no,
+ sp->cmd->serial_number, sp->state);)
+ } else {
+ /* EMPTY */
+ DEBUG2(printk("cmd_timeout%ld: LOST command state = "
+ "0x%x, sp=%p\n",
+ vis_ha->host_no, sp->state,sp);)
+
+ qla_printk(KERN_INFO, vis_ha,
+ "cmd_timeout: LOST command state = 0x%x\n", sp->state);
+ }
+ spin_unlock_irqrestore(&dest_ha->list_lock, cpu_flags);
+