dma: imx-sdma: start transfer in issue_pending
authorSascha Hauer <s.hauer@pengutronix.de>
Mon, 9 Jan 2012 09:32:50 +0000 (10:32 +0100)
committerVinod Koul <vinod.koul@linux.intel.com>
Mon, 30 Jan 2012 09:20:55 +0000 (14:50 +0530)
The DMA engine API requires that transfers are started in issue_pending
instead of tx_submit. Fix this.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
[corrected change log to DMA engine API insteadof DMA API]
Signed-off-by: Vinod Koul <vinod.koul@linux.intel.com>
drivers/dma/imx-sdma.c

index a8af379680c16776e19ae3018a9991243a3a8255..e58dbf638cc9463367870bd98095c0f5df48eb24 100644 (file)
@@ -838,15 +838,12 @@ static dma_cookie_t sdma_tx_submit(struct dma_async_tx_descriptor *tx)
 {
        unsigned long flags;
        struct sdma_channel *sdmac = to_sdma_chan(tx->chan);
-       struct sdma_engine *sdma = sdmac->sdma;
        dma_cookie_t cookie;
 
        spin_lock_irqsave(&sdmac->lock, flags);
 
        cookie = sdma_assign_cookie(sdmac);
 
-       sdma_enable_channel(sdma, sdmac->channel);
-
        spin_unlock_irqrestore(&sdmac->lock, flags);
 
        return cookie;
@@ -1135,9 +1132,11 @@ static enum dma_status sdma_tx_status(struct dma_chan *chan,
 
 static void sdma_issue_pending(struct dma_chan *chan)
 {
-       /*
-        * Nothing to do. We only have a single descriptor
-        */
+       struct sdma_channel *sdmac = to_sdma_chan(chan);
+       struct sdma_engine *sdma = sdmac->sdma;
+
+       if (sdmac->status == DMA_IN_PROGRESS)
+               sdma_enable_channel(sdma, sdmac->channel);
 }
 
 #define SDMA_SCRIPT_ADDRS_ARRAY_SIZE_V1        34