diff options
author | Finn Thain <fthain@telegraphics.com.au> | 2016-01-03 06:05:33 +0100 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2016-01-07 03:42:58 +0100 |
commit | f35d34744c85b2ea31a3fe624616c10229ff1fb3 (patch) | |
tree | 6139565921034d1952b1d41c10ab93b8e99998d7 | |
parent | ncr5380: Fix !REQ timeout in do_abort() (diff) | |
download | linux-f35d34744c85b2ea31a3fe624616c10229ff1fb3.tar.xz linux-f35d34744c85b2ea31a3fe624616c10229ff1fb3.zip |
ncr5380: Fix bus phase in do_abort()
NCR5380_poll_politely() returns either 0 (success) or -ETIMEDOUT. However,
in do_abort(), the return value is incorrectly taken to be the status
register value. This means that the bus is put into DATA OUT phase instead
of MESSAGE OUT. Fix this.
Signed-off-by: Finn Thain <fthain@telegraphics.com.au>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Tested-by: Ondrej Zary <linux@rainbow-software.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
-rw-r--r-- | drivers/scsi/NCR5380.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/scsi/NCR5380.c b/drivers/scsi/NCR5380.c index baa8785ff22b..334d253fe75a 100644 --- a/drivers/scsi/NCR5380.c +++ b/drivers/scsi/NCR5380.c @@ -1493,11 +1493,11 @@ static int do_abort(struct Scsi_Host *instance) if (rc < 0) return -1; - tmp = (unsigned char)rc; + tmp = NCR5380_read(STATUS_REG) & PHASE_MASK; NCR5380_write(TARGET_COMMAND_REG, PHASE_SR_TO_TCR(tmp)); - if ((tmp & PHASE_MASK) != PHASE_MSGOUT) { + if (tmp != PHASE_MSGOUT) { NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE | ICR_ASSERT_ATN | ICR_ASSERT_ACK); rc = NCR5380_poll_politely(instance, STATUS_REG, SR_REQ, 0, 3 * HZ); NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE | ICR_ASSERT_ATN); |