Skip to content

Commit

Permalink
[SCSI] qla2xxx: Correct eh_abort recovery logic.
Browse files Browse the repository at this point in the history
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: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
  • Loading branch information
Michael Reed authored and James Bottomley committed Apr 27, 2006
1 parent c005fb4 commit 2ea0020
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions drivers/scsi/qla2xxx/qla_os.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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;
Expand Down Expand Up @@ -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);

Expand All @@ -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;
}
Expand Down

0 comments on commit 2ea0020

Please sign in to comment.