forked from len0rd/rockbox
Fixed spindown bug: last_disk_activity was set 10 seconds into the future, which resulted in too long spindown delays.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@3826 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
4b392cd105
commit
c695f26c9f
1 changed files with 7 additions and 4 deletions
|
|
@ -110,9 +110,10 @@ static int wait_for_bsy(void) __attribute__ ((section (".icode")));
|
||||||
static int wait_for_bsy(void)
|
static int wait_for_bsy(void)
|
||||||
{
|
{
|
||||||
int timeout = current_tick + HZ*10;
|
int timeout = current_tick + HZ*10;
|
||||||
last_disk_activity = timeout;
|
while (TIME_BEFORE(current_tick, timeout) && (ATA_STATUS & STATUS_BSY)) {
|
||||||
while (TIME_BEFORE(current_tick, timeout) && (ATA_STATUS & STATUS_BSY))
|
last_disk_activity = current_tick;
|
||||||
yield();
|
yield();
|
||||||
|
}
|
||||||
|
|
||||||
if (TIME_BEFORE(current_tick, timeout))
|
if (TIME_BEFORE(current_tick, timeout))
|
||||||
return 1;
|
return 1;
|
||||||
|
|
@ -129,10 +130,12 @@ static int wait_for_rdy(void)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
timeout = current_tick + HZ*10;
|
timeout = current_tick + HZ*10;
|
||||||
last_disk_activity = timeout;
|
|
||||||
|
|
||||||
while (TIME_BEFORE(current_tick, timeout) && !(ATA_ALT_STATUS & STATUS_RDY))
|
while (TIME_BEFORE(current_tick, timeout) &&
|
||||||
|
!(ATA_ALT_STATUS & STATUS_RDY)) {
|
||||||
|
last_disk_activity = current_tick;
|
||||||
yield();
|
yield();
|
||||||
|
}
|
||||||
|
|
||||||
if (TIME_BEFORE(current_tick, timeout))
|
if (TIME_BEFORE(current_tick, timeout))
|
||||||
return STATUS_RDY;
|
return STATUS_RDY;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue