# \[PATCH 1/8\] ARM: OMAP: fix DMA vs memory ordering

- From: Shilimkar, Santosh \<hidden\>
- Date: 2012-04-23 14:35:23 
- List: linux-arm-kernel
- Page: https://ratatoskr.run/linux-arm-kernel/2012/04/8603672
- Thread: https://ratatoskr.run/linux-arm-kernel/2012/04/8603059/t.md

```text
On Mon, Apr 23, 2012 at 7:57 PM, Tony Lindgren [ref] wrote:
> * Russell King - ARM Linux [ref] [120423 07:22]:
>> On Fri, Apr 20, 2012 at 03:22:33PM -0700, Tony Lindgren wrote:
>> > * Russell King [ref] [120418 03:14]:
>> > > Using coherent DMA memory with the OMAP DMA engine results in
>> > > unpredictable behaviour due to memory ordering issues; as things stand,
>> > > there is no guarantee that data written to coherent DMA memory will be
>> > > visible to the DMA hardware.
>> > >
>> > > This is because the OMAP dma_write() accessor contains no barriers,
>> > > necessary on ARMv6 and above. ?The effect of this can be seen in comments
>> > > in the OMAP serial driver, which incorrectly talks about cache flushing
>> > > for the coherent DMA stuff.
>> > >
>> > > Rather than adding barriers to the accessors, add it in the DMA support
>> > > code just before we enable DMA, and just after we disable DMA. ?This
>> > > avoids having barriers for every DMA register access.
>> > >
>> > > Signed-off-by: Russell King <redacted>
>> >
>> > Acked-by: Tony Lindgren <tony@atomide.com>
>>
>> Would you like me to push this upstream on my next -rc push (with a
>> stable tag?)
>
> Yes sounds good to me.
>
FWIW,
Acked-by: Santosh Shilimkar <redacted>
```
