[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1226099192.13603.78.camel@pasglop>
Date: Sat, 08 Nov 2008 10:06:32 +1100
From: Benjamin Herrenschmidt <benh@...nel.crashing.org>
To: Vijay Kumar <vijaykumar@...vegnu.org>
Cc: "J.R. Mauro" <jrm8005@...il.com>,
Christoph Hellwig <hch@...radead.org>,
Paul Mackerras <paulus@...ba.org>, Greg KH <greg@...ah.com>,
Stephen Rothwell <sfr@...b.auug.org.au>,
LKML <linux-kernel@...r.kernel.org>,
"David S. Miller" <davem@...emloft.net>,
"William L. Irwin" <wli@...omorphy.com>, jayakumar.lkml@...il.com,
sparclinux@...r.kernel.org
Subject: Re: sparc/staging compile error
> May be the code is not doing what is supposed to do, but here is what the
> driver is trying to achieve:
>
> The driver allocates a set of buffers for DMA. These buffers are mapped
> into user space, when the user does an mmap. In transmit, when the user
> space writes to these buffers, the data has to reach physical memory so
> that the device can access them. For receive, the cache has to be
> invalidated before the user space reads the buffer.
>
> Do let me know if further clarification is required. Any inputs and
> suggestions are welcome.
Well, this is the wrong API to do that. First, some platforms are cache
coherent and thus don't need anything there other than maybe a barrier.
Then, the dma_* API is what you want to ensure cache coherency with DMA
transfers within the kernel.
If userspace can directly trigger DMA from pre-allocated buffers, then
doing an ioctl to sync is a major wastage, since most platforms are
cache coherent (and thus don't need it) and those who are not generally
provide user-space accessible ways of doing the flush to some extent
(not all, for example, BookE PPC cannot invalidate the data cache from
userspace, only flush it).
In any case, we would need to understand better your driver userspace
API and transfer model to find the right solution.
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