Richard Zhao | 1 Jan 2012 04:27
Favicon

[PATCH] dma/imx-sdma: add wmb before enable/run a channel

dma_alloc_coherent memory may be bufferable. We need to add
nececcary memory barrier.

Signed-off-by: Richard Zhao <richard.zhao <at> 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
 <at>  <at>  -403,6 +403,7  <at>  <at>  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);
 <at>  <at>  -809,6 +810,7  <at>  <at>  out:

 static void sdma_enable_channel(struct sdma_engine *sdma, int channel)
 {
+	wmb();
 	__raw_writel(1 << channel, sdma->regs + SDMA_H_START);
 }

--

-- 
1.7.4.1
(Continue reading)

Uwe Kleine-König | 1 Jan 2012 08:14
Picon
Favicon
Gravatar

Re: [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 <at> 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
>  <at>  <at>  -403,6 +403,7  <at>  <at>  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);
>  <at>  <at>  -809,6 +810,7  <at>  <at>  out:
>  
>  static void sdma_enable_channel(struct sdma_engine *sdma, int channel)
>  {
> +	wmb();
(Continue reading)

Richard Zhao | 1 Jan 2012 14:29
Favicon

Re: [PATCH] dma/imx-sdma: add wmb before enable/run a channel

On Sun, Jan 01, 2012 at 08:14:25AM +0100, Uwe Kleine-König wrote:
> 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 <at> 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
> >  <at>  <at>  -403,6 +403,7  <at>  <at>  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);
> >  <at>  <at>  -809,6 +810,7  <at>  <at>  out:
> >  
> >  static void sdma_enable_channel(struct sdma_engine *sdma, int channel)
> >  {
(Continue reading)


Gmane