lkml.org 
[lkml]   [2007]   [Dec]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [RFC] dma: passing "attributes" to dma_map_* routines
From
Date

On Tue, 2007-12-18 at 12:07 -0800, akepner@sgi.com wrote:
> On Tue, Dec 18, 2007 at 05:50:42PM +0100, Stefan Richter wrote:
>
> > Do I understand correctly?: A device and the CPUs communicate via two
> > separate memory areas: A data buffer and a status FIFO. The NUMA
> > interconnect may reorder accesses of the device to the areas. (Write
> > accesses? Read accesses? Both?)
>
> Yes, I think you understand. Reorderings are possible on reads and
> writes. Things get synced up by either an interrupt or a write to
> a memory region with a "barrier attribute". Memory allocated with
> dma_alloc_coherent() gets the barrier attribute. The idea here is
> to allow memory allocated with plain old malloc() or whatever to
> get the same attribute.
>
> >
> > To ensure synchronization between device and CPUs, you want to mark a
> > memory area which is to be dma-mapped with a flag which says: "Writes
> > to the memory region will cause in-flight DMA to be flushed". Whose
> > writes? A write access from the device or a write access from a CPU?
>
> A write from the device, e.g., when the device writes to indicate
> "data DMA is complete".

Can't you just have a primitive to sync things up that you call
explicitely from your driver after fetching a new status entry ?

Ben.




\
 
 \ /
  Last update: 2007-12-20 22:01    [W:0.105 / U:0.628 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site