lkml.org 
[lkml]   [2012]   [Jan]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] dma/imx-sdma: add wmb before enable/run a channel
Hello Richard,

On Sun, Jan 01, 2012 at 11:27:40AM +0800, Richard Zhao wrote:
> dma_alloc_coherent memory may be bufferable. We need to add
> nececcary memory barrier.
necessary

>
> Signed-off-by: Richard Zhao <richard.zhao@linaro.org>
> ---
> drivers/dma/imx-sdma.c | 2 ++
> 1 files changed, 2 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/dma/imx-sdma.c b/drivers/dma/imx-sdma.c
> index 2ebb2bc..8cd9492 100644
> --- a/drivers/dma/imx-sdma.c
> +++ b/drivers/dma/imx-sdma.c
> @@ -403,6 +403,7 @@ static int sdma_run_channel(struct sdma_channel *sdmac)
>
> init_completion(&sdmac->done);
>
> + wmb();
> __raw_writel(1 << channel, sdma->regs + SDMA_H_START);
>
> ret = wait_for_completion_timeout(&sdmac->done, HZ);
> @@ -809,6 +810,7 @@ out:
>
> static void sdma_enable_channel(struct sdma_engine *sdma, int channel)
> {
> + wmb();
> __raw_writel(1 << channel, sdma->regs + SDMA_H_START);
> }
I don't know the sdma code very well, but wouldn't it be nice to call
sdma_enable_channel() in sdma_run_channel() instead of open coding it?

As you probably need some rearrangements to have sdma_enable_channel()
declared in sdma_run_channel() this might be better done with a seperate
patch.

Best regards
Uwe

--
Pengutronix e.K. | Uwe Kleine-König |
Industrial Linux Solutions | http://www.pengutronix.de/ |
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2012-01-01 08:17    [W:0.031 / U:0.508 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site