summaryrefslogtreecommitdiffstats
path: root/firmware/target/arm/imx233/sdmmc-imx233.c
diff options
context:
space:
mode:
authorAmaury Pouly <amaury.pouly@gmail.com>2013-08-20 18:33:16 +0200
committerAmaury Pouly <amaury.pouly@gmail.com>2013-08-21 20:18:36 +0200
commit9a587219740939c5c6476a8088831959a6c92517 (patch)
treec0aaea6622c043fa5af1487be9cd1032886dfa1e /firmware/target/arm/imx233/sdmmc-imx233.c
parent6d7734649dc2302f565098becddab0412f8e589e (diff)
downloadrockbox-9a587219740939c5c6476a8088831959a6c92517.tar.gz
rockbox-9a587219740939c5c6476a8088831959a6c92517.tar.bz2
rockbox-9a587219740939c5c6476a8088831959a6c92517.zip
imx233: rework yield management for wait state, didn't make sense
Change-Id: I5ecb1afb5461018c2c9675d5f4ee1c6e4ded636d
Diffstat (limited to 'firmware/target/arm/imx233/sdmmc-imx233.c')
-rw-r--r--firmware/target/arm/imx233/sdmmc-imx233.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/firmware/target/arm/imx233/sdmmc-imx233.c b/firmware/target/arm/imx233/sdmmc-imx233.c
index e520fcc6e6..9aafb5820a 100644
--- a/firmware/target/arm/imx233/sdmmc-imx233.c
+++ b/firmware/target/arm/imx233/sdmmc-imx233.c
@@ -148,8 +148,7 @@ static uint8_t aligned_buffer[SDMMC_NUM_DRIVES][512] CACHEALIGN_ATTR;
static tCardInfo sdmmc_card_info[SDMMC_NUM_DRIVES];
static struct mutex mutex[SDMMC_NUM_DRIVES];
static int disk_last_activity[SDMMC_NUM_DRIVES];
-#define MIN_YIELD_PERIOD 5 /* ticks */
-static int next_yield = 0;
+#define MIN_YIELD_PERIOD 5
#define SDMMC_INFO(drive) sdmmc_card_info[drive]
#define SDMMC_RCA(drive) SDMMC_INFO(drive).rca
@@ -266,7 +265,8 @@ static int wait_for_state(int drive, unsigned state)
unsigned long response;
unsigned int timeout = current_tick + 5*HZ;
int cmd_retry = 10;
-
+ int next_yield = current_tick + MIN_YIELD_PERIOD;
+
while (1)
{
/* NOTE: rely on SD_SEND_STATUS=MMC_SEND_STATUS */
@@ -750,8 +750,6 @@ static void sdmmc_thread(void)
}
else
{
- next_yield = current_tick;
-
if(!idle_notified)
{
call_storage_idle_notifys(false);
@@ -759,7 +757,6 @@ static void sdmmc_thread(void)
}
}
break;
- break;
case SYS_USB_CONNECTED:
usb_acknowledge(SYS_USB_CONNECTED_ACK);
/* Wait until the USB cable is extracted again */