From nobody Fri Sep 19 07:19:25 2025 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 028E1C433FE for ; Mon, 28 Nov 2022 06:57:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229907AbiK1G5I (ORCPT ); Mon, 28 Nov 2022 01:57:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50306 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229529AbiK1G41 (ORCPT ); Mon, 28 Nov 2022 01:56:27 -0500 Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7C0DF15A3F for ; Sun, 27 Nov 2022 22:56:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1669618586; x=1701154586; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=nLuhPxobe8kTeSr/8uapIkQWPmWiW5lqkROueW3ss2c=; b=gCbYUGaTLvOVEdjRfB1CZtHfIF+Ba76Ot04FN3GdSw0yRkyStReMqZAE uOhmMFj+NfQM20lBIQ/ZYWdFRptGVmd1olDZAMlAsaMZ2l7YPv6SctWtW zE0hTROyQ548v0kLfP5PD1I4Ywipi3hf5Cz0CS7dHMjeSXWfGSgFH4rrX KCqcsBhDf2TiYKg6VchErv22NsZfV7XLoXmHPQzdvsGL9ajG2E0Osi4pH u0HRfJLTQQi3eKqt6kEHMdKLGbqszvWcClkEjr3aG7ykA7fHv8Ht5Lt9s xq5a5oYfaVid3LKFnawGk63fTSrEpbqDz3JOX7OdLuVgNum5kZAmhMquz Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10544"; a="313459258" X-IronPort-AV: E=Sophos;i="5.96,199,1665471600"; d="scan'208";a="313459258" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Nov 2022 22:56:26 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10544"; a="674121355" X-IronPort-AV: E=Sophos;i="5.96,199,1665471600"; d="scan'208";a="674121355" Received: from allen-box.sh.intel.com ([10.239.159.48]) by orsmga008.jf.intel.com with ESMTP; 27 Nov 2022 22:56:19 -0800 From: Lu Baolu To: Joerg Roedel , Jason Gunthorpe , Christoph Hellwig , Kevin Tian , Will Deacon , Robin Murphy , Jean-Philippe Brucker Cc: Suravee Suthikulpanit , Hector Martin , Sven Peter , Rob Clark , Marek Szyprowski , Krzysztof Kozlowski , Andy Gross , Bjorn Andersson , Yong Wu , Matthias Brugger , Heiko Stuebner , Matthew Rosato , Orson Zhai , Baolin Wang , Chunyan Zhang , Chen-Yu Tsai , Thierry Reding , iommu@lists.linux.dev, linux-kernel@vger.kernel.org, Lu Baolu Subject: [PATCH v3 20/20] iommu: Rename attach_dev to set_dev Date: Mon, 28 Nov 2022 14:46:48 +0800 Message-Id: <20221128064648.1934720-21-baolu.lu@linux.intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221128064648.1934720-1-baolu.lu@linux.intel.com> References: <20221128064648.1934720-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 real meaning, that is, setting an iommu domain to a device. Signed-off-by: Lu Baolu --- include/linux/iommu.h | 4 ++-- drivers/iommu/amd/iommu.c | 2 +- drivers/iommu/apple-dart.c | 2 +- drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 2 +- drivers/iommu/arm/arm-smmu/arm-smmu.c | 2 +- drivers/iommu/arm/arm-smmu/qcom_iommu.c | 2 +- drivers/iommu/exynos-iommu.c | 2 +- drivers/iommu/fsl_pamu_domain.c | 2 +- drivers/iommu/intel/iommu.c | 4 ++-- drivers/iommu/iommu.c | 4 ++-- drivers/iommu/ipmmu-vmsa.c | 2 +- drivers/iommu/msm_iommu.c | 2 +- drivers/iommu/mtk_iommu.c | 2 +- drivers/iommu/mtk_iommu_v1.c | 2 +- drivers/iommu/omap-iommu.c | 2 +- drivers/iommu/rockchip-iommu.c | 2 +- drivers/iommu/s390-iommu.c | 2 +- drivers/iommu/sprd-iommu.c | 2 +- drivers/iommu/sun50i-iommu.c | 2 +- drivers/iommu/tegra-gart.c | 2 +- drivers/iommu/tegra-smmu.c | 2 +- drivers/iommu/virtio-iommu.c | 2 +- 22 files changed, 25 insertions(+), 25 deletions(-) diff --git a/include/linux/iommu.h b/include/linux/iommu.h index 4c0491e5708c..1def4b4bb2b9 100644 --- a/include/linux/iommu.h +++ b/include/linux/iommu.h @@ -281,7 +281,7 @@ struct iommu_ops { =20 /** * struct iommu_domain_ops - domain specific operations - * @attach_dev: attach an iommu domain to a device + * @set_dev: set an iommu domain to a device * Return: * * 0 - success * * EINVAL - can indicate that device and domain are incompatible due to @@ -313,7 +313,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 bd1970b4f48b..f628bd0f9632 100644 --- a/drivers/iommu/amd/iommu.c +++ b/drivers/iommu/amd/iommu.c @@ -2388,7 +2388,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_pages =3D amd_iommu_map_pages, .unmap_pages =3D amd_iommu_unmap_pages, .iotlb_sync_map =3D amd_iommu_iotlb_sync_map, diff --git a/drivers/iommu/apple-dart.c b/drivers/iommu/apple-dart.c index 6fbe6b275c79..77c9e7d3e1a2 100644 --- a/drivers/iommu/apple-dart.c +++ b/drivers/iommu/apple-dart.c @@ -763,7 +763,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 ab160198edd6..194c304c5ee8 100644 --- a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c +++ b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c @@ -2859,7 +2859,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 719fbca1fe52..e31002d84b4a 100644 --- a/drivers/iommu/arm/arm-smmu/arm-smmu.c +++ b/drivers/iommu/arm/arm-smmu/arm-smmu.c @@ -1567,7 +1567,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 d7be3adee426..195add905364 100644 --- a/drivers/iommu/arm/arm-smmu/qcom_iommu.c +++ b/drivers/iommu/arm/arm-smmu/qcom_iommu.c @@ -560,7 +560,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_pages =3D qcom_iommu_map, .unmap_pages =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 29ec713e8a21..7e735929e395 100644 --- a/drivers/iommu/exynos-iommu.c +++ b/drivers/iommu/exynos-iommu.c @@ -1403,7 +1403,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 272d88e415c6..c66e48b0ed6f 100644 --- a/drivers/iommu/fsl_pamu_domain.c +++ b/drivers/iommu/fsl_pamu_domain.c @@ -462,7 +462,7 @@ static const struct iommu_ops fsl_pamu_ops =3D { .device_group =3D fsl_pamu_device_group, .set_platform_dma =3D fsl_pamu_set_platform_dma; .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 cd71194fe7a6..7bcadb702e00 100644 --- a/drivers/iommu/intel/iommu.c +++ b/drivers/iommu/intel/iommu.c @@ -4131,7 +4131,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, .free =3D intel_iommu_domain_free } }; @@ -4750,7 +4750,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 e4966f088184..dca31065cdb5 100644 --- a/drivers/iommu/iommu.c +++ b/drivers/iommu/iommu.c @@ -1983,10 +1983,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 3112822ac7be..8d40a2c150d4 100644 --- a/drivers/iommu/ipmmu-vmsa.c +++ b/drivers/iommu/ipmmu-vmsa.c @@ -860,7 +860,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_pages =3D ipmmu_map, .unmap_pages =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 564f9dc0140d..9f7432443726 100644 --- a/drivers/iommu/msm_iommu.c +++ b/drivers/iommu/msm_iommu.c @@ -690,7 +690,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_pages =3D msm_iommu_map, .unmap_pages =3D msm_iommu_unmap, /* diff --git a/drivers/iommu/mtk_iommu.c b/drivers/iommu/mtk_iommu.c index 2022f47529c1..6bd4eb39c08f 100644 --- a/drivers/iommu/mtk_iommu.c +++ b/drivers/iommu/mtk_iommu.c @@ -940,7 +940,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_pages =3D mtk_iommu_map, .unmap_pages =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 c2d80b7a377f..785fc1569bc7 100644 --- a/drivers/iommu/mtk_iommu_v1.c +++ b/drivers/iommu/mtk_iommu_v1.c @@ -596,7 +596,7 @@ static const struct iommu_ops mtk_iommu_v1_ops =3D { .set_platform_dma =3D mtk_iommu_v1_set_platform_dma, .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_pages =3D mtk_iommu_v1_map, .unmap_pages =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 c3eedab00038..6f1031336611 100644 --- a/drivers/iommu/omap-iommu.c +++ b/drivers/iommu/omap-iommu.c @@ -1748,7 +1748,7 @@ static const struct iommu_ops omap_iommu_ops =3D { .set_platform_dma =3D omap_iommu_set_platform_dma, .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 f30db22ea5d7..5381dbf624ad 100644 --- a/drivers/iommu/rockchip-iommu.c +++ b/drivers/iommu/rockchip-iommu.c @@ -1191,7 +1191,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 33dba5ee5e20..5fa8ea6687e7 100644 --- a/drivers/iommu/s390-iommu.c +++ b/drivers/iommu/s390-iommu.c @@ -447,7 +447,7 @@ static const struct iommu_ops s390_iommu_ops =3D { .pgsize_bitmap =3D SZ_4K, .get_resv_regions =3D s390_iommu_get_resv_regions, .default_domain_ops =3D &(const struct iommu_domain_ops) { - .attach_dev =3D s390_iommu_attach_device, + .set_dev =3D s390_iommu_attach_device, .map_pages =3D s390_iommu_map_pages, .unmap_pages =3D s390_iommu_unmap_pages, .flush_iotlb_all =3D s390_iommu_flush_iotlb_all, diff --git a/drivers/iommu/sprd-iommu.c b/drivers/iommu/sprd-iommu.c index ae94d74b73f4..e105fa476e94 100644 --- a/drivers/iommu/sprd-iommu.c +++ b/drivers/iommu/sprd-iommu.c @@ -398,7 +398,7 @@ static const struct iommu_ops sprd_iommu_ops =3D { .pgsize_bitmap =3D SPRD_IOMMU_PAGE_SIZE, .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_pages =3D sprd_iommu_map, .unmap_pages =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 37b074be87a5..2a35148c2b65 100644 --- a/drivers/iommu/sun50i-iommu.c +++ b/drivers/iommu/sun50i-iommu.c @@ -834,7 +834,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_map =3D sun50i_iommu_iotlb_sync_map, .iotlb_sync =3D sun50i_iommu_iotlb_sync, diff --git a/drivers/iommu/tegra-gart.c b/drivers/iommu/tegra-gart.c index a532b333233f..2b3944d10735 100644 --- a/drivers/iommu/tegra-gart.c +++ b/drivers/iommu/tegra-gart.c @@ -282,7 +282,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 247d485904c1..b9f035069794 100644 --- a/drivers/iommu/tegra-smmu.c +++ b/drivers/iommu/tegra-smmu.c @@ -977,7 +977,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 5b8fe9bfa9a5..c407c4b213db 100644 --- a/drivers/iommu/virtio-iommu.c +++ b/drivers/iommu/virtio-iommu.c @@ -1028,7 +1028,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.34.1