Commit 2ea00202 authored by Michael Reed's avatar Michael Reed Committed by James Bottomley

[SCSI] qla2xxx: Correct eh_abort recovery logic.

Fix the driver to return SUCCESS if the firmware or driver doesn't
have a command to abort, i.e., it's already been returned.  Without
this patch, error recovery will take the target offline as it tries
harder and harder to get the driver to return the command it no longer
has.
Signed-off-by: default avatarAndrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@SteelEye.com>
parent c005fb4f
......@@ -599,6 +599,7 @@ qla2x00_wait_for_loop_ready(scsi_qla_host_t *ha)
* Either SUCCESS or FAILED.
*
* Note:
* Only return FAILED if command not returned by firmware.
**************************************************************************/
int
qla2xxx_eh_abort(struct scsi_cmnd *cmd)
......@@ -609,11 +610,12 @@ qla2xxx_eh_abort(struct scsi_cmnd *cmd)
unsigned int id, lun;
unsigned long serial;
unsigned long flags;
int wait = 0;
if (!CMD_SP(cmd))
return FAILED;
return SUCCESS;
ret = FAILED;
ret = SUCCESS;
id = cmd->device->id;
lun = cmd->device->lun;
......@@ -642,7 +644,7 @@ qla2xxx_eh_abort(struct scsi_cmnd *cmd)
} else {
DEBUG3(printk("%s(%ld): abort_command "
"mbx success.\n", __func__, ha->host_no));
ret = SUCCESS;
wait = 1;
}
spin_lock_irqsave(&ha->hardware_lock, flags);
......@@ -651,17 +653,18 @@ qla2xxx_eh_abort(struct scsi_cmnd *cmd)
spin_unlock_irqrestore(&ha->hardware_lock, flags);
/* Wait for the command to be returned. */
if (ret == SUCCESS) {
if (wait) {
if (qla2x00_eh_wait_on_command(ha, cmd) != QLA_SUCCESS) {
qla_printk(KERN_ERR, ha,
"scsi(%ld:%d:%d): Abort handler timed out -- %lx "
"%x.\n", ha->host_no, id, lun, serial, ret);
ret = FAILED;
}
}
qla_printk(KERN_INFO, ha,
"scsi(%ld:%d:%d): Abort command issued -- %lx %x.\n", ha->host_no,
id, lun, serial, ret);
"scsi(%ld:%d:%d): Abort command issued -- %d %lx %x.\n",
ha->host_no, id, lun, wait, serial, ret);
return ret;
}
......
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