aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/ata
diff options
context:
space:
mode:
authorAlexander Motin <mav@FreeBSD.org>2010-11-06 19:11:49 +0000
committerAlexander Motin <mav@FreeBSD.org>2010-11-06 19:11:49 +0000
commit285ba17329aae8c8e9e824f3dc5e9ce8c5c04779 (patch)
tree4f6b136f80602bf83c7195428490690df6d0367d /sys/dev/ata
parenta7c6aabdc34925cc166cca82c5a6ea452f57d765 (diff)
Notes
Diffstat (limited to 'sys/dev/ata')
-rw-r--r--sys/dev/ata/ata-lowlevel.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/sys/dev/ata/ata-lowlevel.c b/sys/dev/ata/ata-lowlevel.c
index 3ef31cf7908b..2234efbe8053 100644
--- a/sys/dev/ata/ata-lowlevel.c
+++ b/sys/dev/ata/ata-lowlevel.c
@@ -672,7 +672,8 @@ ata_generic_command(struct ata_request *request)
/* ready to issue command ? */
if (ata_wait(ch, request->unit, 0) < 0) {
device_printf(request->parent, "timeout waiting to issue command\n");
- return -1;
+ request->flags |= ATA_R_TIMEOUT;
+ return (-1);
}
/* enable interrupt */
@@ -697,13 +698,16 @@ ata_generic_command(struct ata_request *request)
/* command interrupt device ? just return and wait for interrupt */
if (request->flags & ATA_R_ATAPI_INTR)
- return 0;
+ return (0);
/* command processed ? */
res = ata_wait(ch, request->unit, 0);
if (res != 0) {
- if (res < 0)
- device_printf(request->parent, "timeout waiting for PACKET command\n");
+ if (res < 0) {
+ device_printf(request->parent,
+ "timeout waiting for PACKET command\n");
+ request->flags |= ATA_R_TIMEOUT;
+ }
return (-1);
}
/* wait for ready to write ATAPI command block */
@@ -717,9 +721,10 @@ ata_generic_command(struct ata_request *request)
DELAY(20);
}
if (timeout <= 0) {
- device_printf(request->parent, "timeout waiting for ATAPI ready\n");
- request->result = EIO;
- return -1;
+ device_printf(request->parent,
+ "timeout waiting for ATAPI ready\n");
+ request->flags |= ATA_R_TIMEOUT;
+ return (-1);
}
/* this seems to be needed for some (slow) devices */
@@ -735,7 +740,7 @@ ata_generic_command(struct ata_request *request)
/* issue command to controller */
ATA_IDX_OUTB(ch, ATA_COMMAND, request->u.ata.command);
}
- return 0;
+ return (0);
}
static void