summaryrefslogtreecommitdiff
path: root/firmware/target
diff options
context:
space:
mode:
authorRafaël Carré <rafael.carre@gmail.com>2010-06-06 13:47:30 +0000
committerRafaël Carré <rafael.carre@gmail.com>2010-06-06 13:47:30 +0000
commit5c9e76a1e0b1e6017acc6d8503eb12b42b4d0de7 (patch)
treeddc980eda66c9e4446ec6c8cf417207dc615ecd1 /firmware/target
parenta1a9084160077ab4fd05d5c94a09139d62fc6ff0 (diff)
sd-as3525v2: check the (supposedly) card data line for business when writing
Fix panics when deleting large files from µSD Tested on problematic Transcend 4GB Class 6 git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26631 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target')
-rw-r--r--firmware/target/arm/as3525/sd-as3525v2.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/firmware/target/arm/as3525/sd-as3525v2.c b/firmware/target/arm/as3525/sd-as3525v2.c
index 1a555e745d..a668f65e0c 100644
--- a/firmware/target/arm/as3525/sd-as3525v2.c
+++ b/firmware/target/arm/as3525/sd-as3525v2.c
@@ -878,6 +878,12 @@ static int sd_transfer_sectors(IF_MD2(int drive,) unsigned long start,
last_disk_activity = current_tick;
+ if(write)
+ {
+ /* wait for the card to exit programming state */
+ while(MCI_STATUS & DATA_BUSY) ;
+ }
+
if(!send_cmd(drive, SD_STOP_TRANSMISSION, 0, MCI_NO_RESP, NULL))
{
ret = -666;