Re: [PATCH 2/2] dma: Add IOMMU static calls with clear default ops

From: Christoph Hellwig
Date: Sat Jul 13 2024 - 01:18:32 EST


On Fri, Jul 12, 2024 at 03:21:55PM +0100, Robin Murphy wrote:
>> This is done to keep layering similar to existing in DMA subsystem. We
>> have special files and calls to dma-direct, it looks natural to have
>> special files and call to dma-iommu. It is not nice to call to drivers/iommu
>> from kernel/dma/mapping.c
>
> That's where I firmly disagree. In the DMA API aspect, iommu-dma is exactly
> a peer of dma-direct,

Exactly.

> however it lives in drivers/iommu for practical
> reasons because it's more closely coupled to IOMMU API internals in all
> other aspects of its implementation.

TBH I think kernel/dma/ would be the better place. But that's really the
least my concernes at the moment.

But the important point is that I would really prefer to avoid another
magic layer - just do direct calls like for dma-direct to keep it
understandable (and probably faster).