Re: [PATCH v7 2/5] iommu: Tidy domain for iommu_setup_dma_ops()

From: Jason Gunthorpe

Date: Tue Nov 25 2025 - 14:23:24 EST


On Fri, Nov 21, 2025 at 05:57:29PM -0800, Nicolin Chen wrote:
> This function can only be called on the default_domain. Trivally pass it
> in. In all three existing cases, the default domain was just attached to
> the device.
>
> This avoids iommu_setup_dma_ops() calling iommu_get_domain_for_dev() that
> will be used by external callers.
>
> Suggested-by: Jason Gunthorpe <jgg@xxxxxxxxxx>
> Reviewed-by: Kevin Tian <kevin.tian@xxxxxxxxx>
> Reviewed-by: Lu Baolu <baolu.lu@xxxxxxxxxxxxxxx>
> Signed-off-by: Nicolin Chen <nicolinc@xxxxxxxxxx>
> ---
> drivers/iommu/dma-iommu.h | 5 +++--
> drivers/iommu/dma-iommu.c | 4 +---
> drivers/iommu/iommu.c | 6 +++---
> 3 files changed, 7 insertions(+), 8 deletions(-)

Reviewed-by: Jason Gunthorpe <jgg@xxxxxxxxxx>

Jason