driver replacements for kmalloc and __pa()

Jeff Brower jbrower at
Thu Sep 11 10:44:59 EST 2008


> > What are the up-to-date APIs we should be using for DMA memory allocation and
> > virtual-to-physical address translation?  We have another driver for another device
> > that's working fine on this board and it uses pci_alloc_consistent().  What about
> > bus_space_vaddr()?  I'm hoping to get a recommendation for what's currently
> > appropriate and most future-proof for drivers that depend on external PCI DMA.
> Documentation/DMA-API.txt.

Thanks very much Scott.  It appears that dma_alloc_coherent() is the recommended
path.  Is there a good reason to use this instead of pci_alloc_consistent()?  I can
find comments about using the GFP_KERNEL flag with dma_alloc_coherent(), which is
supposed to help when the system is low on memory.  But we wouldn't expect that to
occur in a situation where the driver is loaded/initialized at boot-time.


More information about the Linuxppc-embedded mailing list