From: s.hauer@pengutronix.de (Sascha Hauer)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 5/6] dmaengine: imx-sdma: fix up param for the last BD in sdma_prep_slave_sg()
Date: Thu, 20 Jan 2011 11:28:08 +0100 [thread overview]
Message-ID: <20110120102808.GX9041@pengutronix.de> (raw)
In-Reply-To: <1295473840-17295-6-git-send-email-shawn.guo@freescale.com>
On Thu, Jan 20, 2011 at 05:50:39AM +0800, Shawn Guo wrote:
> 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.
Did you test this patch?
Sascha
>
> Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
> ---
> drivers/dma/imx-sdma.c | 5 ++++-
> 1 files changed, 4 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/dma/imx-sdma.c b/drivers/dma/imx-sdma.c
> index e5af547..fa63ace 100644
> --- a/drivers/dma/imx-sdma.c
> +++ b/drivers/dma/imx-sdma.c
> @@ -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,
> --
> 1.7.1
>
>
>
--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
next prev parent reply other threads:[~2011-01-20 10:28 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-01-19 21:50 [PATCH 0/6] A few fixes on imx-sdma Shawn Guo
2011-01-19 21:50 ` [PATCH 1/6] dmaengine: imx-sdma: remove IMX_DMA_SG_LOOP handling in sdma_prep_slave_sg() Shawn Guo
2011-01-19 21:50 ` [PATCH 2/6] dmaengine: imx-sdma: set sdmac->status to DMA_ERROR in err_out of sdma_prep_slave_sg() Shawn Guo
2011-01-19 21:50 ` [PATCH 3/6] dmaengine: imx-sdma: return sdmac->status in sdma_tx_status() Shawn Guo
2011-01-19 21:50 ` [PATCH 4/6] dmaengine: imxs-sdma: correct sdmac->status in sdma_handle_channel_loop() Shawn Guo
2011-01-19 21:50 ` [PATCH 5/6] dmaengine: imx-sdma: fix up param for the last BD in sdma_prep_slave_sg() Shawn Guo
2011-01-20 10:28 ` Sascha Hauer [this message]
2011-01-21 15:15 ` Shawn Guo
2011-01-21 10:24 ` Sascha Hauer
2011-01-21 14:45 ` Shawn Guo
2011-01-19 21:50 ` [PATCH 6/6] dmaengine: imx-sdma: avoid stopping channel in the middle of a BD transfer Shawn Guo
2011-01-20 10:43 ` Shawn Guo
2011-01-20 10:27 ` Sascha Hauer
2011-01-21 15:55 ` Shawn Guo
2011-01-21 9:45 ` Sascha Hauer
2011-01-21 14:53 ` Shawn Guo
2011-01-20 8:56 ` [PATCH 0/6] A few fixes on imx-sdma Shawn Guo
2011-01-31 12:03 ` Sascha Hauer
2011-02-14 10:26 ` Dan Williams
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20110120102808.GX9041@pengutronix.de \
--to=s.hauer@pengutronix.de \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).