forked from len0rd/rockbox
The newest ATA driver fixes broke the ata_spinup_time information
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@3515 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
6edea74ea6
commit
4502e982af
1 changed files with 6 additions and 2 deletions
|
|
@ -170,10 +170,12 @@ int ata_read_sectors(unsigned long start,
|
||||||
int timeout;
|
int timeout;
|
||||||
int count;
|
int count;
|
||||||
void* buf;
|
void* buf;
|
||||||
|
int spinup_start;
|
||||||
|
|
||||||
mutex_lock(&ata_mtx);
|
mutex_lock(&ata_mtx);
|
||||||
|
|
||||||
last_disk_activity = current_tick;
|
last_disk_activity = current_tick;
|
||||||
|
spinup_start = current_tick;
|
||||||
|
|
||||||
led(true);
|
led(true);
|
||||||
|
|
||||||
|
|
@ -242,7 +244,7 @@ int ata_read_sectors(unsigned long start,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (spinup) {
|
if (spinup) {
|
||||||
ata_spinup_time = current_tick - last_disk_activity;
|
ata_spinup_time = current_tick - spinup_start;
|
||||||
spinup = false;
|
spinup = false;
|
||||||
sleeping = false;
|
sleeping = false;
|
||||||
poweroff = false;
|
poweroff = false;
|
||||||
|
|
@ -314,6 +316,7 @@ int ata_write_sectors(unsigned long start,
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
int spinup_start;
|
||||||
|
|
||||||
if (start == 0)
|
if (start == 0)
|
||||||
panicf("Writing on sector 0\n");
|
panicf("Writing on sector 0\n");
|
||||||
|
|
@ -321,6 +324,7 @@ int ata_write_sectors(unsigned long start,
|
||||||
mutex_lock(&ata_mtx);
|
mutex_lock(&ata_mtx);
|
||||||
|
|
||||||
last_disk_activity = current_tick;
|
last_disk_activity = current_tick;
|
||||||
|
spinup_start = current_tick;
|
||||||
|
|
||||||
led(true);
|
led(true);
|
||||||
|
|
||||||
|
|
@ -369,7 +373,7 @@ int ata_write_sectors(unsigned long start,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (spinup) {
|
if (spinup) {
|
||||||
ata_spinup_time = current_tick - last_disk_activity;
|
ata_spinup_time = current_tick - spinup_start;
|
||||||
spinup = false;
|
spinup = false;
|
||||||
sleeping = false;
|
sleeping = false;
|
||||||
poweroff = false;
|
poweroff = false;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue