From nobody Tue Apr 7 14:51:55 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8A9C7ECAAD4 for ; Fri, 26 Aug 2022 12:35:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344201AbiHZMfy (ORCPT ); Fri, 26 Aug 2022 08:35:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55178 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343947AbiHZMfu (ORCPT ); Fri, 26 Aug 2022 08:35:50 -0400 Received: from mga06.intel.com (mga06b.intel.com [134.134.136.31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C187A26AF8 for ; Fri, 26 Aug 2022 05:35:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1661517348; x=1693053348; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=WPpvL0WZJ2bHkHFsnDmPoQ6gWN/LGjpQ7H+MLfE3d9Q=; b=TM3e7bL5iv8csySdCMfS15WcuaPNzxTSFeXXCPeg+dX8qDxTzLs+2FA8 0nCJ1r6dZK+HQTmYslLC+erqK6FUU8ZcL9x9xuoyBx9xQYAQ/mhk8ScVC DLbdzxmZDAYqYHDbWEzmK5D5pqgEOPvUnLErC/1k8G7hTSh55jYB7DURQ elwhOWvse/99bxo9k7JWlC3RMYudFQRQUozqbSC/3E/Uc9FNm9GKme/zX 4NwkYpNiNiEiN7sj5CTRuO3pqGxONv52pD6hWsErJDSFq8Rz8NcB6+Z2g dFbAHSfh6fv54E3P8kDQGA7KqJcXl3Z69daVCv+Kck7SFxuMFScoth8iZ A==; X-IronPort-AV: E=McAfee;i="6500,9779,10450"; a="356210170" X-IronPort-AV: E=Sophos;i="5.93,265,1654585200"; d="scan'208,223";a="356210170" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Aug 2022 05:35:48 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.93,265,1654585200"; d="scan'208,223";a="606751947" Received: from allen-box.sh.intel.com ([10.239.159.48]) by orsmga007.jf.intel.com with ESMTP; 26 Aug 2022 05:35:44 -0700 From: Lu Baolu To: Joerg Roedel , Jason Gunthorpe , Christoph Hellwig , Kevin Tian , Ashok Raj , Will Deacon , Robin Murphy , Jean-Philippe Brucker Cc: Eric Auger , Liu Yi L , Jacob jun Pan , iommu@lists.linux.dev, linux-kernel@vger.kernel.org, Lu Baolu Subject: [PATCH v2 1/3] iommu: Replace detach_dev with real blocking domains Date: Fri, 26 Aug 2022 20:30:12 +0800 Message-Id: <20220826123014.52709-2-baolu.lu@linux.intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220826123014.52709-1-baolu.lu@linux.intel.com> References: <20220826123014.52709-1-baolu.lu@linux.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From iommu core's point of view, detaching a domain from a device is equal to attaching the group's blocking domain to the device. This repalces all detach_dev callbacks in the IOMMU drivers with a real blocking domain and handles detaching domain through it. Signed-off-by: Lu Baolu --- drivers/iommu/amd/iommu.c | 22 +++++++++++++++++++++- drivers/iommu/apple-dart.c | 24 +++++++++++++++++++++--- drivers/iommu/arm/arm-smmu/qcom_iommu.c | 23 ++++++++++++++++++++++- drivers/iommu/exynos-iommu.c | 23 ++++++++++++++++++++++- drivers/iommu/fsl_pamu_domain.c | 22 +++++++++++++++++++++- drivers/iommu/ipmmu-vmsa.c | 22 +++++++++++++++++++++- drivers/iommu/msm_iommu.c | 23 ++++++++++++++++++++++- drivers/iommu/mtk_iommu.c | 22 +++++++++++++++++++++- drivers/iommu/mtk_iommu_v1.c | 22 +++++++++++++++++++++- drivers/iommu/omap-iommu.c | 20 +++++++++++++++++++- drivers/iommu/rockchip-iommu.c | 20 +++++++++++++++++++- drivers/iommu/s390-iommu.c | 23 ++++++++++++++++++++++- drivers/iommu/sprd-iommu.c | 23 ++++++++++++++++++++++- drivers/iommu/sun50i-iommu.c | 23 ++++++++++++++++++++++- drivers/iommu/tegra-gart.c | 20 +++++++++++++++++++- drivers/iommu/tegra-smmu.c | 23 ++++++++++++++++++++++- 16 files changed, 337 insertions(+), 18 deletions(-) diff --git a/drivers/iommu/amd/iommu.c b/drivers/iommu/amd/iommu.c index 65b8e4fd8217..4cd0438b0a6e 100644 --- a/drivers/iommu/amd/iommu.c +++ b/drivers/iommu/amd/iommu.c @@ -85,6 +85,8 @@ struct iommu_cmd { struct kmem_cache *amd_iommu_irq_cache; =20 static void detach_device(struct device *dev); +static void amd_iommu_detach_device(struct iommu_domain *dom, + struct device *dev); =20 /*************************************************************************= *** * @@ -2064,10 +2066,29 @@ static struct protection_domain *protection_domain_= alloc(unsigned int type) return NULL; } =20 +static int blocking_domain_attach_dev(struct iommu_domain *_domain, + struct device *dev) +{ + struct iommu_domain *domain =3D iommu_get_domain_for_dev(dev); + + amd_iommu_detach_device(domain, dev); + + return 0; +} + +static struct iommu_domain blocking_domain =3D { + .ops =3D &(const struct iommu_domain_ops) { + .attach_dev =3D blocking_domain_attach_dev + } +}; + static struct iommu_domain *amd_iommu_domain_alloc(unsigned type) { struct protection_domain *domain; =20 + if (type =3D=3D IOMMU_DOMAIN_BLOCKED) + return &blocking_domain; + /* * Since DTE[Mode]=3D0 is prohibited on SNP-enabled system, * default to use IOMMU_DOMAIN_DMA[_FQ]. @@ -2398,7 +2419,6 @@ const struct iommu_ops amd_iommu_ops =3D { .def_domain_type =3D amd_iommu_def_domain_type, .default_domain_ops =3D &(const struct iommu_domain_ops) { .attach_dev =3D amd_iommu_attach_device, - .detach_dev =3D amd_iommu_detach_device, .map =3D amd_iommu_map, .unmap =3D amd_iommu_unmap, .iotlb_sync_map =3D amd_iommu_iotlb_sync_map, diff --git a/drivers/iommu/apple-dart.c b/drivers/iommu/apple-dart.c index 1b1725759262..5f46cbf04e07 100644 --- a/drivers/iommu/apple-dart.c +++ b/drivers/iommu/apple-dart.c @@ -568,12 +568,31 @@ static void apple_dart_release_device(struct device *= dev) kfree(cfg); } =20 +static int blocking_domain_attach_dev(struct iommu_domain *_domain, + struct device *dev) +{ + struct iommu_domain *domain =3D iommu_get_domain_for_dev(dev); + + apple_dart_detach_dev(domain, dev); + + return 0; +} + +static struct iommu_domain blocking_domain =3D { + .ops =3D &(const struct iommu_domain_ops) { + .attach_dev =3D blocking_domain_attach_dev + } +}; + static struct iommu_domain *apple_dart_domain_alloc(unsigned int type) { struct apple_dart_domain *dart_domain; =20 + if (type =3D=3D IOMMU_DOMAIN_BLOCKED) + return &blocking_domain; + if (type !=3D IOMMU_DOMAIN_DMA && type !=3D IOMMU_DOMAIN_UNMANAGED && - type !=3D IOMMU_DOMAIN_IDENTITY && type !=3D IOMMU_DOMAIN_BLOCKED) + type !=3D IOMMU_DOMAIN_IDENTITY) return NULL; =20 dart_domain =3D kzalloc(sizeof(*dart_domain), GFP_KERNEL); @@ -583,7 +602,7 @@ static struct iommu_domain *apple_dart_domain_alloc(uns= igned int type) mutex_init(&dart_domain->init_lock); =20 /* no need to allocate pgtbl_ops or do any other finalization steps */ - if (type =3D=3D IOMMU_DOMAIN_IDENTITY || type =3D=3D IOMMU_DOMAIN_BLOCKED) + if (type =3D=3D IOMMU_DOMAIN_IDENTITY) dart_domain->finalized =3D true; =20 return &dart_domain->domain; @@ -772,7 +791,6 @@ static const struct iommu_ops apple_dart_iommu_ops =3D { .owner =3D THIS_MODULE, .default_domain_ops =3D &(const struct iommu_domain_ops) { .attach_dev =3D apple_dart_attach_dev, - .detach_dev =3D apple_dart_detach_dev, .map_pages =3D apple_dart_map_pages, .unmap_pages =3D apple_dart_unmap_pages, .flush_iotlb_all =3D apple_dart_flush_iotlb_all, diff --git a/drivers/iommu/arm/arm-smmu/qcom_iommu.c b/drivers/iommu/arm/ar= m-smmu/qcom_iommu.c index 17235116d3bb..59f8a4d3865c 100644 --- a/drivers/iommu/arm/arm-smmu/qcom_iommu.c +++ b/drivers/iommu/arm/arm-smmu/qcom_iommu.c @@ -72,6 +72,9 @@ struct qcom_iommu_domain { struct iommu_fwspec *fwspec; }; =20 +static void qcom_iommu_detach_dev(struct iommu_domain *domain, + struct device *dev); + static struct qcom_iommu_domain *to_qcom_iommu_domain(struct iommu_domain = *dom) { return container_of(dom, struct qcom_iommu_domain, domain); @@ -319,10 +322,29 @@ static int qcom_iommu_init_domain(struct iommu_domain= *domain, return ret; } =20 +static int blocking_domain_attach_dev(struct iommu_domain *_domain, + struct device *dev) +{ + struct iommu_domain *domain =3D iommu_get_domain_for_dev(dev); + + qcom_iommu_detach_dev(domain, dev); + + return 0; +} + +static struct iommu_domain blocking_domain =3D { + .ops =3D &(const struct iommu_domain_ops) { + .attach_dev =3D blocking_domain_attach_dev + } +}; + static struct iommu_domain *qcom_iommu_domain_alloc(unsigned type) { struct qcom_iommu_domain *qcom_domain; =20 + if (type =3D=3D IOMMU_DOMAIN_BLOCKED) + return &blocking_domain; + if (type !=3D IOMMU_DOMAIN_UNMANAGED && type !=3D IOMMU_DOMAIN_DMA) return NULL; /* @@ -586,7 +608,6 @@ static const struct iommu_ops qcom_iommu_ops =3D { .pgsize_bitmap =3D SZ_4K | SZ_64K | SZ_1M | SZ_16M, .default_domain_ops =3D &(const struct iommu_domain_ops) { .attach_dev =3D qcom_iommu_attach_dev, - .detach_dev =3D qcom_iommu_detach_dev, .map =3D qcom_iommu_map, .unmap =3D qcom_iommu_unmap, .flush_iotlb_all =3D qcom_iommu_flush_iotlb_all, diff --git a/drivers/iommu/exynos-iommu.c b/drivers/iommu/exynos-iommu.c index 8e18984a0c4f..f2958ec1868c 100644 --- a/drivers/iommu/exynos-iommu.c +++ b/drivers/iommu/exynos-iommu.c @@ -174,6 +174,9 @@ static struct kmem_cache *lv2table_kmem_cache; static sysmmu_pte_t *zero_lv2_table; #define ZERO_LV2LINK mk_lv1ent_page(virt_to_phys(zero_lv2_table)) =20 +static void exynos_iommu_detach_device(struct iommu_domain *iommu_domain, + struct device *dev); + static sysmmu_pte_t *section_entry(sysmmu_pte_t *pgtable, sysmmu_iova_t io= va) { return pgtable + lv1ent_offset(iova); @@ -818,12 +821,31 @@ static inline void exynos_iommu_set_pte(sysmmu_pte_t = *ent, sysmmu_pte_t val) DMA_TO_DEVICE); } =20 +static int blocking_domain_attach_dev(struct iommu_domain *_domain, + struct device *dev) +{ + struct iommu_domain *domain =3D iommu_get_domain_for_dev(dev); + + exynos_iommu_detach_device(domain, dev); + + return 0; +} + +static struct iommu_domain blocking_domain =3D { + .ops =3D &(const struct iommu_domain_ops) { + .attach_dev =3D blocking_domain_attach_dev + } +}; + static struct iommu_domain *exynos_iommu_domain_alloc(unsigned type) { struct exynos_iommu_domain *domain; dma_addr_t handle; int i; =20 + if (type =3D=3D IOMMU_DOMAIN_BLOCKED) + return &blocking_domain; + /* Check if correct PTE offsets are initialized */ BUG_ON(PG_ENT_SHIFT < 0 || !dma_dev); =20 @@ -1406,7 +1428,6 @@ static const struct iommu_ops exynos_iommu_ops =3D { .of_xlate =3D exynos_iommu_of_xlate, .default_domain_ops =3D &(const struct iommu_domain_ops) { .attach_dev =3D exynos_iommu_attach_device, - .detach_dev =3D exynos_iommu_detach_device, .map =3D exynos_iommu_map, .unmap =3D exynos_iommu_unmap, .iova_to_phys =3D exynos_iommu_iova_to_phys, diff --git a/drivers/iommu/fsl_pamu_domain.c b/drivers/iommu/fsl_pamu_domai= n.c index 011f9ab7f743..66a7093c7852 100644 --- a/drivers/iommu/fsl_pamu_domain.c +++ b/drivers/iommu/fsl_pamu_domain.c @@ -23,6 +23,8 @@ static struct kmem_cache *iommu_devinfo_cache; static DEFINE_SPINLOCK(device_domain_lock); =20 struct iommu_device pamu_iommu; /* IOMMU core code handle */ +static void fsl_pamu_detach_device(struct iommu_domain *domain, + struct device *dev); =20 static struct fsl_dma_domain *to_fsl_dma_domain(struct iommu_domain *dom) { @@ -192,10 +194,29 @@ static void fsl_pamu_domain_free(struct iommu_domain = *domain) kmem_cache_free(fsl_pamu_domain_cache, dma_domain); } =20 +static int blocking_domain_attach_dev(struct iommu_domain *_domain, + struct device *dev) +{ + struct iommu_domain *domain =3D iommu_get_domain_for_dev(dev); + + fsl_pamu_detach_device(domain, dev); + + return 0; +} + +static struct iommu_domain blocking_domain =3D { + .ops =3D &(const struct iommu_domain_ops) { + .attach_dev =3D blocking_domain_attach_dev + } +}; + static struct iommu_domain *fsl_pamu_domain_alloc(unsigned type) { struct fsl_dma_domain *dma_domain; =20 + if (type =3D=3D IOMMU_DOMAIN_BLOCKED) + return &blocking_domain; + if (type !=3D IOMMU_DOMAIN_UNMANAGED) return NULL; =20 @@ -454,7 +475,6 @@ static const struct iommu_ops fsl_pamu_ops =3D { .device_group =3D fsl_pamu_device_group, .default_domain_ops =3D &(const struct iommu_domain_ops) { .attach_dev =3D fsl_pamu_attach_device, - .detach_dev =3D fsl_pamu_detach_device, .iova_to_phys =3D fsl_pamu_iova_to_phys, .free =3D fsl_pamu_domain_free, } diff --git a/drivers/iommu/ipmmu-vmsa.c b/drivers/iommu/ipmmu-vmsa.c index 1d42084d0276..cfb94e77bbab 100644 --- a/drivers/iommu/ipmmu-vmsa.c +++ b/drivers/iommu/ipmmu-vmsa.c @@ -79,6 +79,9 @@ struct ipmmu_vmsa_domain { struct mutex mutex; /* Protects mappings */ }; =20 +static void ipmmu_detach_device(struct iommu_domain *io_domain, + struct device *dev); + static struct ipmmu_vmsa_domain *to_vmsa_domain(struct iommu_domain *dom) { return container_of(dom, struct ipmmu_vmsa_domain, io_domain); @@ -566,11 +569,29 @@ static irqreturn_t ipmmu_irq(int irq, void *dev) /* -----------------------------------------------------------------------= ------ * IOMMU Operations */ +static int blocking_domain_attach_dev(struct iommu_domain *_domain, + struct device *dev) +{ + struct iommu_domain *domain =3D iommu_get_domain_for_dev(dev); + + ipmmu_detach_device(domain, dev); + + return 0; +} + +static struct iommu_domain blocking_domain =3D { + .ops =3D &(const struct iommu_domain_ops) { + .attach_dev =3D blocking_domain_attach_dev + } +}; =20 static struct iommu_domain *ipmmu_domain_alloc(unsigned type) { struct ipmmu_vmsa_domain *domain; =20 + if (type =3D=3D IOMMU_DOMAIN_BLOCKED) + return &blocking_domain; + if (type !=3D IOMMU_DOMAIN_UNMANAGED && type !=3D IOMMU_DOMAIN_DMA) return NULL; =20 @@ -878,7 +899,6 @@ static const struct iommu_ops ipmmu_ops =3D { .of_xlate =3D ipmmu_of_xlate, .default_domain_ops =3D &(const struct iommu_domain_ops) { .attach_dev =3D ipmmu_attach_device, - .detach_dev =3D ipmmu_detach_device, .map =3D ipmmu_map, .unmap =3D ipmmu_unmap, .flush_iotlb_all =3D ipmmu_flush_iotlb_all, diff --git a/drivers/iommu/msm_iommu.c b/drivers/iommu/msm_iommu.c index 6a24aa804ea3..f57f2da2d652 100644 --- a/drivers/iommu/msm_iommu.c +++ b/drivers/iommu/msm_iommu.c @@ -46,6 +46,9 @@ struct msm_priv { spinlock_t pgtlock; /* pagetable lock */ }; =20 +static void msm_iommu_detach_dev(struct iommu_domain *domain, + struct device *dev); + static struct msm_priv *to_msm_priv(struct iommu_domain *dom) { return container_of(dom, struct msm_priv, domain); @@ -302,10 +305,29 @@ static void __program_context(void __iomem *base, int= ctx, SET_M(base, ctx, 1); } =20 +static int blocking_domain_attach_dev(struct iommu_domain *_domain, + struct device *dev) +{ + struct iommu_domain *domain =3D iommu_get_domain_for_dev(dev); + + msm_iommu_detach_dev(domain, dev); + + return 0; +} + +static struct iommu_domain blocking_domain =3D { + .ops =3D &(const struct iommu_domain_ops) { + .attach_dev =3D blocking_domain_attach_dev + } +}; + static struct iommu_domain *msm_iommu_domain_alloc(unsigned type) { struct msm_priv *priv; =20 + if (type =3D=3D IOMMU_DOMAIN_BLOCKED) + return &blocking_domain; + if (type !=3D IOMMU_DOMAIN_UNMANAGED) return NULL; =20 @@ -678,7 +700,6 @@ static struct iommu_ops msm_iommu_ops =3D { .of_xlate =3D qcom_iommu_of_xlate, .default_domain_ops =3D &(const struct iommu_domain_ops) { .attach_dev =3D msm_iommu_attach_dev, - .detach_dev =3D msm_iommu_detach_dev, .map =3D msm_iommu_map, .unmap =3D msm_iommu_unmap, /* diff --git a/drivers/iommu/mtk_iommu.c b/drivers/iommu/mtk_iommu.c index 7e363b1f24df..63360272d504 100644 --- a/drivers/iommu/mtk_iommu.c +++ b/drivers/iommu/mtk_iommu.c @@ -264,6 +264,8 @@ static void mtk_iommu_unbind(struct device *dev) static const struct iommu_ops mtk_iommu_ops; =20 static int mtk_iommu_hw_init(const struct mtk_iommu_data *data, unsigned i= nt bankid); +static void mtk_iommu_detach_device(struct iommu_domain *domain, + struct device *dev); =20 #define MTK_IOMMU_TLB_ADDR(iova) ({ \ dma_addr_t _addr =3D iova; \ @@ -622,10 +624,29 @@ static int mtk_iommu_domain_finalise(struct mtk_iommu= _domain *dom, return 0; } =20 +static int blocking_domain_attach_dev(struct iommu_domain *_domain, + struct device *dev) +{ + struct iommu_domain *domain =3D iommu_get_domain_for_dev(dev); + + mtk_iommu_detach_device(domain, dev); + + return 0; +} + +static struct iommu_domain blocking_domain =3D { + .ops =3D &(const struct iommu_domain_ops) { + .attach_dev =3D blocking_domain_attach_dev + } +}; + static struct iommu_domain *mtk_iommu_domain_alloc(unsigned type) { struct mtk_iommu_domain *dom; =20 + if (type =3D=3D IOMMU_DOMAIN_BLOCKED) + return &blocking_domain; + if (type !=3D IOMMU_DOMAIN_DMA && type !=3D IOMMU_DOMAIN_UNMANAGED) return NULL; =20 @@ -934,7 +955,6 @@ static const struct iommu_ops mtk_iommu_ops =3D { .owner =3D THIS_MODULE, .default_domain_ops =3D &(const struct iommu_domain_ops) { .attach_dev =3D mtk_iommu_attach_device, - .detach_dev =3D mtk_iommu_detach_device, .map =3D mtk_iommu_map, .unmap =3D mtk_iommu_unmap, .flush_iotlb_all =3D mtk_iommu_flush_iotlb_all, diff --git a/drivers/iommu/mtk_iommu_v1.c b/drivers/iommu/mtk_iommu_v1.c index 128c7a3f1778..269622023917 100644 --- a/drivers/iommu/mtk_iommu_v1.c +++ b/drivers/iommu/mtk_iommu_v1.c @@ -116,6 +116,8 @@ struct mtk_iommu_v1_domain { struct mtk_iommu_v1_data *data; }; =20 +static void mtk_iommu_v1_detach_device(struct iommu_domain *domain, + struct device *dev); static int mtk_iommu_v1_bind(struct device *dev) { struct mtk_iommu_v1_data *data =3D dev_get_drvdata(dev); @@ -270,10 +272,29 @@ static int mtk_iommu_v1_domain_finalise(struct mtk_io= mmu_v1_data *data) return 0; } =20 +static int blocking_domain_attach_dev(struct iommu_domain *_domain, + struct device *dev) +{ + struct iommu_domain *domain =3D iommu_get_domain_for_dev(dev); + + mtk_iommu_v1_detach_device(domain, dev); + + return 0; +} + +static struct iommu_domain blocking_domain =3D { + .ops =3D &(const struct iommu_domain_ops) { + .attach_dev =3D blocking_domain_attach_dev + } +}; + static struct iommu_domain *mtk_iommu_v1_domain_alloc(unsigned type) { struct mtk_iommu_v1_domain *dom; =20 + if (type =3D=3D IOMMU_DOMAIN_BLOCKED) + return &blocking_domain; + if (type !=3D IOMMU_DOMAIN_UNMANAGED) return NULL; =20 @@ -590,7 +611,6 @@ static const struct iommu_ops mtk_iommu_v1_ops =3D { .owner =3D THIS_MODULE, .default_domain_ops =3D &(const struct iommu_domain_ops) { .attach_dev =3D mtk_iommu_v1_attach_device, - .detach_dev =3D mtk_iommu_v1_detach_device, .map =3D mtk_iommu_v1_map, .unmap =3D mtk_iommu_v1_unmap, .iova_to_phys =3D mtk_iommu_v1_iova_to_phys, diff --git a/drivers/iommu/omap-iommu.c b/drivers/iommu/omap-iommu.c index d9cf2820c02e..ceb88fd96ac0 100644 --- a/drivers/iommu/omap-iommu.c +++ b/drivers/iommu/omap-iommu.c @@ -1566,10 +1566,29 @@ static void omap_iommu_detach_dev(struct iommu_doma= in *domain, spin_unlock(&omap_domain->lock); } =20 +static int blocking_domain_attach_dev(struct iommu_domain *_domain, + struct device *dev) +{ + struct iommu_domain *domain =3D iommu_get_domain_for_dev(dev); + + omap_iommu_detach_dev(domain, dev); + + return 0; +} + +static struct iommu_domain blocking_domain =3D { + .ops =3D &(const struct iommu_domain_ops) { + .attach_dev =3D blocking_domain_attach_dev + } +}; + static struct iommu_domain *omap_iommu_domain_alloc(unsigned type) { struct omap_iommu_domain *omap_domain; =20 + if (type =3D=3D IOMMU_DOMAIN_BLOCKED) + return &blocking_domain; + if (type !=3D IOMMU_DOMAIN_UNMANAGED) return NULL; =20 @@ -1740,7 +1759,6 @@ static const struct iommu_ops omap_iommu_ops =3D { .pgsize_bitmap =3D OMAP_IOMMU_PGSIZES, .default_domain_ops =3D &(const struct iommu_domain_ops) { .attach_dev =3D omap_iommu_attach_dev, - .detach_dev =3D omap_iommu_detach_dev, .map =3D omap_iommu_map, .unmap =3D omap_iommu_unmap, .iova_to_phys =3D omap_iommu_iova_to_phys, diff --git a/drivers/iommu/rockchip-iommu.c b/drivers/iommu/rockchip-iommu.c index ab57c4b8fade..3a8239ddbb4f 100644 --- a/drivers/iommu/rockchip-iommu.c +++ b/drivers/iommu/rockchip-iommu.c @@ -1059,10 +1059,29 @@ static int rk_iommu_attach_device(struct iommu_doma= in *domain, return ret; } =20 +static int blocking_domain_attach_dev(struct iommu_domain *_domain, + struct device *dev) +{ + struct iommu_domain *domain =3D iommu_get_domain_for_dev(dev); + + rk_iommu_detach_device(domain, dev); + + return 0; +} + +static struct iommu_domain blocking_domain =3D { + .ops =3D &(const struct iommu_domain_ops) { + .attach_dev =3D blocking_domain_attach_dev + } +}; + static struct iommu_domain *rk_iommu_domain_alloc(unsigned type) { struct rk_iommu_domain *rk_domain; =20 + if (type =3D=3D IOMMU_DOMAIN_BLOCKED) + return &blocking_domain; + if (type !=3D IOMMU_DOMAIN_UNMANAGED && type !=3D IOMMU_DOMAIN_DMA) return NULL; =20 @@ -1194,7 +1213,6 @@ static const struct iommu_ops rk_iommu_ops =3D { .of_xlate =3D rk_iommu_of_xlate, .default_domain_ops =3D &(const struct iommu_domain_ops) { .attach_dev =3D rk_iommu_attach_device, - .detach_dev =3D rk_iommu_detach_device, .map =3D rk_iommu_map, .unmap =3D rk_iommu_unmap, .iova_to_phys =3D rk_iommu_iova_to_phys, diff --git a/drivers/iommu/s390-iommu.c b/drivers/iommu/s390-iommu.c index c898bcbbce11..b18c8302a23d 100644 --- a/drivers/iommu/s390-iommu.c +++ b/drivers/iommu/s390-iommu.c @@ -34,6 +34,9 @@ struct s390_domain_device { struct zpci_dev *zdev; }; =20 +static void s390_iommu_detach_device(struct iommu_domain *domain, + struct device *dev); + static struct s390_domain *to_s390_domain(struct iommu_domain *dom) { return container_of(dom, struct s390_domain, domain); @@ -51,10 +54,29 @@ static bool s390_iommu_capable(enum iommu_cap cap) } } =20 +static int blocking_domain_attach_dev(struct iommu_domain *_domain, + struct device *dev) +{ + struct iommu_domain *domain =3D iommu_get_domain_for_dev(dev); + + s390_iommu_detach_device(domain, dev); + + return 0; +} + +static struct iommu_domain blocking_domain =3D { + .ops =3D &(const struct iommu_domain_ops) { + .attach_dev =3D blocking_domain_attach_dev + } +}; + static struct iommu_domain *s390_domain_alloc(unsigned domain_type) { struct s390_domain *s390_domain; =20 + if (domain_type =3D=3D IOMMU_DOMAIN_BLOCKED) + return &blocking_domain; + if (domain_type !=3D IOMMU_DOMAIN_UNMANAGED) return NULL; =20 @@ -378,7 +400,6 @@ static const struct iommu_ops s390_iommu_ops =3D { .pgsize_bitmap =3D S390_IOMMU_PGSIZES, .default_domain_ops =3D &(const struct iommu_domain_ops) { .attach_dev =3D s390_iommu_attach_device, - .detach_dev =3D s390_iommu_detach_device, .map =3D s390_iommu_map, .unmap =3D s390_iommu_unmap, .iova_to_phys =3D s390_iommu_iova_to_phys, diff --git a/drivers/iommu/sprd-iommu.c b/drivers/iommu/sprd-iommu.c index 511959c8a14d..46c567c489d7 100644 --- a/drivers/iommu/sprd-iommu.c +++ b/drivers/iommu/sprd-iommu.c @@ -82,6 +82,9 @@ struct sprd_iommu_domain { =20 static const struct iommu_ops sprd_iommu_ops; =20 +static void sprd_iommu_detach_device(struct iommu_domain *domain, + struct device *dev); + static struct sprd_iommu_domain *to_sprd_domain(struct iommu_domain *dom) { return container_of(dom, struct sprd_iommu_domain, domain); @@ -132,10 +135,29 @@ sprd_iommu_pgt_size(struct iommu_domain *domain) SPRD_IOMMU_PAGE_SHIFT) * sizeof(u32); } =20 +static int blocking_domain_attach_dev(struct iommu_domain *_domain, + struct device *dev) +{ + struct iommu_domain *domain =3D iommu_get_domain_for_dev(dev); + + sprd_iommu_detach_device(domain, dev); + + return 0; +} + +static struct iommu_domain blocking_domain =3D { + .ops =3D &(const struct iommu_domain_ops) { + .attach_dev =3D blocking_domain_attach_dev + } +}; + static struct iommu_domain *sprd_iommu_domain_alloc(unsigned int domain_ty= pe) { struct sprd_iommu_domain *dom; =20 + if (domain_type =3D=3D IOMMU_DOMAIN_BLOCKED) + return &blocking_domain; + if (domain_type !=3D IOMMU_DOMAIN_DMA && domain_type !=3D IOMMU_DOMAIN_UN= MANAGED) return NULL; =20 @@ -413,7 +435,6 @@ static const struct iommu_ops sprd_iommu_ops =3D { .owner =3D THIS_MODULE, .default_domain_ops =3D &(const struct iommu_domain_ops) { .attach_dev =3D sprd_iommu_attach_device, - .detach_dev =3D sprd_iommu_detach_device, .map =3D sprd_iommu_map, .unmap =3D sprd_iommu_unmap, .iotlb_sync_map =3D sprd_iommu_sync_map, diff --git a/drivers/iommu/sun50i-iommu.c b/drivers/iommu/sun50i-iommu.c index a84c63518773..1e63e782d23e 100644 --- a/drivers/iommu/sun50i-iommu.c +++ b/drivers/iommu/sun50i-iommu.c @@ -121,6 +121,9 @@ struct sun50i_iommu_domain { struct sun50i_iommu *iommu; }; =20 +static void sun50i_iommu_detach_device(struct iommu_domain *domain, + struct device *dev); + static struct sun50i_iommu_domain *to_sun50i_domain(struct iommu_domain *d= omain) { return container_of(domain, struct sun50i_iommu_domain, domain); @@ -596,10 +599,29 @@ static phys_addr_t sun50i_iommu_iova_to_phys(struct i= ommu_domain *domain, sun50i_iova_get_page_offset(iova); } =20 +static int blocking_domain_attach_dev(struct iommu_domain *_domain, + struct device *dev) +{ + struct iommu_domain *domain =3D iommu_get_domain_for_dev(dev); + + sun50i_iommu_detach_device(domain, dev); + + return 0; +} + +static struct iommu_domain blocking_domain =3D { + .ops =3D &(const struct iommu_domain_ops) { + .attach_dev =3D blocking_domain_attach_dev + } +}; + static struct iommu_domain *sun50i_iommu_domain_alloc(unsigned type) { struct sun50i_iommu_domain *sun50i_domain; =20 + if (type =3D=3D IOMMU_DOMAIN_BLOCKED) + return &blocking_domain; + if (type !=3D IOMMU_DOMAIN_DMA && type !=3D IOMMU_DOMAIN_IDENTITY && type !=3D IOMMU_DOMAIN_UNMANAGED) @@ -764,7 +786,6 @@ static const struct iommu_ops sun50i_iommu_ops =3D { .probe_device =3D sun50i_iommu_probe_device, .default_domain_ops =3D &(const struct iommu_domain_ops) { .attach_dev =3D sun50i_iommu_attach_device, - .detach_dev =3D sun50i_iommu_detach_device, .flush_iotlb_all =3D sun50i_iommu_flush_iotlb_all, .iotlb_sync =3D sun50i_iommu_iotlb_sync, .iova_to_phys =3D sun50i_iommu_iova_to_phys, diff --git a/drivers/iommu/tegra-gart.c b/drivers/iommu/tegra-gart.c index e5ca3cf1a949..5d5669f60d23 100644 --- a/drivers/iommu/tegra-gart.c +++ b/drivers/iommu/tegra-gart.c @@ -141,10 +141,29 @@ static void gart_iommu_detach_dev(struct iommu_domain= *domain, spin_unlock(&gart->dom_lock); } =20 +static int blocking_domain_attach_dev(struct iommu_domain *_domain, + struct device *dev) +{ + struct iommu_domain *domain =3D iommu_get_domain_for_dev(dev); + + gart_iommu_detach_dev(domain, dev); + + return 0; +} + +static struct iommu_domain blocking_domain =3D { + .ops =3D &(const struct iommu_domain_ops) { + .attach_dev =3D blocking_domain_attach_dev + } +}; + static struct iommu_domain *gart_iommu_domain_alloc(unsigned type) { struct iommu_domain *domain; =20 + if (type =3D=3D IOMMU_DOMAIN_BLOCKED) + return &blocking_domain; + if (type !=3D IOMMU_DOMAIN_UNMANAGED) return NULL; =20 @@ -274,7 +293,6 @@ static const struct iommu_ops gart_iommu_ops =3D { .of_xlate =3D gart_iommu_of_xlate, .default_domain_ops =3D &(const struct iommu_domain_ops) { .attach_dev =3D gart_iommu_attach_dev, - .detach_dev =3D gart_iommu_detach_dev, .map =3D gart_iommu_map, .unmap =3D gart_iommu_unmap, .iova_to_phys =3D gart_iommu_iova_to_phys, diff --git a/drivers/iommu/tegra-smmu.c b/drivers/iommu/tegra-smmu.c index 2a8de975fe63..54fddb5215a5 100644 --- a/drivers/iommu/tegra-smmu.c +++ b/drivers/iommu/tegra-smmu.c @@ -62,6 +62,9 @@ struct tegra_smmu_as { u32 attr; }; =20 +static void tegra_smmu_detach_dev(struct iommu_domain *domain, + struct device *dev); + static struct tegra_smmu_as *to_smmu_as(struct iommu_domain *dom) { return container_of(dom, struct tegra_smmu_as, domain); @@ -272,10 +275,29 @@ static void tegra_smmu_free_asid(struct tegra_smmu *s= mmu, unsigned int id) clear_bit(id, smmu->asids); } =20 +static int blocking_domain_attach_dev(struct iommu_domain *_domain, + struct device *dev) +{ + struct iommu_domain *domain =3D iommu_get_domain_for_dev(dev); + + tegra_smmu_detach_dev(domain, dev); + + return 0; +} + +static struct iommu_domain blocking_domain =3D { + .ops =3D &(const struct iommu_domain_ops) { + .attach_dev =3D blocking_domain_attach_dev + } +}; + static struct iommu_domain *tegra_smmu_domain_alloc(unsigned type) { struct tegra_smmu_as *as; =20 + if (type =3D=3D IOMMU_DOMAIN_BLOCKED) + return &blocking_domain; + if (type !=3D IOMMU_DOMAIN_UNMANAGED) return NULL; =20 @@ -969,7 +991,6 @@ static const struct iommu_ops tegra_smmu_ops =3D { .pgsize_bitmap =3D SZ_4K, .default_domain_ops =3D &(const struct iommu_domain_ops) { .attach_dev =3D tegra_smmu_attach_dev, - .detach_dev =3D tegra_smmu_detach_dev, .map =3D tegra_smmu_map, .unmap =3D tegra_smmu_unmap, .iova_to_phys =3D tegra_smmu_iova_to_phys, --=20 2.25.1 From nobody Tue Apr 7 14:51:55 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 096FBECAAD4 for ; Fri, 26 Aug 2022 12:36:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344268AbiHZMgE (ORCPT ); Fri, 26 Aug 2022 08:36:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55416 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344214AbiHZMf4 (ORCPT ); Fri, 26 Aug 2022 08:35:56 -0400 Received: from mga06.intel.com (mga06b.intel.com [134.134.136.31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 99BD5C4815 for ; Fri, 26 Aug 2022 05:35:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1661517352; x=1693053352; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=dClFrh17TT/mhJK1T6hifUb1FM1C9tDrQAw2UO796mw=; b=Z3NFA1XlSDu8STAVsfzWIBaw0dk1HtXATGDrVFw7UZSdCmYVxxsHk6le 404GQFm+q0Z2B6nRGrOBiGCZnOV16XdycgDsbMDLAJSlxRB0F86koTKOi 02UcLS1/T+eGxb/rqbJp0AqsI8amPmeJWSBs7l7t/X4Sr/bNLAnEQQwKC Dg1SqJ3wZUU7E8KaHE27wSjxa8offnkEVmSlfibmhE6F7seJNm0VG7nSF jwDnLhqathfIh3zNQ3eDb36WtEUthKruzn9Dtc010/CpHSYZGmdnmKlLg Pbd97UWThqLDqd1qj9AVRB1bRHc4SmtZF9d68vqGXsBTk6orXEuiswfFG g==; X-IronPort-AV: E=McAfee;i="6500,9779,10450"; a="356210178" X-IronPort-AV: E=Sophos;i="5.93,265,1654585200"; d="scan'208";a="356210178" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Aug 2022 05:35:52 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.93,265,1654585200"; d="scan'208";a="606751961" Received: from allen-box.sh.intel.com ([10.239.159.48]) by orsmga007.jf.intel.com with ESMTP; 26 Aug 2022 05:35:48 -0700 From: Lu Baolu To: Joerg Roedel , Jason Gunthorpe , Christoph Hellwig , Kevin Tian , Ashok Raj , Will Deacon , Robin Murphy , Jean-Philippe Brucker Cc: Eric Auger , Liu Yi L , Jacob jun Pan , iommu@lists.linux.dev, linux-kernel@vger.kernel.org, Lu Baolu Subject: [PATCH v2 2/3] iommu: Retire detach_dev domain ops Date: Fri, 26 Aug 2022 20:30:13 +0800 Message-Id: <20220826123014.52709-3-baolu.lu@linux.intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220826123014.52709-1-baolu.lu@linux.intel.com> References: <20220826123014.52709-1-baolu.lu@linux.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" As no IOMMU driver provides detach_dev domain ops callback now, retire this callback and make the detach_dev calls in iommu core through the blocking domain. Signed-off-by: Lu Baolu --- include/linux/iommu.h | 2 -- drivers/iommu/iommu.c | 31 ++++--------------------------- 2 files changed, 4 insertions(+), 29 deletions(-) diff --git a/include/linux/iommu.h b/include/linux/iommu.h index 266ef281cbd5..1e9fecfb23a7 100644 --- a/include/linux/iommu.h +++ b/include/linux/iommu.h @@ -274,7 +274,6 @@ struct iommu_ops { /** * struct iommu_domain_ops - domain specific operations * @attach_dev: attach an iommu domain to a device - * @detach_dev: detach an iommu domain from a device * @set_dev_pasid: set an iommu domain to a pasid of device * @map: map a physically contiguous memory region to an iommu domain * @map_pages: map a physically contiguous set of pages of the same size to @@ -295,7 +294,6 @@ struct iommu_ops { */ struct iommu_domain_ops { int (*attach_dev)(struct iommu_domain *domain, struct device *dev); - void (*detach_dev)(struct iommu_domain *domain, struct device *dev); int (*set_dev_pasid)(struct iommu_domain *domain, struct device *dev, ioasid_t pasid); =20 diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c index 9e84f58440dd..ad34e4df1aad 100644 --- a/drivers/iommu/iommu.c +++ b/drivers/iommu/iommu.c @@ -2047,16 +2047,6 @@ int iommu_deferred_attach(struct device *dev, struct= iommu_domain *domain) return 0; } =20 -static void __iommu_detach_device(struct iommu_domain *domain, - struct device *dev) -{ - if (iommu_is_attach_deferred(dev)) - return; - - domain->ops->detach_dev(domain, dev); - trace_detach_device_from_domain(dev); -} - void iommu_detach_device(struct iommu_domain *domain, struct device *dev) { struct iommu_group *group; @@ -2149,15 +2139,6 @@ int iommu_attach_group(struct iommu_domain *domain, = struct iommu_group *group) } EXPORT_SYMBOL_GPL(iommu_attach_group); =20 -static int iommu_group_do_detach_device(struct device *dev, void *data) -{ - struct iommu_domain *domain =3D data; - - __iommu_detach_device(domain, dev); - - return 0; -} - static int __iommu_group_set_domain(struct iommu_group *group, struct iommu_domain *new_domain) { @@ -2167,17 +2148,13 @@ static int __iommu_group_set_domain(struct iommu_gr= oup *group, return 0; =20 /* - * New drivers should support default domains and so the detach_dev() op - * will never be called. Otherwise the NULL domain represents some - * platform specific behavior. + * The NULL domain represents some platform specific behavior. + * Attaching the blocking domain instead. */ if (!new_domain) { - if (WARN_ON(!group->domain->ops->detach_dev)) + if (WARN_ON(!group->blocking_domain)) return -EINVAL; - __iommu_group_for_each_dev(group, group->domain, - iommu_group_do_detach_device); - group->domain =3D NULL; - return 0; + new_domain =3D group->blocking_domain; } =20 /* --=20 2.25.1 From nobody Tue Apr 7 14:51:55 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 640E4ECAAD4 for ; Fri, 26 Aug 2022 12:36:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344192AbiHZMgP (ORCPT ); Fri, 26 Aug 2022 08:36:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55890 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344200AbiHZMgE (ORCPT ); Fri, 26 Aug 2022 08:36:04 -0400 Received: from mga06.intel.com (mga06b.intel.com [134.134.136.31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 77F0DD9D46 for ; Fri, 26 Aug 2022 05:36:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1661517361; x=1693053361; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=sOThp6gvbzkwQaPwwF0GAMaALhyV1l4KHiUjVYiga9s=; b=Ex1vWWpdY6MBbngT6kdMgE7DT+kWhzkVtX8hcZQCxfta9y61IQ95vtcM re7oJuP3EhOLwMqoNLUd1yuIfdA4/m+UcWhUlUIZmlErlXYsZ4Hsm/kmF n2gpjO8fY5moczOJe6nFEYqhr4KhPJiUpn0XJlds3z+/5zneHpi97D/ye 0ErQfMtFmL+ue5Un+aERek0RMx0MfRj0808bwsraOptzqvFVfdvrgg6Rj OYLzc8qZcfDBYT2qeVKSScF1JSj8TIQx+hlbaneuYoIpaVIqIdWLJ74sP u0doO1hcmqh8JhDwVUEnfxcWQawrCXYi8NuH/N/7Np4CDvJaqM6QkP9jR Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10450"; a="356210199" X-IronPort-AV: E=Sophos;i="5.93,265,1654585200"; d="scan'208";a="356210199" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Aug 2022 05:35:56 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.93,265,1654585200"; d="scan'208";a="606751990" Received: from allen-box.sh.intel.com ([10.239.159.48]) by orsmga007.jf.intel.com with ESMTP; 26 Aug 2022 05:35:52 -0700 From: Lu Baolu To: Joerg Roedel , Jason Gunthorpe , Christoph Hellwig , Kevin Tian , Ashok Raj , Will Deacon , Robin Murphy , Jean-Philippe Brucker Cc: Eric Auger , Liu Yi L , Jacob jun Pan , iommu@lists.linux.dev, linux-kernel@vger.kernel.org, Lu Baolu Subject: [PATCH v2 3/3] iommu: Rename attach_dev to set_dev Date: Fri, 26 Aug 2022 20:30:14 +0800 Message-Id: <20220826123014.52709-4-baolu.lu@linux.intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220826123014.52709-1-baolu.lu@linux.intel.com> References: <20220826123014.52709-1-baolu.lu@linux.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" With the retirement of the detach_dev callback, the naming of attach_dev isn't meaningful anymore. Rename it to set_dev to restore its original meaning, that is, setting an iommu domain to a device. From now on, after the devices are probed, the core only sets various iommu domains to the device, i.e. identity domain, dma domain, blocking domain and etc. Conceptually, there's always an iommu domain setting on the device. Signed-off-by: Lu Baolu --- include/linux/iommu.h | 4 ++-- drivers/iommu/amd/iommu.c | 4 ++-- drivers/iommu/apple-dart.c | 4 ++-- drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 4 ++-- drivers/iommu/arm/arm-smmu/arm-smmu.c | 2 +- drivers/iommu/arm/arm-smmu/qcom_iommu.c | 4 ++-- drivers/iommu/exynos-iommu.c | 4 ++-- drivers/iommu/fsl_pamu_domain.c | 4 ++-- drivers/iommu/intel/iommu.c | 4 ++-- drivers/iommu/iommu.c | 4 ++-- drivers/iommu/ipmmu-vmsa.c | 4 ++-- drivers/iommu/msm_iommu.c | 4 ++-- drivers/iommu/mtk_iommu.c | 4 ++-- drivers/iommu/mtk_iommu_v1.c | 4 ++-- drivers/iommu/omap-iommu.c | 4 ++-- drivers/iommu/rockchip-iommu.c | 4 ++-- drivers/iommu/s390-iommu.c | 6 +++--- drivers/iommu/sprd-iommu.c | 4 ++-- drivers/iommu/sun50i-iommu.c | 4 ++-- drivers/iommu/tegra-gart.c | 4 ++-- drivers/iommu/tegra-smmu.c | 4 ++-- drivers/iommu/virtio-iommu.c | 2 +- 22 files changed, 43 insertions(+), 43 deletions(-) diff --git a/include/linux/iommu.h b/include/linux/iommu.h index 1e9fecfb23a7..0d3131c7bf11 100644 --- a/include/linux/iommu.h +++ b/include/linux/iommu.h @@ -273,7 +273,7 @@ struct iommu_ops { =20 /** * struct iommu_domain_ops - domain specific operations - * @attach_dev: attach an iommu domain to a device + * @set_dev: attach an iommu domain to a device * @set_dev_pasid: set an iommu domain to a pasid of device * @map: map a physically contiguous memory region to an iommu domain * @map_pages: map a physically contiguous set of pages of the same size to @@ -293,7 +293,7 @@ struct iommu_ops { * @free: Release the domain after use. */ struct iommu_domain_ops { - int (*attach_dev)(struct iommu_domain *domain, struct device *dev); + int (*set_dev)(struct iommu_domain *domain, struct device *dev); int (*set_dev_pasid)(struct iommu_domain *domain, struct device *dev, ioasid_t pasid); =20 diff --git a/drivers/iommu/amd/iommu.c b/drivers/iommu/amd/iommu.c index 4cd0438b0a6e..620ad8d53773 100644 --- a/drivers/iommu/amd/iommu.c +++ b/drivers/iommu/amd/iommu.c @@ -2078,7 +2078,7 @@ static int blocking_domain_attach_dev(struct iommu_do= main *_domain, =20 static struct iommu_domain blocking_domain =3D { .ops =3D &(const struct iommu_domain_ops) { - .attach_dev =3D blocking_domain_attach_dev + .set_dev =3D blocking_domain_attach_dev } }; =20 @@ -2418,7 +2418,7 @@ const struct iommu_ops amd_iommu_ops =3D { .pgsize_bitmap =3D AMD_IOMMU_PGSIZES, .def_domain_type =3D amd_iommu_def_domain_type, .default_domain_ops =3D &(const struct iommu_domain_ops) { - .attach_dev =3D amd_iommu_attach_device, + .set_dev =3D amd_iommu_attach_device, .map =3D amd_iommu_map, .unmap =3D amd_iommu_unmap, .iotlb_sync_map =3D amd_iommu_iotlb_sync_map, diff --git a/drivers/iommu/apple-dart.c b/drivers/iommu/apple-dart.c index 5f46cbf04e07..01d7adb6b97a 100644 --- a/drivers/iommu/apple-dart.c +++ b/drivers/iommu/apple-dart.c @@ -580,7 +580,7 @@ static int blocking_domain_attach_dev(struct iommu_doma= in *_domain, =20 static struct iommu_domain blocking_domain =3D { .ops =3D &(const struct iommu_domain_ops) { - .attach_dev =3D blocking_domain_attach_dev + .set_dev =3D blocking_domain_attach_dev } }; =20 @@ -790,7 +790,7 @@ static const struct iommu_ops apple_dart_iommu_ops =3D { .pgsize_bitmap =3D -1UL, /* Restricted during dart probe */ .owner =3D THIS_MODULE, .default_domain_ops =3D &(const struct iommu_domain_ops) { - .attach_dev =3D apple_dart_attach_dev, + .set_dev =3D apple_dart_attach_dev, .map_pages =3D apple_dart_map_pages, .unmap_pages =3D apple_dart_unmap_pages, .flush_iotlb_all =3D apple_dart_flush_iotlb_all, diff --git a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c b/drivers/iommu/ar= m/arm-smmu-v3/arm-smmu-v3.c index a3c5b1a1203b..04d625aef897 100644 --- a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c +++ b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c @@ -2032,7 +2032,7 @@ static int blocking_domain_set_dev_pasid(struct iommu= _domain *_domain, =20 static struct iommu_domain blocking_domain =3D { .ops =3D &(const struct iommu_domain_ops) { - .attach_dev =3D blocking_domain_attach_dev, + .set_dev =3D blocking_domain_attach_dev, .set_dev_pasid =3D blocking_domain_set_dev_pasid } }; @@ -2870,7 +2870,7 @@ static struct iommu_ops arm_smmu_ops =3D { .pgsize_bitmap =3D -1UL, /* Restricted during device attach */ .owner =3D THIS_MODULE, .default_domain_ops =3D &(const struct iommu_domain_ops) { - .attach_dev =3D arm_smmu_attach_dev, + .set_dev =3D arm_smmu_attach_dev, .map_pages =3D arm_smmu_map_pages, .unmap_pages =3D arm_smmu_unmap_pages, .flush_iotlb_all =3D arm_smmu_flush_iotlb_all, diff --git a/drivers/iommu/arm/arm-smmu/arm-smmu.c b/drivers/iommu/arm/arm-= smmu/arm-smmu.c index dfa82df00342..57e93727b5f5 100644 --- a/drivers/iommu/arm/arm-smmu/arm-smmu.c +++ b/drivers/iommu/arm/arm-smmu/arm-smmu.c @@ -1588,7 +1588,7 @@ static struct iommu_ops arm_smmu_ops =3D { .pgsize_bitmap =3D -1UL, /* Restricted during device attach */ .owner =3D THIS_MODULE, .default_domain_ops =3D &(const struct iommu_domain_ops) { - .attach_dev =3D arm_smmu_attach_dev, + .set_dev =3D arm_smmu_attach_dev, .map_pages =3D arm_smmu_map_pages, .unmap_pages =3D arm_smmu_unmap_pages, .flush_iotlb_all =3D arm_smmu_flush_iotlb_all, diff --git a/drivers/iommu/arm/arm-smmu/qcom_iommu.c b/drivers/iommu/arm/ar= m-smmu/qcom_iommu.c index 59f8a4d3865c..a8d2bea55205 100644 --- a/drivers/iommu/arm/arm-smmu/qcom_iommu.c +++ b/drivers/iommu/arm/arm-smmu/qcom_iommu.c @@ -334,7 +334,7 @@ static int blocking_domain_attach_dev(struct iommu_doma= in *_domain, =20 static struct iommu_domain blocking_domain =3D { .ops =3D &(const struct iommu_domain_ops) { - .attach_dev =3D blocking_domain_attach_dev + .set_dev =3D blocking_domain_attach_dev } }; =20 @@ -607,7 +607,7 @@ static const struct iommu_ops qcom_iommu_ops =3D { .of_xlate =3D qcom_iommu_of_xlate, .pgsize_bitmap =3D SZ_4K | SZ_64K | SZ_1M | SZ_16M, .default_domain_ops =3D &(const struct iommu_domain_ops) { - .attach_dev =3D qcom_iommu_attach_dev, + .set_dev =3D qcom_iommu_attach_dev, .map =3D qcom_iommu_map, .unmap =3D qcom_iommu_unmap, .flush_iotlb_all =3D qcom_iommu_flush_iotlb_all, diff --git a/drivers/iommu/exynos-iommu.c b/drivers/iommu/exynos-iommu.c index f2958ec1868c..d2f5182bc50b 100644 --- a/drivers/iommu/exynos-iommu.c +++ b/drivers/iommu/exynos-iommu.c @@ -833,7 +833,7 @@ static int blocking_domain_attach_dev(struct iommu_doma= in *_domain, =20 static struct iommu_domain blocking_domain =3D { .ops =3D &(const struct iommu_domain_ops) { - .attach_dev =3D blocking_domain_attach_dev + .set_dev =3D blocking_domain_attach_dev } }; =20 @@ -1427,7 +1427,7 @@ static const struct iommu_ops exynos_iommu_ops =3D { .pgsize_bitmap =3D SECT_SIZE | LPAGE_SIZE | SPAGE_SIZE, .of_xlate =3D exynos_iommu_of_xlate, .default_domain_ops =3D &(const struct iommu_domain_ops) { - .attach_dev =3D exynos_iommu_attach_device, + .set_dev =3D exynos_iommu_attach_device, .map =3D exynos_iommu_map, .unmap =3D exynos_iommu_unmap, .iova_to_phys =3D exynos_iommu_iova_to_phys, diff --git a/drivers/iommu/fsl_pamu_domain.c b/drivers/iommu/fsl_pamu_domai= n.c index 66a7093c7852..740e45bce776 100644 --- a/drivers/iommu/fsl_pamu_domain.c +++ b/drivers/iommu/fsl_pamu_domain.c @@ -206,7 +206,7 @@ static int blocking_domain_attach_dev(struct iommu_doma= in *_domain, =20 static struct iommu_domain blocking_domain =3D { .ops =3D &(const struct iommu_domain_ops) { - .attach_dev =3D blocking_domain_attach_dev + .set_dev =3D blocking_domain_attach_dev } }; =20 @@ -474,7 +474,7 @@ static const struct iommu_ops fsl_pamu_ops =3D { .probe_device =3D fsl_pamu_probe_device, .device_group =3D fsl_pamu_device_group, .default_domain_ops =3D &(const struct iommu_domain_ops) { - .attach_dev =3D fsl_pamu_attach_device, + .set_dev =3D fsl_pamu_attach_device, .iova_to_phys =3D fsl_pamu_iova_to_phys, .free =3D fsl_pamu_domain_free, } diff --git a/drivers/iommu/intel/iommu.c b/drivers/iommu/intel/iommu.c index f5ae4f7f916d..28493abd736e 100644 --- a/drivers/iommu/intel/iommu.c +++ b/drivers/iommu/intel/iommu.c @@ -4154,7 +4154,7 @@ static int blocking_domain_set_dev_pasid(struct iommu= _domain *_domain, =20 static struct iommu_domain blocking_domain =3D { .ops =3D &(const struct iommu_domain_ops) { - .attach_dev =3D blocking_domain_attach_dev, + .set_dev =3D blocking_domain_attach_dev, .set_dev_pasid =3D blocking_domain_set_dev_pasid, } }; @@ -4793,7 +4793,7 @@ const struct iommu_ops intel_iommu_ops =3D { .page_response =3D intel_svm_page_response, #endif .default_domain_ops =3D &(const struct iommu_domain_ops) { - .attach_dev =3D intel_iommu_attach_device, + .set_dev =3D intel_iommu_attach_device, .map_pages =3D intel_iommu_map_pages, .unmap_pages =3D intel_iommu_unmap_pages, .iotlb_sync_map =3D intel_iommu_iotlb_sync_map, diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c index ad34e4df1aad..8cb35ba60501 100644 --- a/drivers/iommu/iommu.c +++ b/drivers/iommu/iommu.c @@ -2002,10 +2002,10 @@ static int __iommu_attach_device(struct iommu_domai= n *domain, { int ret; =20 - if (unlikely(domain->ops->attach_dev =3D=3D NULL)) + if (unlikely(!domain->ops->set_dev)) return -ENODEV; =20 - ret =3D domain->ops->attach_dev(domain, dev); + ret =3D domain->ops->set_dev(domain, dev); if (!ret) trace_attach_device_to_domain(dev); return ret; diff --git a/drivers/iommu/ipmmu-vmsa.c b/drivers/iommu/ipmmu-vmsa.c index cfb94e77bbab..4ebd9a15ce07 100644 --- a/drivers/iommu/ipmmu-vmsa.c +++ b/drivers/iommu/ipmmu-vmsa.c @@ -581,7 +581,7 @@ static int blocking_domain_attach_dev(struct iommu_doma= in *_domain, =20 static struct iommu_domain blocking_domain =3D { .ops =3D &(const struct iommu_domain_ops) { - .attach_dev =3D blocking_domain_attach_dev + .set_dev =3D blocking_domain_attach_dev } }; =20 @@ -898,7 +898,7 @@ static const struct iommu_ops ipmmu_ops =3D { .pgsize_bitmap =3D SZ_1G | SZ_2M | SZ_4K, .of_xlate =3D ipmmu_of_xlate, .default_domain_ops =3D &(const struct iommu_domain_ops) { - .attach_dev =3D ipmmu_attach_device, + .set_dev =3D ipmmu_attach_device, .map =3D ipmmu_map, .unmap =3D ipmmu_unmap, .flush_iotlb_all =3D ipmmu_flush_iotlb_all, diff --git a/drivers/iommu/msm_iommu.c b/drivers/iommu/msm_iommu.c index f57f2da2d652..a6288a325076 100644 --- a/drivers/iommu/msm_iommu.c +++ b/drivers/iommu/msm_iommu.c @@ -317,7 +317,7 @@ static int blocking_domain_attach_dev(struct iommu_doma= in *_domain, =20 static struct iommu_domain blocking_domain =3D { .ops =3D &(const struct iommu_domain_ops) { - .attach_dev =3D blocking_domain_attach_dev + .set_dev =3D blocking_domain_attach_dev } }; =20 @@ -699,7 +699,7 @@ static struct iommu_ops msm_iommu_ops =3D { .pgsize_bitmap =3D MSM_IOMMU_PGSIZES, .of_xlate =3D qcom_iommu_of_xlate, .default_domain_ops =3D &(const struct iommu_domain_ops) { - .attach_dev =3D msm_iommu_attach_dev, + .set_dev =3D msm_iommu_attach_dev, .map =3D msm_iommu_map, .unmap =3D msm_iommu_unmap, /* diff --git a/drivers/iommu/mtk_iommu.c b/drivers/iommu/mtk_iommu.c index 63360272d504..7c02b4fe8314 100644 --- a/drivers/iommu/mtk_iommu.c +++ b/drivers/iommu/mtk_iommu.c @@ -636,7 +636,7 @@ static int blocking_domain_attach_dev(struct iommu_doma= in *_domain, =20 static struct iommu_domain blocking_domain =3D { .ops =3D &(const struct iommu_domain_ops) { - .attach_dev =3D blocking_domain_attach_dev + .set_dev =3D blocking_domain_attach_dev } }; =20 @@ -954,7 +954,7 @@ static const struct iommu_ops mtk_iommu_ops =3D { .pgsize_bitmap =3D SZ_4K | SZ_64K | SZ_1M | SZ_16M, .owner =3D THIS_MODULE, .default_domain_ops =3D &(const struct iommu_domain_ops) { - .attach_dev =3D mtk_iommu_attach_device, + .set_dev =3D mtk_iommu_attach_device, .map =3D mtk_iommu_map, .unmap =3D mtk_iommu_unmap, .flush_iotlb_all =3D mtk_iommu_flush_iotlb_all, diff --git a/drivers/iommu/mtk_iommu_v1.c b/drivers/iommu/mtk_iommu_v1.c index 269622023917..221b3af5fa94 100644 --- a/drivers/iommu/mtk_iommu_v1.c +++ b/drivers/iommu/mtk_iommu_v1.c @@ -284,7 +284,7 @@ static int blocking_domain_attach_dev(struct iommu_doma= in *_domain, =20 static struct iommu_domain blocking_domain =3D { .ops =3D &(const struct iommu_domain_ops) { - .attach_dev =3D blocking_domain_attach_dev + .set_dev =3D blocking_domain_attach_dev } }; =20 @@ -610,7 +610,7 @@ static const struct iommu_ops mtk_iommu_v1_ops =3D { .pgsize_bitmap =3D ~0UL << MT2701_IOMMU_PAGE_SHIFT, .owner =3D THIS_MODULE, .default_domain_ops =3D &(const struct iommu_domain_ops) { - .attach_dev =3D mtk_iommu_v1_attach_device, + .set_dev =3D mtk_iommu_v1_attach_device, .map =3D mtk_iommu_v1_map, .unmap =3D mtk_iommu_v1_unmap, .iova_to_phys =3D mtk_iommu_v1_iova_to_phys, diff --git a/drivers/iommu/omap-iommu.c b/drivers/iommu/omap-iommu.c index ceb88fd96ac0..0bb75c0994c8 100644 --- a/drivers/iommu/omap-iommu.c +++ b/drivers/iommu/omap-iommu.c @@ -1578,7 +1578,7 @@ static int blocking_domain_attach_dev(struct iommu_do= main *_domain, =20 static struct iommu_domain blocking_domain =3D { .ops =3D &(const struct iommu_domain_ops) { - .attach_dev =3D blocking_domain_attach_dev + .set_dev =3D blocking_domain_attach_dev } }; =20 @@ -1758,7 +1758,7 @@ static const struct iommu_ops omap_iommu_ops =3D { .device_group =3D omap_iommu_device_group, .pgsize_bitmap =3D OMAP_IOMMU_PGSIZES, .default_domain_ops =3D &(const struct iommu_domain_ops) { - .attach_dev =3D omap_iommu_attach_dev, + .set_dev =3D omap_iommu_attach_dev, .map =3D omap_iommu_map, .unmap =3D omap_iommu_unmap, .iova_to_phys =3D omap_iommu_iova_to_phys, diff --git a/drivers/iommu/rockchip-iommu.c b/drivers/iommu/rockchip-iommu.c index 3a8239ddbb4f..3b0bbc80b4aa 100644 --- a/drivers/iommu/rockchip-iommu.c +++ b/drivers/iommu/rockchip-iommu.c @@ -1071,7 +1071,7 @@ static int blocking_domain_attach_dev(struct iommu_do= main *_domain, =20 static struct iommu_domain blocking_domain =3D { .ops =3D &(const struct iommu_domain_ops) { - .attach_dev =3D blocking_domain_attach_dev + .set_dev =3D blocking_domain_attach_dev } }; =20 @@ -1212,7 +1212,7 @@ static const struct iommu_ops rk_iommu_ops =3D { .pgsize_bitmap =3D RK_IOMMU_PGSIZE_BITMAP, .of_xlate =3D rk_iommu_of_xlate, .default_domain_ops =3D &(const struct iommu_domain_ops) { - .attach_dev =3D rk_iommu_attach_device, + .set_dev =3D rk_iommu_attach_device, .map =3D rk_iommu_map, .unmap =3D rk_iommu_unmap, .iova_to_phys =3D rk_iommu_iova_to_phys, diff --git a/drivers/iommu/s390-iommu.c b/drivers/iommu/s390-iommu.c index b18c8302a23d..3b91c0570cbd 100644 --- a/drivers/iommu/s390-iommu.c +++ b/drivers/iommu/s390-iommu.c @@ -66,7 +66,7 @@ static int blocking_domain_attach_dev(struct iommu_domain= *_domain, =20 static struct iommu_domain blocking_domain =3D { .ops =3D &(const struct iommu_domain_ops) { - .attach_dev =3D blocking_domain_attach_dev + .set_dev =3D blocking_domain_attach_dev } }; =20 @@ -221,7 +221,7 @@ static void s390_iommu_release_device(struct device *de= v) * This is a workaround for a scenario where the IOMMU API common code * "forgets" to call the detach_dev callback: After binding a device * to vfio-pci and completing the VFIO_SET_IOMMU ioctl (which triggers - * the attach_dev), removing the device via + * the set_dev), removing the device via * "echo 1 > /sys/bus/pci/devices/.../remove" won't trigger detach_dev, * only release_device will be called via the BUS_NOTIFY_REMOVED_DEVICE * notifier. @@ -399,7 +399,7 @@ static const struct iommu_ops s390_iommu_ops =3D { .device_group =3D generic_device_group, .pgsize_bitmap =3D S390_IOMMU_PGSIZES, .default_domain_ops =3D &(const struct iommu_domain_ops) { - .attach_dev =3D s390_iommu_attach_device, + .set_dev =3D s390_iommu_attach_device, .map =3D s390_iommu_map, .unmap =3D s390_iommu_unmap, .iova_to_phys =3D s390_iommu_iova_to_phys, diff --git a/drivers/iommu/sprd-iommu.c b/drivers/iommu/sprd-iommu.c index 46c567c489d7..7629e107c266 100644 --- a/drivers/iommu/sprd-iommu.c +++ b/drivers/iommu/sprd-iommu.c @@ -147,7 +147,7 @@ static int blocking_domain_attach_dev(struct iommu_doma= in *_domain, =20 static struct iommu_domain blocking_domain =3D { .ops =3D &(const struct iommu_domain_ops) { - .attach_dev =3D blocking_domain_attach_dev + .set_dev =3D blocking_domain_attach_dev } }; =20 @@ -434,7 +434,7 @@ static const struct iommu_ops sprd_iommu_ops =3D { .pgsize_bitmap =3D ~0UL << SPRD_IOMMU_PAGE_SHIFT, .owner =3D THIS_MODULE, .default_domain_ops =3D &(const struct iommu_domain_ops) { - .attach_dev =3D sprd_iommu_attach_device, + .set_dev =3D sprd_iommu_attach_device, .map =3D sprd_iommu_map, .unmap =3D sprd_iommu_unmap, .iotlb_sync_map =3D sprd_iommu_sync_map, diff --git a/drivers/iommu/sun50i-iommu.c b/drivers/iommu/sun50i-iommu.c index 1e63e782d23e..289184549238 100644 --- a/drivers/iommu/sun50i-iommu.c +++ b/drivers/iommu/sun50i-iommu.c @@ -611,7 +611,7 @@ static int blocking_domain_attach_dev(struct iommu_doma= in *_domain, =20 static struct iommu_domain blocking_domain =3D { .ops =3D &(const struct iommu_domain_ops) { - .attach_dev =3D blocking_domain_attach_dev + .set_dev =3D blocking_domain_attach_dev } }; =20 @@ -785,7 +785,7 @@ static const struct iommu_ops sun50i_iommu_ops =3D { .of_xlate =3D sun50i_iommu_of_xlate, .probe_device =3D sun50i_iommu_probe_device, .default_domain_ops =3D &(const struct iommu_domain_ops) { - .attach_dev =3D sun50i_iommu_attach_device, + .set_dev =3D sun50i_iommu_attach_device, .flush_iotlb_all =3D sun50i_iommu_flush_iotlb_all, .iotlb_sync =3D sun50i_iommu_iotlb_sync, .iova_to_phys =3D sun50i_iommu_iova_to_phys, diff --git a/drivers/iommu/tegra-gart.c b/drivers/iommu/tegra-gart.c index 5d5669f60d23..c5f3d6feed24 100644 --- a/drivers/iommu/tegra-gart.c +++ b/drivers/iommu/tegra-gart.c @@ -153,7 +153,7 @@ static int blocking_domain_attach_dev(struct iommu_doma= in *_domain, =20 static struct iommu_domain blocking_domain =3D { .ops =3D &(const struct iommu_domain_ops) { - .attach_dev =3D blocking_domain_attach_dev + .set_dev =3D blocking_domain_attach_dev } }; =20 @@ -292,7 +292,7 @@ static const struct iommu_ops gart_iommu_ops =3D { .pgsize_bitmap =3D GART_IOMMU_PGSIZES, .of_xlate =3D gart_iommu_of_xlate, .default_domain_ops =3D &(const struct iommu_domain_ops) { - .attach_dev =3D gart_iommu_attach_dev, + .set_dev =3D gart_iommu_attach_dev, .map =3D gart_iommu_map, .unmap =3D gart_iommu_unmap, .iova_to_phys =3D gart_iommu_iova_to_phys, diff --git a/drivers/iommu/tegra-smmu.c b/drivers/iommu/tegra-smmu.c index 54fddb5215a5..9b3e44e36b10 100644 --- a/drivers/iommu/tegra-smmu.c +++ b/drivers/iommu/tegra-smmu.c @@ -287,7 +287,7 @@ static int blocking_domain_attach_dev(struct iommu_doma= in *_domain, =20 static struct iommu_domain blocking_domain =3D { .ops =3D &(const struct iommu_domain_ops) { - .attach_dev =3D blocking_domain_attach_dev + .set_dev =3D blocking_domain_attach_dev } }; =20 @@ -990,7 +990,7 @@ static const struct iommu_ops tegra_smmu_ops =3D { .of_xlate =3D tegra_smmu_of_xlate, .pgsize_bitmap =3D SZ_4K, .default_domain_ops =3D &(const struct iommu_domain_ops) { - .attach_dev =3D tegra_smmu_attach_dev, + .set_dev =3D tegra_smmu_attach_dev, .map =3D tegra_smmu_map, .unmap =3D tegra_smmu_unmap, .iova_to_phys =3D tegra_smmu_iova_to_phys, diff --git a/drivers/iommu/virtio-iommu.c b/drivers/iommu/virtio-iommu.c index 08eeafc9529f..24de723f9158 100644 --- a/drivers/iommu/virtio-iommu.c +++ b/drivers/iommu/virtio-iommu.c @@ -1016,7 +1016,7 @@ static struct iommu_ops viommu_ops =3D { .of_xlate =3D viommu_of_xlate, .owner =3D THIS_MODULE, .default_domain_ops =3D &(const struct iommu_domain_ops) { - .attach_dev =3D viommu_attach_dev, + .set_dev =3D viommu_attach_dev, .map_pages =3D viommu_map_pages, .unmap_pages =3D viommu_unmap_pages, .iova_to_phys =3D viommu_iova_to_phys, --=20 2.25.1