[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>

authored by Michael Reed and committed by James Bottomley 2ea00202 c005fb4f

+9 -6
+9 -6
drivers/scsi/qla2xxx/qla_os.c
··· 599 * Either SUCCESS or FAILED. 600 * 601 * Note: 602 **************************************************************************/ 603 int 604 qla2xxx_eh_abort(struct scsi_cmnd *cmd) ··· 610 unsigned int id, lun; 611 unsigned long serial; 612 unsigned long flags; 613 614 if (!CMD_SP(cmd)) 615 - return FAILED; 616 617 - ret = FAILED; 618 619 id = cmd->device->id; 620 lun = cmd->device->lun; ··· 644 } else { 645 DEBUG3(printk("%s(%ld): abort_command " 646 "mbx success.\n", __func__, ha->host_no)); 647 - ret = SUCCESS; 648 } 649 spin_lock_irqsave(&ha->hardware_lock, flags); 650 ··· 653 spin_unlock_irqrestore(&ha->hardware_lock, flags); 654 655 /* Wait for the command to be returned. */ 656 - if (ret == SUCCESS) { 657 if (qla2x00_eh_wait_on_command(ha, cmd) != QLA_SUCCESS) { 658 qla_printk(KERN_ERR, ha, 659 "scsi(%ld:%d:%d): Abort handler timed out -- %lx " 660 "%x.\n", ha->host_no, id, lun, serial, ret); 661 } 662 } 663 664 qla_printk(KERN_INFO, ha, 665 - "scsi(%ld:%d:%d): Abort command issued -- %lx %x.\n", ha->host_no, 666 - id, lun, serial, ret); 667 668 return ret; 669 }
··· 599 * Either SUCCESS or FAILED. 600 * 601 * Note: 602 + * Only return FAILED if command not returned by firmware. 603 **************************************************************************/ 604 int 605 qla2xxx_eh_abort(struct scsi_cmnd *cmd) ··· 609 unsigned int id, lun; 610 unsigned long serial; 611 unsigned long flags; 612 + int wait = 0; 613 614 if (!CMD_SP(cmd)) 615 + return SUCCESS; 616 617 + ret = SUCCESS; 618 619 id = cmd->device->id; 620 lun = cmd->device->lun; ··· 642 } else { 643 DEBUG3(printk("%s(%ld): abort_command " 644 "mbx success.\n", __func__, ha->host_no)); 645 + wait = 1; 646 } 647 spin_lock_irqsave(&ha->hardware_lock, flags); 648 ··· 651 spin_unlock_irqrestore(&ha->hardware_lock, flags); 652 653 /* Wait for the command to be returned. */ 654 + if (wait) { 655 if (qla2x00_eh_wait_on_command(ha, cmd) != QLA_SUCCESS) { 656 qla_printk(KERN_ERR, ha, 657 "scsi(%ld:%d:%d): Abort handler timed out -- %lx " 658 "%x.\n", ha->host_no, id, lun, serial, ret); 659 + ret = FAILED; 660 } 661 } 662 663 qla_printk(KERN_INFO, ha, 664 + "scsi(%ld:%d:%d): Abort command issued -- %d %lx %x.\n", 665 + ha->host_no, id, lun, wait, serial, ret); 666 667 return ret; 668 }