Skip to contentSkip to conversation

generic device DMA implementation

RFC Adam J. Richter 1 participant 1 message Dec 6, 2002

lore
Share & tools
lore
#0 lore raw
Quoted 3 lines · James Bottomley

how about dma_alloc to take two flags

DRIVER_SUPPORTS_CONSISTENT_ONLY

It's pretty much impossible not to support consistent memory.

I'd suggest a shorter name for code readability and particularly
to hint that this is the standard usage. I'd suggest DMA_CONSISTENT or "0".

Quoted 3 lines

and

DRIVER_SUPPORTS_NON_CONSISTENT

There is a pretty strong convention for medium to short names
in the kernel, although this name will be used much less, so its length is not as important. I'd like something that would match the names of the corresponding cache flushing and invalidation functions. I think I had previously suggested DMA_MAYBE_CONSISTENT and wmb_maybe or dma_sync_maybe but I'm not that attached to the "maybe" word.

[...]

Quoted 2 lines

and dma_alloc_consistent to be equivalent to dma_alloc with DRIVER_SUPPORTS_CONSISTENT_ONLY (and hence equivalent to pci_alloc_consistent)

Why have a separate dma_alloc_consistent function?

Adam J. Richter     __     ______________   575 Oroville Road
[email protected]     \ /                  Milpitas, California 95035
+1 408 309-6081         | g g d r a s i l   United States of America

"Free Software For The Rest Of Us."