]> git.karo-electronics.de Git - mv-sheeva.git/commitdiff
dmaengine: imx-dma: dont complete descriptor for cyclic dma
authorVinod Koul <vinod.koul@linux.intel.com>
Fri, 20 Apr 2012 09:58:07 +0000 (15:28 +0530)
committerVinod Koul <vinod.koul@linux.intel.com>
Fri, 20 Apr 2012 09:58:07 +0000 (15:28 +0530)
the cookie updates completed the cyclic dma descriptor wrongly. This caused the
BUG_ON to be hit as submit is called for completed descriptor

Fix this by not marking the cyclic descriptor as complete

Tested-by: Javier Martin <javier.martin@vista-silicon.com>
Signed-off-by: Vinod Koul <vinod.koul@linux.intel.com>
drivers/dma/imx-dma.c

index a45b5d2a59879a02b3566dfaf2c8304f8d693921..bb787d8e15296ed17eef8032be17f4b52647d173 100644 (file)
@@ -571,11 +571,14 @@ static void imxdma_tasklet(unsigned long data)
        if (desc->desc.callback)
                desc->desc.callback(desc->desc.callback_param);
 
-       dma_cookie_complete(&desc->desc);
-
-       /* If we are dealing with a cyclic descriptor keep it on ld_active */
+       /* If we are dealing with a cyclic descriptor keep it on ld_active
+        * and dont mark the descripor as complete.
+        * Only in non-cyclic cases it would be marked as complete
+        */
        if (imxdma_chan_is_doing_cyclic(imxdmac))
                goto out;
+       else
+               dma_cookie_complete(&desc->desc);
 
        /* Free 2D slot if it was an interleaved transfer */
        if (imxdmac->enabled_2d) {