Re: [PATCH v3 2/2] dma/imx-sdma: use writel to write register whenenable a channel

From: Shawn Guo
Date: Thu Jan 05 2012 - 04:13:10 EST


On Thu, Jan 05, 2012 at 03:59:22PM +0800, Richard Zhao wrote:
> dma_alloc_coherent memory may be bufferable when set
> CONFIG_ARM_DMA_MEM_BUFFERABLE. We need to add nececcary
> memory barrier. writel implicitly call wmb in such case.
>
> Signed-off-by: Richard Zhao <richard.zhao@xxxxxxxxxx>
> ---
> drivers/dma/imx-sdma.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/dma/imx-sdma.c b/drivers/dma/imx-sdma.c
> index c2bc4f1..e987468 100644
> --- a/drivers/dma/imx-sdma.c
> +++ b/drivers/dma/imx-sdma.c
> @@ -396,7 +396,7 @@ static int sdma_config_ownership(struct sdma_channel *sdmac,
>
> static void sdma_enable_channel(struct sdma_engine *sdma, int channel)
> {
> - __raw_writel(1 << channel, sdma->regs + SDMA_H_START);
> + writel(1 << channel, sdma->regs + SDMA_H_START);
> }
>

As educated by Arnd, generally it's safer to use pair of readl/writel
than __raw_readl/__raw_writel in driver. I'm wondering if it's a good
opportunity for us to change the pair all over this driver.

--
Regards,
Shawn
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/