Problems with dma_alloc_coherent()

Eugene Surovegin ebs at
Fri Apr 2 04:40:04 EST 2004

On Thu, Apr 01, 2004 at 01:33:42PM -0500, John Whitney wrote:
> Yes, but both pci_alloc_consistent() and dma_alloc_coherent() return
> physical addresses made with virt_to_bus() (at least they do in the
> PowerPC tree).  This routine specifically adds the PCI-bus view of the
> address space to the physical address produced.  I don't understand why
> two different APIs are needed, if they both do the same thing.

They do the same thing _now_, because it's a _new_ API. This _may_ change in

DMA API is needed, because generic code uses it, most archs have default generic
implementation which use PCI DMA API and I don't see _any_ problems with that.

Some archs may have _different_ implementations which DON'T use PCI DMA API.

> This means that the address produced by pci_alloc_... and dma_alloc_...
> are incorrect for a device like a direct memory-mapped encryption chip,
> or in my case a northbridge DMA controller.

It depends, on all systems I use PCI view == phys address, so it'll work.


** Sent via the linuxppc-dev mail list. See

More information about the Linuxppc-dev mailing list