aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/dma/fsldma.c
diff options
context:
space:
mode:
authorSteven J. Magnani <steve@digidescorp.com>2010-03-01 00:18:16 -0500
committerDan Williams <dan.j.williams@intel.com>2010-03-01 00:18:16 -0500
commit76bd061f5c7b7550cdaed68ad6219ea7cee288fc (patch)
tree5ae663b8bab6bd77cab2b8bc095c0743cc2da138 /drivers/dma/fsldma.c
parent6ca3a7a96e91b1aa8c704153c992b191d35b5747 (diff)
fsldma: Fix cookie issues
fsl_dma_update_completed_cookie() appears to calculate the last completed cookie incorrectly in the corner case where DMA on cookie 1 is in progress just following a cookie wrap. Signed-off-by: Steven J. Magnani <steve@digidescorp.com> Acked-by: Ira W. Snyder <iws@ovro.caltech.edu> [dan.j.williams@intel.com: fix an integer overflow warning with INT_MAX] Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'drivers/dma/fsldma.c')
-rw-r--r--drivers/dma/fsldma.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/dma/fsldma.c b/drivers/dma/fsldma.c
index 6541ebf8bf63..bbb4be5a3ff4 100644
--- a/drivers/dma/fsldma.c
+++ b/drivers/dma/fsldma.c
@@ -819,8 +819,11 @@ static void fsl_dma_update_completed_cookie(struct fsldma_chan *chan)
819 desc = to_fsl_desc(chan->ld_running.prev); 819 desc = to_fsl_desc(chan->ld_running.prev);
820 if (dma_is_idle(chan)) 820 if (dma_is_idle(chan))
821 cookie = desc->async_tx.cookie; 821 cookie = desc->async_tx.cookie;
822 else 822 else {
823 cookie = desc->async_tx.cookie - 1; 823 cookie = desc->async_tx.cookie - 1;
824 if (unlikely(cookie < DMA_MIN_COOKIE))
825 cookie = DMA_MAX_COOKIE;
826 }
824 827
825 chan->completed_cookie = cookie; 828 chan->completed_cookie = cookie;
826 829