summaryrefslogtreecommitdiff
path: root/firmware/target
diff options
context:
space:
mode:
authorTobias Diedrich <ranma+coreboot@tdiedrich.de>2010-06-17 19:14:42 +0000
committerTobias Diedrich <ranma+coreboot@tdiedrich.de>2010-06-17 19:14:42 +0000
commit69028d5d31384a0a97bd42081cacb01eb5d52793 (patch)
tree168f782a2bbdf719eeeeb08ee217b9c5c2c1f096 /firmware/target
parenta9b30ee002d828f3f5e8f77ce6d132bb353ed31f (diff)
sd-as3525 was calling dma_release() without calling dma_retain() first, if
no card is in the sd slot. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26896 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target')
-rw-r--r--firmware/target/arm/as3525/dma-pl081.c2
-rw-r--r--firmware/target/arm/as3525/sd-as3525.c8
2 files changed, 7 insertions, 3 deletions
diff --git a/firmware/target/arm/as3525/dma-pl081.c b/firmware/target/arm/as3525/dma-pl081.c
index 43f6162e38..149488c7d1 100644
--- a/firmware/target/arm/as3525/dma-pl081.c
+++ b/firmware/target/arm/as3525/dma-pl081.c
@@ -45,6 +45,8 @@ void dma_release(void)
DMAC_CONFIGURATION &= ~(1<<0);
CGU_PERI &= ~CGU_DMA_CLOCK_ENABLE;
}
+ if (dma_used < 0)
+ panicf("dma_used < 0!");
}
void dma_init(void)
diff --git a/firmware/target/arm/as3525/sd-as3525.c b/firmware/target/arm/as3525/sd-as3525.c
index 8aaae55cf4..a1625c047a 100644
--- a/firmware/target/arm/as3525/sd-as3525.c
+++ b/firmware/target/arm/as3525/sd-as3525.c
@@ -683,18 +683,18 @@ static int sd_transfer_sectors(IF_MD2(int drive,) unsigned long start,
{
ret = sd_init_card(drive);
if (!(card_info[drive].initialized))
- goto sd_transfer_error;
+ goto sd_transfer_error_nodma;
}
if(count < 0) /* XXX: why is it signed ? */
{
ret = -20;
- goto sd_transfer_error;
+ goto sd_transfer_error_nodma;
}
if((start+count) > card_info[drive].numblocks)
{
ret = -21;
- goto sd_transfer_error;
+ goto sd_transfer_error_nodma;
}
/* skip SanDisk OF */
@@ -825,6 +825,8 @@ sd_transfer_error:
dma_release();
+sd_transfer_error_nodma:
+
#ifndef BOOTLOADER
led(false);
sd_enable(false);