diff options
author | Tobias Diedrich <ranma+coreboot@tdiedrich.de> | 2010-06-17 19:14:42 +0000 |
---|---|---|
committer | Tobias Diedrich <ranma+coreboot@tdiedrich.de> | 2010-06-17 19:14:42 +0000 |
commit | 69028d5d31384a0a97bd42081cacb01eb5d52793 (patch) | |
tree | 168f782a2bbdf719eeeeb08ee217b9c5c2c1f096 | |
parent | a9b30ee002d828f3f5e8f77ce6d132bb353ed31f (diff) | |
download | rockbox-69028d5d31384a0a97bd42081cacb01eb5d52793.tar.gz rockbox-69028d5d31384a0a97bd42081cacb01eb5d52793.zip |
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
-rw-r--r-- | firmware/target/arm/as3525/dma-pl081.c | 2 | ||||
-rw-r--r-- | firmware/target/arm/as3525/sd-as3525.c | 8 |
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) | |||
45 | DMAC_CONFIGURATION &= ~(1<<0); | 45 | DMAC_CONFIGURATION &= ~(1<<0); |
46 | CGU_PERI &= ~CGU_DMA_CLOCK_ENABLE; | 46 | CGU_PERI &= ~CGU_DMA_CLOCK_ENABLE; |
47 | } | 47 | } |
48 | if (dma_used < 0) | ||
49 | panicf("dma_used < 0!"); | ||
48 | } | 50 | } |
49 | 51 | ||
50 | void dma_init(void) | 52 | 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, | |||
683 | { | 683 | { |
684 | ret = sd_init_card(drive); | 684 | ret = sd_init_card(drive); |
685 | if (!(card_info[drive].initialized)) | 685 | if (!(card_info[drive].initialized)) |
686 | goto sd_transfer_error; | 686 | goto sd_transfer_error_nodma; |
687 | } | 687 | } |
688 | 688 | ||
689 | if(count < 0) /* XXX: why is it signed ? */ | 689 | if(count < 0) /* XXX: why is it signed ? */ |
690 | { | 690 | { |
691 | ret = -20; | 691 | ret = -20; |
692 | goto sd_transfer_error; | 692 | goto sd_transfer_error_nodma; |
693 | } | 693 | } |
694 | if((start+count) > card_info[drive].numblocks) | 694 | if((start+count) > card_info[drive].numblocks) |
695 | { | 695 | { |
696 | ret = -21; | 696 | ret = -21; |
697 | goto sd_transfer_error; | 697 | goto sd_transfer_error_nodma; |
698 | } | 698 | } |
699 | 699 | ||
700 | /* skip SanDisk OF */ | 700 | /* skip SanDisk OF */ |
@@ -825,6 +825,8 @@ sd_transfer_error: | |||
825 | 825 | ||
826 | dma_release(); | 826 | dma_release(); |
827 | 827 | ||
828 | sd_transfer_error_nodma: | ||
829 | |||
828 | #ifndef BOOTLOADER | 830 | #ifndef BOOTLOADER |
829 | led(false); | 831 | led(false); |
830 | sd_enable(false); | 832 | sd_enable(false); |