Problems with dma_alloc_coherent()

Michael R. Zucca mrz5149 at acm.org
Sat Apr 3 04:50:04 EST 2004


John Whitney wrote:
>
> As an exemplification of the problem I am having with the current
> DMA/PCI API:
>
> I am developing a Generic DMA driver.  DMA providers register
> themselves with it.  Clients ask the DMA core driver to please have a
> registered driver transfer the data from one location to another, and
> call them back when it is complete.

If CPU memory is assumed to be a source/target and the other
source/target is the device, then you should take a DMA direction, a
virtual address, a device or bus, and a bus-local address. If CPU memory
isn't the only target or the DMA engine is between a bunch of bridges,
you might need to take a source bus and bus-local address, and a
destination bus and bus-local address.

If you have the bus and the bus-local address you should be able to
deduce what bridges you have to program/translate-through to do the
transfer with the DMA engine. Once you know that you should be able to
translate a bus-local address to whatever address is appropriate for the
DMA engine and program any intervening bridges appropriately.

Does Linux currently have the smarts to do this? Beats me, but it should
if it's ever going to hope to deal with the crazy array of busses and
bridges coming out of the minds of hardware engineers these days. :-)

--
----------------------------------------------
  Michael Zucca - mrz5149 at acm.org
----------------------------------------------
  "I'm too old to use Emacs." -- Rod MacDonald
----------------------------------------------


** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/





More information about the Linuxppc-dev mailing list