diff options
author | Michael Sevakis <jethead71@rockbox.org> | 2011-01-22 09:23:31 +0000 |
---|---|---|
committer | Michael Sevakis <jethead71@rockbox.org> | 2011-01-22 09:23:31 +0000 |
commit | 060609a2023bfcc99472cfe4e94a2cc3704bd92c (patch) | |
tree | cc51f89e8dc4cca19ff4453195cd712888314368 /firmware/drivers | |
parent | 5729be4017c6e6081069c56637c4339aaddddd0b (diff) | |
download | rockbox-060609a2023bfcc99472cfe4e94a2cc3704bd92c.tar.gz rockbox-060609a2023bfcc99472cfe4e94a2cc3704bd92c.zip |
i.MX31: Busy wait for a couple microseconds at most then sleep until next tick when polling drive status. This prevents pointless jumps to overdrive speed from perceived high load when waiting for lengthy ops to complete such as spinup and sleep.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29108 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/drivers')
-rw-r--r-- | firmware/drivers/ata.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/firmware/drivers/ata.c b/firmware/drivers/ata.c index 7d37d051c9..2cdd67482a 100644 --- a/firmware/drivers/ata.c +++ b/firmware/drivers/ata.c | |||
@@ -201,6 +201,7 @@ static int perform_soft_reset(void); | |||
201 | static int set_multiple_mode(int sectors); | 201 | static int set_multiple_mode(int sectors); |
202 | static int set_features(void); | 202 | static int set_features(void); |
203 | 203 | ||
204 | #ifndef ATA_TARGET_POLLING | ||
204 | STATICIRAM ICODE_ATTR int wait_for_bsy(void) | 205 | STATICIRAM ICODE_ATTR int wait_for_bsy(void) |
205 | { | 206 | { |
206 | long timeout = current_tick + HZ*30; | 207 | long timeout = current_tick + HZ*30; |
@@ -235,6 +236,12 @@ STATICIRAM ICODE_ATTR int wait_for_rdy(void) | |||
235 | 236 | ||
236 | return 0; /* timeout */ | 237 | return 0; /* timeout */ |
237 | } | 238 | } |
239 | #else | ||
240 | extern int ata_wait_for_bsy(void); | ||
241 | extern int ata_wait_for_rdy(void); | ||
242 | #define wait_for_bsy ata_wait_for_bsy | ||
243 | #define wait_for_rdy ata_wait_for_rdy | ||
244 | #endif | ||
238 | 245 | ||
239 | STATICIRAM ICODE_ATTR int wait_for_start_of_transfer(void) | 246 | STATICIRAM ICODE_ATTR int wait_for_start_of_transfer(void) |
240 | { | 247 | { |