Re: [PATCH 01/11] ia64: introduce arch-specific dma-mappinginterfaces

From: Ian Campbell
Date: Tue Jun 02 2009 - 05:18:36 EST


On Tue, 2009-06-02 at 00:08 -0400, FUJITA Tomonori wrote:
> dma_map_range is a really confusing name. We have dma_map_single and
> dma_map_sg, they are the DMA mapping API.
> dma_map_range sounds like the DMA mapping API but it isn't.

Yes, it's not such a good name. I wonder what would be better?

Perhaps dma_range_mapped? The return value indicates whether the range
is mapped or not so this makes some sense. It also makes it clearer that
this function is not intended to actually perform the mapping if it does
not exist.

> As I said,
> Xen dom0 needs to implement something like xen_map_sg, xen_map_single,
> etc, which uses some of swiotlb functions internally. Then we don't
> need functions like the above.

xen_map_sg would be literally identical to swiotlb_map_sg in every way
apart from the additional phys<->dma address translations. Similarly for
the other swiotlb interfaces. The phys<->dma address translation is also
required for the PowerPC architecture so duplicating all that code just
for Xen doesn't really solve the problem.

Ian.

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