From 060609a2023bfcc99472cfe4e94a2cc3704bd92c Mon Sep 17 00:00:00 2001 From: Michael Sevakis Date: Sat, 22 Jan 2011 09:23:31 +0000 Subject: 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 --- firmware/drivers/ata.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'firmware/drivers') 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); static int set_multiple_mode(int sectors); static int set_features(void); +#ifndef ATA_TARGET_POLLING STATICIRAM ICODE_ATTR int wait_for_bsy(void) { long timeout = current_tick + HZ*30; @@ -235,6 +236,12 @@ STATICIRAM ICODE_ATTR int wait_for_rdy(void) return 0; /* timeout */ } +#else +extern int ata_wait_for_bsy(void); +extern int ata_wait_for_rdy(void); +#define wait_for_bsy ata_wait_for_bsy +#define wait_for_rdy ata_wait_for_rdy +#endif STATICIRAM ICODE_ATTR int wait_for_start_of_transfer(void) { -- cgit v1.2.3