Subject: Re: driver replacements for kmalloc and __pa()

From: Jeff Brower <[email-masked]>
Date: Wed, 10 Sep 2008 19:44:59 -0500

Scott-

> > 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.

-Jeff