lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20120103174639.GF2914@n2100.arm.linux.org.uk>
Date:	Tue, 3 Jan 2012 17:46:39 +0000
From:	Russell King - ARM Linux <linux@....linux.org.uk>
To:	Richard Zhao <richard.zhao@...aro.org>
Cc:	linux-kernel@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
	patches@...aro.org, vinod.koul@...el.com, eric.miao@...aro.org,
	kernel@...gutronix.de, dan.j.williams@...el.com,
	shawn.guo@...aro.org
Subject: Re: [PATCH v2 2/2] dma/imx-sdma: add wmb before enable a channel

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@...aro.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); })
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ