summaryrefslogtreecommitdiff
path: root/firmware/drivers/ata.c
diff options
context:
space:
mode:
authorBjörn Stenberg <bjorn@haxx.se>2003-02-27 13:26:09 +0000
committerBjörn Stenberg <bjorn@haxx.se>2003-02-27 13:26:09 +0000
commit6a58106e972c8dd7c1034f13f1b4138ee604869c (patch)
treef992d0e78c7c6c4cb6b60164788384c8df4f9d04 /firmware/drivers/ata.c
parent648ccc8f0f344377b485164f53865321f39565d0 (diff)
An attempt to get rid of the "red freeze" problem: Perform a soft reset on read error.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@3351 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/drivers/ata.c')
-rw-r--r--firmware/drivers/ata.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/firmware/drivers/ata.c b/firmware/drivers/ata.c
index e65200eea2..c2a02cb03c 100644
--- a/firmware/drivers/ata.c
+++ b/firmware/drivers/ata.c
@@ -191,6 +191,9 @@ int ata_read_sectors(unsigned long start,
}
}
+ timeout = current_tick + READ_TIMEOUT;
+
+ retry:
ATA_SELECT = ata_device;
if (!wait_for_rdy())
{
@@ -198,9 +201,6 @@ int ata_read_sectors(unsigned long start,
return -2;
}
- timeout = current_tick + READ_TIMEOUT;
-
- retry:
buf = inbuf;
count = incount;
while (TIME_BEFORE(current_tick, timeout)) {
@@ -228,6 +228,8 @@ int ata_read_sectors(unsigned long start,
if ( ATA_ALT_STATUS & (STATUS_ERR | STATUS_DF) ) {
ret = -5;
+ if (perform_soft_reset())
+ break;
goto retry;
}