From: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
To: Richard Zhao <richard.zhao@linaro.org>
Cc: linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de,
shawn.guo@linaro.org, vinod.koul@intel.com,
dan.j.williams@intel.com, eric.miao@linaro.org,
patches@linaro.org
Subject: Re: [PATCH] dma/imx-sdma: add wmb before enable/run a channel
Date: Sun, 1 Jan 2012 08:14:25 +0100 [thread overview]
Message-ID: <20120101071425.GA25978@pengutronix.de> (raw)
In-Reply-To: <1325388460-20678-1-git-send-email-richard.zhao@linaro.org>
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/ |
next prev parent reply other threads:[~2012-01-01 7:14 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-01 3:27 [PATCH] dma/imx-sdma: add wmb before enable/run a channel Richard Zhao
2012-01-01 7:14 ` Uwe Kleine-König [this message]
2012-01-01 13:29 ` Richard Zhao
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=20120101071425.GA25978@pengutronix.de \
--to=u.kleine-koenig@pengutronix.de \
--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=patches@linaro.org \
--cc=richard.zhao@linaro.org \
--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