Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 89300
b: refs/heads/master
c: 1c62979
h: refs/heads/master
v: v3
  • Loading branch information
Zhang Wei authored and Dan Williams committed Apr 17, 2008
1 parent fe2991a commit 88e3663
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 6 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: 411e23dbe9c5867045f34ba83ee84b31b5b9950c
refs/heads/master: 1c62979ed29a8e2bf9fbe1db101c81a0089676f8
26 changes: 21 additions & 5 deletions trunk/drivers/dma/fsldma.c
Original file line number Diff line number Diff line change
Expand Up @@ -696,6 +696,8 @@ static irqreturn_t fsl_dma_chan_do_interrupt(int irq, void *data)
{
struct fsl_dma_chan *fsl_chan = (struct fsl_dma_chan *)data;
u32 stat;
int update_cookie = 0;
int xfer_ld_q = 0;

stat = get_sr(fsl_chan);
dev_dbg(fsl_chan->dev, "event: channel %d, stat = 0x%x\n",
Expand All @@ -720,8 +722,8 @@ static irqreturn_t fsl_dma_chan_do_interrupt(int irq, void *data)
* Now, update the completed cookie, and continue the
* next uncompleted transfer.
*/
fsl_dma_update_completed_cookie(fsl_chan);
fsl_chan_xfer_ld_queue(fsl_chan);
update_cookie = 1;
xfer_ld_q = 1;
}
stat &= ~FSL_DMA_SR_PE;
}
Expand All @@ -734,19 +736,33 @@ static irqreturn_t fsl_dma_chan_do_interrupt(int irq, void *data)
dev_dbg(fsl_chan->dev, "event: clndar %p, nlndar %p\n",
(void *)get_cdar(fsl_chan), (void *)get_ndar(fsl_chan));
stat &= ~FSL_DMA_SR_EOSI;
fsl_dma_update_completed_cookie(fsl_chan);
update_cookie = 1;
}

/* For MPC8349, EOCDI event need to update cookie
* and start the next transfer if it exist.
*/
if (stat & FSL_DMA_SR_EOCDI) {
dev_dbg(fsl_chan->dev, "event: End-of-Chain link INT\n");
stat &= ~FSL_DMA_SR_EOCDI;
update_cookie = 1;
xfer_ld_q = 1;
}

/* If it current transfer is the end-of-transfer,
* we should clear the Channel Start bit for
* prepare next transfer.
*/
if (stat & (FSL_DMA_SR_EOLNI | FSL_DMA_SR_EOCDI)) {
if (stat & FSL_DMA_SR_EOLNI) {
dev_dbg(fsl_chan->dev, "event: End-of-link INT\n");
stat &= ~FSL_DMA_SR_EOLNI;
fsl_chan_xfer_ld_queue(fsl_chan);
xfer_ld_q = 1;
}

if (update_cookie)
fsl_dma_update_completed_cookie(fsl_chan);
if (xfer_ld_q)
fsl_chan_xfer_ld_queue(fsl_chan);
if (stat)
dev_dbg(fsl_chan->dev, "event: unhandled sr 0x%02x\n",
stat);
Expand Down

0 comments on commit 88e3663

Please sign in to comment.