aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi
diff options
context:
space:
mode:
authorMichael Reed <mdr@sgi.com>2006-04-27 19:25:30 -0400
committerJames Bottomley <jejb@mulgrave.il.steeleye.com>2006-04-27 19:29:55 -0400
commit2ea0020250f6aeaec1ed3adf9069973a91eff57c (patch)
tree3134b7875f0049fdc3daac60f9af4d92155a0cb3 /drivers/scsi
parentc005fb4fb2d23ba29ad21dee5042b2f8451ca8ba (diff)
[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: Andrew Vasquez <andrew.vasquez@qlogic.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/scsi')
-rw-r--r--drivers/scsi/qla2xxx/qla_os.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c
index bef84966d7ad..584fe5d8e507 100644
--- a/drivers/scsi/qla2xxx/qla_os.c
+++ b/drivers/scsi/qla2xxx/qla_os.c
@@ -599,6 +599,7 @@ qla2x00_wait_for_loop_ready(scsi_qla_host_t *ha)
599* Either SUCCESS or FAILED. 599* Either SUCCESS or FAILED.
600* 600*
601* Note: 601* Note:
602* Only return FAILED if command not returned by firmware.
602**************************************************************************/ 603**************************************************************************/
603int 604int
604qla2xxx_eh_abort(struct scsi_cmnd *cmd) 605qla2xxx_eh_abort(struct scsi_cmnd *cmd)
@@ -609,11 +610,12 @@ qla2xxx_eh_abort(struct scsi_cmnd *cmd)
609 unsigned int id, lun; 610 unsigned int id, lun;
610 unsigned long serial; 611 unsigned long serial;
611 unsigned long flags; 612 unsigned long flags;
613 int wait = 0;
612 614
613 if (!CMD_SP(cmd)) 615 if (!CMD_SP(cmd))
614 return FAILED; 616 return SUCCESS;
615 617
616 ret = FAILED; 618 ret = SUCCESS;
617 619
618 id = cmd->device->id; 620 id = cmd->device->id;
619 lun = cmd->device->lun; 621 lun = cmd->device->lun;
@@ -642,7 +644,7 @@ qla2xxx_eh_abort(struct scsi_cmnd *cmd)
642 } else { 644 } else {
643 DEBUG3(printk("%s(%ld): abort_command " 645 DEBUG3(printk("%s(%ld): abort_command "
644 "mbx success.\n", __func__, ha->host_no)); 646 "mbx success.\n", __func__, ha->host_no));
645 ret = SUCCESS; 647 wait = 1;
646 } 648 }
647 spin_lock_irqsave(&ha->hardware_lock, flags); 649 spin_lock_irqsave(&ha->hardware_lock, flags);
648 650
@@ -651,17 +653,18 @@ qla2xxx_eh_abort(struct scsi_cmnd *cmd)
651 spin_unlock_irqrestore(&ha->hardware_lock, flags); 653 spin_unlock_irqrestore(&ha->hardware_lock, flags);
652 654
653 /* Wait for the command to be returned. */ 655 /* Wait for the command to be returned. */
654 if (ret == SUCCESS) { 656 if (wait) {
655 if (qla2x00_eh_wait_on_command(ha, cmd) != QLA_SUCCESS) { 657 if (qla2x00_eh_wait_on_command(ha, cmd) != QLA_SUCCESS) {
656 qla_printk(KERN_ERR, ha, 658 qla_printk(KERN_ERR, ha,
657 "scsi(%ld:%d:%d): Abort handler timed out -- %lx " 659 "scsi(%ld:%d:%d): Abort handler timed out -- %lx "
658 "%x.\n", ha->host_no, id, lun, serial, ret); 660 "%x.\n", ha->host_no, id, lun, serial, ret);
661 ret = FAILED;
659 } 662 }
660 } 663 }
661 664
662 qla_printk(KERN_INFO, ha, 665 qla_printk(KERN_INFO, ha,
663 "scsi(%ld:%d:%d): Abort command issued -- %lx %x.\n", ha->host_no, 666 "scsi(%ld:%d:%d): Abort command issued -- %d %lx %x.\n",
664 id, lun, serial, ret); 667 ha->host_no, id, lun, wait, serial, ret);
665 668
666 return ret; 669 return ret;
667} 670}