mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Richard Zhao <richard.zhao@freescale.com>
To: <s.hauer@pengutronix.de>,
	Russell King - ARM Linux <linux@arm.linux.org.uk>
Cc: <patches@linaro.org>, <vinod.koul@intel.com>,
	<linux-kernel@vger.kernel.org>, <eric.miao@linaro.org>,
	<kernel@pengutronix.de>, <dan.j.williams@intel.com>,
	<shawn.guo@linaro.org>, Richard Zhao <richard.zhao@linaro.org>,
	<linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH v2 2/2] dma/imx-sdma: add wmb before enable a channel
Date: Thu, 5 Jan 2012 09:56:10 +0800	[thread overview]
Message-ID: <20120105015609.GN2414@b20223-02.ap.freescale.net> (raw)
In-Reply-To: <20120104023157.GJ2414@b20223-02.ap.freescale.net>

Hi Sascha,

On Wed, Jan 04, 2012 at 10:31:58AM +0800, Richard Zhao wrote:
> On Tue, Jan 03, 2012 at 05:46:39PM +0000, Russell King - ARM Linux wrote:
> > On Sun, Jan 01, 2012 at 10:38:12PM +0800, Richard Zhao wrote:
> > > dma_alloc_coherent memory may be bufferable. We need to add
> > > nececcary memory barrier.
> > > 
> > > Signed-off-by: Richard Zhao <richard.zhao@linaro.org>
> > > ---
> > >  drivers/dma/imx-sdma.c |    1 +
> > >  1 files changed, 1 insertions(+), 0 deletions(-)
> > > 
> > > diff --git a/drivers/dma/imx-sdma.c b/drivers/dma/imx-sdma.c
> > > index f8e87b5..9301bff 100644
> > > --- a/drivers/dma/imx-sdma.c
> > > +++ b/drivers/dma/imx-sdma.c
> > > @@ -394,6 +394,7 @@ static int sdma_config_ownership(struct sdma_channel *sdmac,
> > >  
> > >  static void sdma_enable_channel(struct sdma_engine *sdma, int channel)
> > >  {
> > > +	wmb();
> > >  	__raw_writel(1 << channel, sdma->regs + SDMA_H_START);
> > 
> > Use writel().  That's what it's there for:
> > 
> > #ifdef CONFIG_ARM_DMA_MEM_BUFFERABLE
> > #define __iowmb()               wmb()
> > #endif
> > #define writel_relaxed(v,c)     ((void)__raw_writel((__force u32) \
> >                                         cpu_to_le32(v),__mem_pci(c)))
> > #define writel(v,c)             ({ __iowmb(); writel_relaxed(v,c); })
> Why does writel always call wmb? ioremap memory needs mb too?
> Isn't it supposed to be when there's prior touch of dma memory? 
What do you think?

Thanks
Richard
> 
> Thanks
> Richard
> > 
> > _______________________________________________
> > linux-arm-kernel mailing list
> > linux-arm-kernel@lists.infradead.org
> > http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
> > 
> 
> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
> 


      reply	other threads:[~2012-01-05  1:56 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-01 14:38 [PATCH v2 0/2] imx-sdma: memory barrier fix Richard Zhao
2012-01-01 14:38 ` [PATCH v2 1/2] dma/imx-sdma: let sdma_run_channel call sdma_enable_channel Richard Zhao
2012-01-01 14:38 ` [PATCH v2 2/2] dma/imx-sdma: add wmb before enable a channel Richard Zhao
2012-01-03 17:46   ` Russell King - ARM Linux
2012-01-04  2:31     ` Richard Zhao
2012-01-05  1:56       ` Richard Zhao [this message]

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=20120105015609.GN2414@b20223-02.ap.freescale.net \
    --to=richard.zhao@freescale.com \
    --cc=dan.j.williams@intel.com \
    --cc=eric.miao@linaro.org \
    --cc=kernel@pengutronix.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=patches@linaro.org \
    --cc=richard.zhao@linaro.org \
    --cc=s.hauer@pengutronix.de \
    --cc=shawn.guo@linaro.org \
    --cc=vinod.koul@intel.com \
    /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

all inboxes | Powered by JetHome®