diff options
author | Nicolas Pitre <nico@cam.org> | 2006-05-05 17:32:24 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2006-05-05 17:32:24 -0400 |
commit | 99532559dc7a8e686b2cef14c780a7ad5dbd4a31 (patch) | |
tree | 3dff94d714f3e32739cd898b7eebf7910e1ef227 /arch/arm | |
parent | b7d7ef87e15dea105be59ec8f14e2f92182dd421 (diff) |
[ARM] 3500/1: fix PXA27x DMA allocation priority
Patch from Nicolas Pitre
Intel PXA27x developers manual section 5.4.1.1 lists a priority
distribution for the DMA channels differently than what the code
currently assumes. This patch fixes that.
Noticed by Simon Vogl <vogl@soft.uni-linz.ac.at>
Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm')
-rw-r--r-- | arch/arm/mach-pxa/dma.c | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/arch/arm/mach-pxa/dma.c b/arch/arm/mach-pxa/dma.c index 458112b21e25..7d8c85486c66 100644 --- a/arch/arm/mach-pxa/dma.c +++ b/arch/arm/mach-pxa/dma.c | |||
@@ -45,23 +45,16 @@ int pxa_request_dma (char *name, pxa_dma_prio prio, | |||
45 | 45 | ||
46 | local_irq_save(flags); | 46 | local_irq_save(flags); |
47 | 47 | ||
48 | /* try grabbing a DMA channel with the requested priority */ | 48 | do { |
49 | for (i = prio; i < prio + PXA_DMA_NBCH(prio); i++) { | 49 | /* try grabbing a DMA channel with the requested priority */ |
50 | if (!dma_channels[i].name) { | 50 | pxa_for_each_dma_prio (i, prio) { |
51 | found = 1; | ||
52 | break; | ||
53 | } | ||
54 | } | ||
55 | |||
56 | if (!found) { | ||
57 | /* requested prio group is full, try hier priorities */ | ||
58 | for (i = prio-1; i >= 0; i--) { | ||
59 | if (!dma_channels[i].name) { | 51 | if (!dma_channels[i].name) { |
60 | found = 1; | 52 | found = 1; |
61 | break; | 53 | break; |
62 | } | 54 | } |
63 | } | 55 | } |
64 | } | 56 | /* if requested prio group is full, try a hier priority */ |
57 | } while (!found && prio--); | ||
65 | 58 | ||
66 | if (found) { | 59 | if (found) { |
67 | DCSR(i) = DCSR_STARTINTR|DCSR_ENDINTR|DCSR_BUSERR; | 60 | DCSR(i) = DCSR_STARTINTR|DCSR_ENDINTR|DCSR_BUSERR; |