Re: DMA API issues

From: James Bottomley
Date: Fri Jun 18 2004 - 18:23:20 EST


On Fri, 2004-06-18 at 17:38, David Brownell wrote:
> James Bottomley wrote:
> > The statement was "That's dma_alloc_coherent at its core ... it should
> > allocate from that 32K region." and what I was pointing out is that not
> > all platforms can treat an on-chip memory region as a real memory area.
>
> But this one can, and it sure seems like the appropriate
> solution. For reasons like the one not quoted above: it's
> a good way to eliminate what would otherwise be a case
> where a dmabounce is needed. And hey wow, it even uses
> the API designed to reduce such DMA "mapping" costs, and
> there are drivers already using it for such purposes.

Well, yes, but the problem: chips have onboard memory is generic. The
proposed solution in the DMA API can't only work on certain platforms.

>
> > That's why we have the iomem accessor functions.
>
> You mentioned ioremap(), which doesn't help here since
> the need is for a block of memory, not just address space,
> and also memcpy_toio(), which just another tool to implement
> the dma bouncing (which is on the "strongly avoid!" list).
>
> As I said, those still don't make dma_alloc_coherent() work.

Right, that's rather the point. The memory you get by doing an ioremap
on this chip area may have to be treated differently from real memory on
some platforms.

That's the fundamental problem of trying to treat it as memory obtained
from dma_alloc_coherent().

James


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/