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

From: Leon Romanovsky
Date: Fri Jul 12 2024 - 02:03:07 EST


On Fri, Jul 12, 2024 at 06:49:37AM +0200, Christoph Hellwig wrote:
> On Thu, Jul 11, 2024 at 07:23:20PM +0100, Robin Murphy wrote:
> > If so, I'd much rather see this done properly, i.e. hook everything up
> > similarly to dma-direct and be able to drop CONFIG_DMA_OPS for "modern"
> > dma-direct/iommu-dma architectures entirely.
>
> Yes. That is much better than doing hacks based on missing ops.

There is nothing wrong to do conversion to iommu direct in the steps.
The first step is to add the dma-iommu calls with if (!..) checks,
so everyone will get better performance right now. The second step
is to remove the if (!..) checks together with dummy ops.

Thanks

>
> Note that the media subsystems just added another abuse of dma_map_ops
> in drivers/ in addition to the existing vdpa one that we'll need to
> kill again to fully get rid of dma_map_ops for common setups (in
> addition to merging swiotlb-xen into main swiotlb finally).
>