diff options
author | Björn Stenberg <bjorn@haxx.se> | 2002-08-26 22:05:47 +0000 |
---|---|---|
committer | Björn Stenberg <bjorn@haxx.se> | 2002-08-26 22:05:47 +0000 |
commit | f0599be133804a47f76944d53dbeec29b7d86df8 (patch) | |
tree | 41d6656cad69ad1d43a6c6c2682ef8de7a43cd46 /firmware/drivers/ata.c | |
parent | 457b8a0a6743b7bee72d90e484055b7635861612 (diff) | |
download | rockbox-f0599be133804a47f76944d53dbeec29b7d86df8.tar.gz rockbox-f0599be133804a47f76944d53dbeec29b7d86df8.zip |
Don't call perform_sleep() while already sleeping
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@1988 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/drivers/ata.c')
-rw-r--r-- | firmware/drivers/ata.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/firmware/drivers/ata.c b/firmware/drivers/ata.c index e867ac2f50..ec0fe3567c 100644 --- a/firmware/drivers/ata.c +++ b/firmware/drivers/ata.c | |||
@@ -163,6 +163,7 @@ int ata_read_sectors(unsigned long start, | |||
163 | return -1; | 163 | return -1; |
164 | } | 164 | } |
165 | #endif | 165 | #endif |
166 | sleeping = false; | ||
166 | } | 167 | } |
167 | #endif | 168 | #endif |
168 | mutex_lock(&ata_mtx); | 169 | mutex_lock(&ata_mtx); |
@@ -179,7 +180,7 @@ int ata_read_sectors(unsigned long start, | |||
179 | ATA_NSECTOR = 0; /* 0 means 256 sectors */ | 180 | ATA_NSECTOR = 0; /* 0 means 256 sectors */ |
180 | else | 181 | else |
181 | ATA_NSECTOR = (unsigned char)count; | 182 | ATA_NSECTOR = (unsigned char)count; |
182 | 183 | ||
183 | ATA_SECTOR = start & 0xff; | 184 | ATA_SECTOR = start & 0xff; |
184 | ATA_LCYL = (start >> 8) & 0xff; | 185 | ATA_LCYL = (start >> 8) & 0xff; |
185 | ATA_HCYL = (start >> 16) & 0xff; | 186 | ATA_HCYL = (start >> 16) & 0xff; |
@@ -239,6 +240,7 @@ int ata_write_sectors(unsigned long start, | |||
239 | last_disk_activity = current_tick; | 240 | last_disk_activity = current_tick; |
240 | 241 | ||
241 | #ifndef USE_STANDBY | 242 | #ifndef USE_STANDBY |
243 | if ( sleeping ) { | ||
242 | #ifdef USE_POWEROFF | 244 | #ifdef USE_POWEROFF |
243 | if (ata_power_on()) { | 245 | if (ata_power_on()) { |
244 | return -1; | 246 | return -1; |
@@ -248,6 +250,8 @@ int ata_write_sectors(unsigned long start, | |||
248 | return -1; | 250 | return -1; |
249 | } | 251 | } |
250 | #endif | 252 | #endif |
253 | sleeping = false; | ||
254 | } | ||
251 | #endif | 255 | #endif |
252 | mutex_lock(&ata_mtx); | 256 | mutex_lock(&ata_mtx); |
253 | 257 | ||
@@ -408,6 +412,7 @@ static void ata_thread(void) | |||
408 | while (1) { | 412 | while (1) { |
409 | while ( queue_empty( &ata_queue ) ) { | 413 | while ( queue_empty( &ata_queue ) ) { |
410 | if ( sleep_timeout && | 414 | if ( sleep_timeout && |
415 | !sleeping && | ||
411 | TIME_AFTER( current_tick, | 416 | TIME_AFTER( current_tick, |
412 | last_user_activity + sleep_timeout ) && | 417 | last_user_activity + sleep_timeout ) && |
413 | TIME_AFTER( current_tick, | 418 | TIME_AFTER( current_tick, |