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
This commit is contained in:
Tobias Diedrich 2010-06-17 19:14:42 +00:00
parent a9b30ee002
commit 69028d5d31
2 changed files with 7 additions and 3 deletions

View file

@ -45,6 +45,8 @@ void dma_release(void)
DMAC_CONFIGURATION &= ~(1<<0); DMAC_CONFIGURATION &= ~(1<<0);
CGU_PERI &= ~CGU_DMA_CLOCK_ENABLE; CGU_PERI &= ~CGU_DMA_CLOCK_ENABLE;
} }
if (dma_used < 0)
panicf("dma_used < 0!");
} }
void dma_init(void) void dma_init(void)

View file

@ -683,18 +683,18 @@ static int sd_transfer_sectors(IF_MD2(int drive,) unsigned long start,
{ {
ret = sd_init_card(drive); ret = sd_init_card(drive);
if (!(card_info[drive].initialized)) if (!(card_info[drive].initialized))
goto sd_transfer_error; goto sd_transfer_error_nodma;
} }
if(count < 0) /* XXX: why is it signed ? */ if(count < 0) /* XXX: why is it signed ? */
{ {
ret = -20; ret = -20;
goto sd_transfer_error; goto sd_transfer_error_nodma;
} }
if((start+count) > card_info[drive].numblocks) if((start+count) > card_info[drive].numblocks)
{ {
ret = -21; ret = -21;
goto sd_transfer_error; goto sd_transfer_error_nodma;
} }
/* skip SanDisk OF */ /* skip SanDisk OF */
@ -825,6 +825,8 @@ sd_transfer_error:
dma_release(); dma_release();
sd_transfer_error_nodma:
#ifndef BOOTLOADER #ifndef BOOTLOADER
led(false); led(false);
sd_enable(false); sd_enable(false);