summaryrefslogtreecommitdiffstats
path: root/firmware
diff options
context:
space:
mode:
authorLinus Nielsen Feltzing <linus@haxx.se>2003-04-05 22:25:21 +0000
committerLinus Nielsen Feltzing <linus@haxx.se>2003-04-05 22:25:21 +0000
commit4502e982afbfc5cd69f541fcf1e741766f2c9297 (patch)
tree548e070a2480caf043d35023b89b6ed8956f1d35 /firmware
parent6edea74ea6deab4302fffa476d2b2dd724fa8f05 (diff)
downloadrockbox-4502e982afbfc5cd69f541fcf1e741766f2c9297.tar.gz
rockbox-4502e982afbfc5cd69f541fcf1e741766f2c9297.zip
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
Diffstat (limited to 'firmware')
-rw-r--r--firmware/drivers/ata.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/firmware/drivers/ata.c b/firmware/drivers/ata.c
index 5e6df91cc5..c72ebb8790 100644
--- a/firmware/drivers/ata.c
+++ b/firmware/drivers/ata.c
@@ -170,10 +170,12 @@ int ata_read_sectors(unsigned long start,
int timeout;
int count;
void* buf;
+ int spinup_start;
mutex_lock(&ata_mtx);
last_disk_activity = current_tick;
+ spinup_start = current_tick;
led(true);
@@ -242,7 +244,7 @@ int ata_read_sectors(unsigned long start,
}
if (spinup) {
- ata_spinup_time = current_tick - last_disk_activity;
+ ata_spinup_time = current_tick - spinup_start;
spinup = false;
sleeping = false;
poweroff = false;
@@ -314,6 +316,7 @@ int ata_write_sectors(unsigned long start,
{
int i;
int ret = 0;
+ int spinup_start;
if (start == 0)
panicf("Writing on sector 0\n");
@@ -321,6 +324,7 @@ int ata_write_sectors(unsigned long start,
mutex_lock(&ata_mtx);
last_disk_activity = current_tick;
+ spinup_start = current_tick;
led(true);
@@ -369,7 +373,7 @@ int ata_write_sectors(unsigned long start,
}
if (spinup) {
- ata_spinup_time = current_tick - last_disk_activity;
+ ata_spinup_time = current_tick - spinup_start;
spinup = false;
sleeping = false;
poweroff = false;