summaryrefslogtreecommitdiff
path: root/firmware
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
parent648ccc8f0f344377b485164f53865321f39565d0 (diff)
downloadrockbox-6a58106e972c8dd7c1034f13f1b4138ee604869c.tar.gz
rockbox-6a58106e972c8dd7c1034f13f1b4138ee604869c.zip
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')
-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,
191 } 191 }
192 } 192 }
193 193
194 timeout = current_tick + READ_TIMEOUT;
195
196 retry:
194 ATA_SELECT = ata_device; 197 ATA_SELECT = ata_device;
195 if (!wait_for_rdy()) 198 if (!wait_for_rdy())
196 { 199 {
@@ -198,9 +201,6 @@ int ata_read_sectors(unsigned long start,
198 return -2; 201 return -2;
199 } 202 }
200 203
201 timeout = current_tick + READ_TIMEOUT;
202
203 retry:
204 buf = inbuf; 204 buf = inbuf;
205 count = incount; 205 count = incount;
206 while (TIME_BEFORE(current_tick, timeout)) { 206 while (TIME_BEFORE(current_tick, timeout)) {
@@ -228,6 +228,8 @@ int ata_read_sectors(unsigned long start,
228 228
229 if ( ATA_ALT_STATUS & (STATUS_ERR | STATUS_DF) ) { 229 if ( ATA_ALT_STATUS & (STATUS_ERR | STATUS_DF) ) {
230 ret = -5; 230 ret = -5;
231 if (perform_soft_reset())
232 break;
231 goto retry; 233 goto retry;
232 } 234 }
233 235