mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-12-09 05:05:20 -05:00
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:
parent
a9b30ee002
commit
69028d5d31
2 changed files with 7 additions and 3 deletions
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue