lkml.org 
[lkml]   [2006]   [Jul]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: memory barriers and dma_sync_single_for_*
From
Date
Ar Sul, 2006-07-09 am 16:53 +0200, ysgrifennodd Stefan Richter:
> My question: Do I need wmb() within the following code?
>
> dma_sync_single_for_cpu(..., DMA_TO_DEVICE);
> area->a = new_val_a;
> wmb(); /* necessary? */
> area->b = new_val_b;

Yes. Otherwise on some processors the I/O may be re-ordered

> dma_sync_single_for_device(..., DMA_TO_DEVICE);
>
> Or are all changes to the area hidden from the device between
> dma_sync_single_for_cpu and _for_device, thereby making the write order
> a non-issue? Thanks,

Depends on the processor and setup. On x86-32 for example dma_sync_.. is
generally a NOP. In other environments nothing will be visible until the
sync.

Alan

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

\
 
 \ /
  Last update: 2006-07-09 17:31    [W:0.043 / U:0.112 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site