summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Purchase <shotofadds@rockbox.org>2009-06-22 18:06:08 +0000
committerRob Purchase <shotofadds@rockbox.org>2009-06-22 18:06:08 +0000
commit67c86a76d989430dbb87d95d5a0f280e3c3b458f (patch)
tree17b24500680e1e9f7093bf02b65f20978d735599
parent4b831753e799f969b473b0b0fb48317722d7b98e (diff)
downloadrockbox-67c86a76d989430dbb87d95d5a0f280e3c3b458f.tar.gz
rockbox-67c86a76d989430dbb87d95d5a0f280e3c3b458f.zip
TCC78x: Make the NAND driver yield during reads (thanks to bertrik for spotting the obvious error that caused this to crash until now). Fixes the D2 'delay before playback starts' bug.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21465 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--firmware/target/arm/ata-nand-telechips.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/firmware/target/arm/ata-nand-telechips.c b/firmware/target/arm/ata-nand-telechips.c
index 5401f0d3ab..ceabf96169 100644
--- a/firmware/target/arm/ata-nand-telechips.c
+++ b/firmware/target/arm/ata-nand-telechips.c
@@ -40,6 +40,9 @@ long last_disk_activity = -1;
40/** static, private data **/ 40/** static, private data **/
41static bool initialized = false; 41static bool initialized = false;
42 42
43static long next_yield = 0;
44#define MIN_YIELD_PERIOD 1000
45
43static struct mutex ata_mtx SHAREDBSS_ATTR; 46static struct mutex ata_mtx SHAREDBSS_ATTR;
44 47
45#if defined(COWON_D2) || defined(IAUDIO_7) 48#if defined(COWON_D2) || defined(IAUDIO_7)
@@ -714,6 +717,14 @@ int nand_read_sectors(IF_MV2(int drive,) unsigned long start, int incount,
714 return -1; 717 return -1;
715 } 718 }
716 719
720#ifdef CPU_TCC780X /* 77x doesn't have USEC_TIMER yet */
721 if (TIME_AFTER(USEC_TIMER, next_yield))
722 {
723 next_yield = USEC_TIMER + MIN_YIELD_PERIOD;
724 yield();
725 }
726#endif
727
717 inbuf += SECTOR_SIZE; 728 inbuf += SECTOR_SIZE;
718 incount--; 729 incount--;
719 secmod++; 730 secmod++;