[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1198184185.6779.16.camel@pasglop>
Date: Fri, 21 Dec 2007 07:56:25 +1100
From: Benjamin Herrenschmidt <benh@...nel.crashing.org>
To: akepner@....com
Cc: Stefan Richter <stefanr@...6.in-berlin.de>,
Andrew Morton <akpm@...ux-foundation.org>,
grundler@...isc-linux.org, jbarnes@...tuousgeek.org, jes@....com,
randy.dunlap@...cle.com, rdreier@...co.com,
James.Bottomley@...eleye.com, davem@...emloft.net,
linux-kernel@...r.kernel.org
Subject: Re: [RFC] dma: passing "attributes" to dma_map_* routines
On Tue, 2007-12-18 at 12:07 -0800, akepner@....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.
--
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