summaryrefslogtreecommitdiff
path: root/drivers/scsi/atari_NCR5380.c
diff options
context:
space:
mode:
authorFinn Thain <fthain@telegraphics.com.au>2016-01-03 08:05:17 +0300
committerMartin K. Petersen <martin.petersen@oracle.com>2016-01-07 05:42:55 +0300
commit1f1b0c74dfaf6264d239823ed5aeb8dcdd62838c (patch)
treea2546a9f0c41190abf44da820688166609fc13f8 /drivers/scsi/atari_NCR5380.c
parentac9399d09544525ff4713ab942cb44a7cea29a84 (diff)
downloadlinux-1f1b0c74dfaf6264d239823ed5aeb8dcdd62838c.tar.xz
ncr5380: Proceed with next command after NCR5380_select() calls scsi_done
If a target disappears from the SCSI bus, NCR5380_select() may subsequently fail with a time-out. In this situation, scsi_done is called and NCR5380_select() returns 0. Both hostdata->connected and hostdata->selecting are NULL and the main loop should proceed with the next command in the issue queue. Clarify this logic. Signed-off-by: Finn Thain <fthain@telegraphics.com.au> Reviewed-by: Hannes Reinecke <hare@suse.com> Tested-by: Ondrej Zary <linux@rainbow-software.org> Tested-by: Michael Schmitz <schmitzmic@gmail.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/atari_NCR5380.c')
-rw-r--r--drivers/scsi/atari_NCR5380.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/scsi/atari_NCR5380.c b/drivers/scsi/atari_NCR5380.c
index 80f6830d9f3c..bedc7e2efa1d 100644
--- a/drivers/scsi/atari_NCR5380.c
+++ b/drivers/scsi/atari_NCR5380.c
@@ -1139,13 +1139,13 @@ static void NCR5380_main(struct work_struct *work)
cmd_get_tag(tmp, tmp->cmnd[0] != REQUEST_SENSE);
#endif
if (!NCR5380_select(instance, tmp)) {
+ /* OK or bad target */
local_irq_disable();
hostdata->retain_dma_intr--;
- /* release if target did not response! */
maybe_release_dma_irq(instance);
local_irq_restore(flags);
- break;
} else {
+ /* Need to retry */
local_irq_disable();
LIST(tmp, hostdata->issue_queue);
SET_NEXT(tmp, hostdata->issue_queue);
@@ -1157,9 +1157,9 @@ static void NCR5380_main(struct work_struct *work)
local_irq_restore(flags);
dprintk(NDEBUG_MAIN, "scsi%d: main(): select() failed, "
"returned to issue_queue\n", HOSTNO);
- if (hostdata->connected)
- break;
}
+ if (hostdata->connected)
+ break;
} /* if target/lun/target queue is not busy */
} /* for issue_queue */
} /* if (!hostdata->connected) */