forked from len0rd/rockbox
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
This commit is contained in:
parent
648ccc8f0f
commit
6a58106e97
1 changed files with 5 additions and 3 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue