Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 308125
b: refs/heads/master
c: bcd59b0
h: refs/heads/master
i:
  308123: 96ae7f2
v: v3
  • Loading branch information
Sebastian Andrzej Siewior authored and Sekhar Nori committed May 9, 2012
1 parent 95476c1 commit 7c1f4b4
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 36 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 477099f189101a6675d93782164446015a3633bd
refs/heads/master: bcd59b0f0c14b0584c1213ee3b53d5f84517c419
69 changes: 34 additions & 35 deletions trunk/arch/arm/mach-davinci/dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -353,51 +353,50 @@ static int irq2ctlr(int irq)
*****************************************************************************/
static irqreturn_t dma_irq_handler(int irq, void *data)
{
int i;
int ctlr;
unsigned int cnt = 0;
u32 sh_ier;
u32 sh_ipr;
u32 bank;

ctlr = irq2ctlr(irq);
if (ctlr < 0)
return IRQ_NONE;

dev_dbg(data, "dma_irq_handler\n");

if ((edma_shadow0_read_array(ctlr, SH_IPR, 0) == 0) &&
(edma_shadow0_read_array(ctlr, SH_IPR, 1) == 0))
return IRQ_NONE;
sh_ipr = edma_shadow0_read_array(ctlr, SH_IPR, 0);
if (!sh_ipr) {
sh_ipr = edma_shadow0_read_array(ctlr, SH_IPR, 1);
if (!sh_ipr)
return IRQ_NONE;
sh_ier = edma_shadow0_read_array(ctlr, SH_IER, 1);
bank = 1;
} else {
sh_ier = edma_shadow0_read_array(ctlr, SH_IER, 0);
bank = 0;
}

while (1) {
int j;
if (edma_shadow0_read_array(ctlr, SH_IPR, 0) &
edma_shadow0_read_array(ctlr, SH_IER, 0))
j = 0;
else if (edma_shadow0_read_array(ctlr, SH_IPR, 1) &
edma_shadow0_read_array(ctlr, SH_IER, 1))
j = 1;
else
break;
dev_dbg(data, "IPR%d %08x\n", j,
edma_shadow0_read_array(ctlr, SH_IPR, j));
for (i = 0; i < 32; i++) {
int k = (j << 5) + i;
if ((edma_shadow0_read_array(ctlr, SH_IPR, j) & BIT(i))
&& (edma_shadow0_read_array(ctlr,
SH_IER, j) & BIT(i))) {
/* Clear the corresponding IPR bits */
edma_shadow0_write_array(ctlr, SH_ICR, j,
BIT(i));
if (edma_cc[ctlr]->intr_data[k].callback)
edma_cc[ctlr]->intr_data[k].callback(
k, DMA_COMPLETE,
edma_cc[ctlr]->intr_data[k].
data);
}
do {
u32 slot;
u32 channel;

dev_dbg(data, "IPR%d %08x\n", bank, sh_ipr);

slot = __ffs(sh_ipr);
sh_ipr &= ~(BIT(slot));

if (sh_ier & BIT(slot)) {
channel = (bank << 5) | slot;
/* Clear the corresponding IPR bits */
edma_shadow0_write_array(ctlr, SH_ICR, bank,
BIT(slot));
if (edma_cc[ctlr]->intr_data[channel].callback)
edma_cc[ctlr]->intr_data[channel].callback(
channel, DMA_COMPLETE,
edma_cc[ctlr]->intr_data[channel].data);
}
cnt++;
if (cnt > 10)
break;
}
} while (sh_ipr);

edma_shadow0_write(ctlr, SH_IEVAL, 1);
return IRQ_HANDLED;
}
Expand Down

0 comments on commit 7c1f4b4

Please sign in to comment.