lkml.org 
[lkml]   [2002]   [Dec]   [5]   [last100]   RSS-feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
Complete thread (EXPERIMENTAL)
/
SubjectRe: [RFC] generic device DMA implementation
FromBenjamin Herrenschmidt <>
Date05 Dec 2002 12:08:16 +0100
Digg This
On Thu, 2002-12-05 at 01:47, David Gibson wrote:
Do you have an example of where the second option is useful? Off hand the only places I can think of where you'd use a consistent_alloc() rather than map_single() and friends is in cases where the hardware's behaviour means you absolutely positively have to have consistent memory.

Looking at our implementation (ppc32 on non-coherent CPUs like 405) of pci_map_single, which just flushes the cache, I still feel we need a consistent_alloc, that is an implementation that _disables_ caching for the area.

A typical example is an USB OHCI driver. You really don't want to play cache tricks with the shared area here. That will happen each time you have a shared area in memory in which both the CPU and the device may read/write in the same cache line.

For things like ring descriptors of a net driver, I feel it's very much simpler (and possibly more efficient too) to also allocate non-cacheable space for consistent instead of continuously flushing/invalidating. Actually, flush/invalidate here can also have nasty side effects if several descriptors fit in the same cache line.

The data buffers, of course (skbuffs typically) would preferably use pci_map_* like APIs (hrm... did we ever make sure skbuffs would _not_ mix the data buffer with control datas in the same cache line ? This have been a problem with non-coherent CPUs in the past).
Ben.

\
ISP Services
Valid XHTML 1.0!\ /
Valid CSS! Last update: 2005-03-22 12:31    [W:1.497 / U:0.250 seconds]
©2003-2005 Jasper Spaans