On 2022-05-06 14:54, Jason Gunthorpe wrote:
On Fri, May 06, 2022 at 02:35:50PM +0100, Robin Murphy wrote:

So you want to say "DMA is always managed" when attaching a domain of
type IOMMU_DOMAIN_UNMANAGED? :)

Touché ;) Just goes to confirm the point above that confusion between
general concepts and specific API terms is all too easy. An "unmanaged"
domain from the PoV of the API just means it's managed by the external
caller, but you're right that that's not necessarily so obvious either.

Yeah, I'm not so keen on the naming used for IOMMU_DOMAIN_*

I looked for a bit and could not figure out why we need to have
IOMMU_DOMAIN_DMA either.. I didn't find anthing obvious in the iommu
drivers that looked like a special case for this? Most drivers treat
it identically to UNMANAGED in their alloc functions

Only mtk, arm-smmu and some odd stuff in Intel seemed to be sensitive?

Yes, that's a relatively recent change[1] - prior to that, drivers did still have to take (minimal) action to opt into iommu-dma support. IOMMU_DOMAIN_DMA still needs to exist as a type for the core code to differentiate internally, so driver involvement is mostly now just a case of saying "yeah OK fine" if they see it. IOMMU_DOMAIN_DMA_FQ now effectively takes over the original semantics of IOMMU_DOMAIN_DMA as the one that depends on driver-specific functionality.

FWIW, mtk-iommu doesn't really have any need to reject IOMMU_DOMAIN_UNMANAGED, they just don't have any relevant client drivers that want it; however arm-smmu definitely does need to continue rejecting IOMMU_DOMAIN_DMA when it can't rely on the DT code ensuring the correct probe ordering with the old DT binding (otherwise client drivers are liable to get broken DMA ops).

Thanks,
Robin.

[1] https://lore.kernel.org/linux-iommu/cover.1628682048.git.robin.mur...@arm.com/
_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

Reply via email to