Skip to content

Commit

Permalink
dmaengine: imx-sdma: fix up param for the last BD in sdma_prep_slave_…
Browse files Browse the repository at this point in the history
…sg()

As per the reference manual, bit "L" should be set while bit "C"
should be cleared for the last buffer descriptor in the non-cyclic
chain, so that sdma can stop trying to find the next BD and end
the transfer.

In case of sdma_prep_slave_sg(), BD_LAST needs to be set and BD_CONT
be cleared for the last BD.

Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
  • Loading branch information
Shawn Guo authored and Sascha Hauer committed Jan 31, 2011
1 parent 1e9cebb commit 341b941
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion drivers/dma/imx-sdma.c
Original file line number Diff line number Diff line change
Expand Up @@ -931,8 +931,11 @@ static struct dma_async_tx_descriptor *sdma_prep_slave_sg(

param = BD_DONE | BD_EXTD | BD_CONT;

if (i + 1 == sg_len)
if (i + 1 == sg_len) {
param |= BD_INTR;
param |= BD_LAST;
param &= ~BD_CONT;
}

dev_dbg(sdma->dev, "entry %d: count: %d dma: 0x%08x %s%s\n",
i, count, sg->dma_address,
Expand Down

0 comments on commit 341b941

Please sign in to comment.