All of lore.kernel.org
 help / color / mirror / Atom feed
From: Robin Murphy <robin.murphy@arm.com>
To: joro@8bytes.org, will@kernel.org
Cc: jean-philippe@linaro.org, zhang.lyra@gmail.com,
	linux-kernel@vger.kernel.org, iommu@lists.linux-foundation.org,
	thierry.reding@gmail.com, linux-arm-kernel@lists.infradead.org,
	gerald.schaefer@linux.ibm.com
Subject: [PATCH v2 09/14] iommu/ipmmu-vmsa: Clean up bus_set_iommu()
Date: Thu, 28 Apr 2022 14:18:10 +0100	[thread overview]
Message-ID: <01a58dcc9c70836b7556d54dbdac6a340f206781.1650890638.git.robin.murphy@arm.com> (raw)
In-Reply-To: <cover.1650890638.git.robin.murphy@arm.com>

Stop calling bus_set_iommu() since it's now unnecessary. This also
leaves the custom initcall effectively doing nothing but register
the driver, which no longer needs to happen early either, so convert
it to builtin_platform_driver().

Signed-off-by: Robin Murphy <robin.murphy@arm.com>
---
 drivers/iommu/ipmmu-vmsa.c | 35 +----------------------------------
 1 file changed, 1 insertion(+), 34 deletions(-)

diff --git a/drivers/iommu/ipmmu-vmsa.c b/drivers/iommu/ipmmu-vmsa.c
index 8fdb84b3642b..2549d32f0ddd 100644
--- a/drivers/iommu/ipmmu-vmsa.c
+++ b/drivers/iommu/ipmmu-vmsa.c
@@ -1090,11 +1090,6 @@ static int ipmmu_probe(struct platform_device *pdev)
 		ret = iommu_device_register(&mmu->iommu, &ipmmu_ops, &pdev->dev);
 		if (ret)
 			return ret;
-
-#if defined(CONFIG_IOMMU_DMA)
-		if (!iommu_present(&platform_bus_type))
-			bus_set_iommu(&platform_bus_type, &ipmmu_ops);
-#endif
 	}
 
 	/*
@@ -1168,32 +1163,4 @@ static struct platform_driver ipmmu_driver = {
 	.probe = ipmmu_probe,
 	.remove	= ipmmu_remove,
 };
-
-static int __init ipmmu_init(void)
-{
-	struct device_node *np;
-	static bool setup_done;
-	int ret;
-
-	if (setup_done)
-		return 0;
-
-	np = of_find_matching_node(NULL, ipmmu_of_ids);
-	if (!np)
-		return 0;
-
-	of_node_put(np);
-
-	ret = platform_driver_register(&ipmmu_driver);
-	if (ret < 0)
-		return ret;
-
-#if defined(CONFIG_ARM) && !defined(CONFIG_IOMMU_DMA)
-	if (!iommu_present(&platform_bus_type))
-		bus_set_iommu(&platform_bus_type, &ipmmu_ops);
-#endif
-
-	setup_done = true;
-	return 0;
-}
-subsys_initcall(ipmmu_init);
+builtin_platform_driver(ipmmu_driver);
-- 
2.35.3.dirty

_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

WARNING: multiple messages have this Message-ID (diff)
From: Robin Murphy <robin.murphy@arm.com>
To: joro@8bytes.org, will@kernel.org
Cc: iommu@lists.linux-foundation.org, sven@svenpeter.dev,
	robdclark@gmail.com, m.szyprowski@samsung.com,
	baolu.lu@linux.intel.com, yong.wu@mediatek.com,
	mjrosato@linux.ibm.com, gerald.schaefer@linux.ibm.com,
	zhang.lyra@gmail.com, thierry.reding@gmail.com,
	vdumpa@nvidia.com, jean-philippe@linaro.org,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH v2 09/14] iommu/ipmmu-vmsa: Clean up bus_set_iommu()
Date: Thu, 28 Apr 2022 14:18:10 +0100	[thread overview]
Message-ID: <01a58dcc9c70836b7556d54dbdac6a340f206781.1650890638.git.robin.murphy@arm.com> (raw)
In-Reply-To: <cover.1650890638.git.robin.murphy@arm.com>

Stop calling bus_set_iommu() since it's now unnecessary. This also
leaves the custom initcall effectively doing nothing but register
the driver, which no longer needs to happen early either, so convert
it to builtin_platform_driver().

Signed-off-by: Robin Murphy <robin.murphy@arm.com>
---
 drivers/iommu/ipmmu-vmsa.c | 35 +----------------------------------
 1 file changed, 1 insertion(+), 34 deletions(-)

diff --git a/drivers/iommu/ipmmu-vmsa.c b/drivers/iommu/ipmmu-vmsa.c
index 8fdb84b3642b..2549d32f0ddd 100644
--- a/drivers/iommu/ipmmu-vmsa.c
+++ b/drivers/iommu/ipmmu-vmsa.c
@@ -1090,11 +1090,6 @@ static int ipmmu_probe(struct platform_device *pdev)
 		ret = iommu_device_register(&mmu->iommu, &ipmmu_ops, &pdev->dev);
 		if (ret)
 			return ret;
-
-#if defined(CONFIG_IOMMU_DMA)
-		if (!iommu_present(&platform_bus_type))
-			bus_set_iommu(&platform_bus_type, &ipmmu_ops);
-#endif
 	}
 
 	/*
@@ -1168,32 +1163,4 @@ static struct platform_driver ipmmu_driver = {
 	.probe = ipmmu_probe,
 	.remove	= ipmmu_remove,
 };
-
-static int __init ipmmu_init(void)
-{
-	struct device_node *np;
-	static bool setup_done;
-	int ret;
-
-	if (setup_done)
-		return 0;
-
-	np = of_find_matching_node(NULL, ipmmu_of_ids);
-	if (!np)
-		return 0;
-
-	of_node_put(np);
-
-	ret = platform_driver_register(&ipmmu_driver);
-	if (ret < 0)
-		return ret;
-
-#if defined(CONFIG_ARM) && !defined(CONFIG_IOMMU_DMA)
-	if (!iommu_present(&platform_bus_type))
-		bus_set_iommu(&platform_bus_type, &ipmmu_ops);
-#endif
-
-	setup_done = true;
-	return 0;
-}
-subsys_initcall(ipmmu_init);
+builtin_platform_driver(ipmmu_driver);
-- 
2.35.3.dirty


WARNING: multiple messages have this Message-ID (diff)
From: Robin Murphy <robin.murphy@arm.com>
To: joro@8bytes.org, will@kernel.org
Cc: jean-philippe@linaro.org, mjrosato@linux.ibm.com,
	sven@svenpeter.dev, zhang.lyra@gmail.com, robdclark@gmail.com,
	linux-kernel@vger.kernel.org, iommu@lists.linux-foundation.org,
	thierry.reding@gmail.com, linux-arm-kernel@lists.infradead.org,
	gerald.schaefer@linux.ibm.com, baolu.lu@linux.intel.com,
	yong.wu@mediatek.com, m.szyprowski@samsung.com
Subject: [PATCH v2 09/14] iommu/ipmmu-vmsa: Clean up bus_set_iommu()
Date: Thu, 28 Apr 2022 14:18:10 +0100	[thread overview]
Message-ID: <01a58dcc9c70836b7556d54dbdac6a340f206781.1650890638.git.robin.murphy@arm.com> (raw)
In-Reply-To: <cover.1650890638.git.robin.murphy@arm.com>

Stop calling bus_set_iommu() since it's now unnecessary. This also
leaves the custom initcall effectively doing nothing but register
the driver, which no longer needs to happen early either, so convert
it to builtin_platform_driver().

Signed-off-by: Robin Murphy <robin.murphy@arm.com>
---
 drivers/iommu/ipmmu-vmsa.c | 35 +----------------------------------
 1 file changed, 1 insertion(+), 34 deletions(-)

diff --git a/drivers/iommu/ipmmu-vmsa.c b/drivers/iommu/ipmmu-vmsa.c
index 8fdb84b3642b..2549d32f0ddd 100644
--- a/drivers/iommu/ipmmu-vmsa.c
+++ b/drivers/iommu/ipmmu-vmsa.c
@@ -1090,11 +1090,6 @@ static int ipmmu_probe(struct platform_device *pdev)
 		ret = iommu_device_register(&mmu->iommu, &ipmmu_ops, &pdev->dev);
 		if (ret)
 			return ret;
-
-#if defined(CONFIG_IOMMU_DMA)
-		if (!iommu_present(&platform_bus_type))
-			bus_set_iommu(&platform_bus_type, &ipmmu_ops);
-#endif
 	}
 
 	/*
@@ -1168,32 +1163,4 @@ static struct platform_driver ipmmu_driver = {
 	.probe = ipmmu_probe,
 	.remove	= ipmmu_remove,
 };
-
-static int __init ipmmu_init(void)
-{
-	struct device_node *np;
-	static bool setup_done;
-	int ret;
-
-	if (setup_done)
-		return 0;
-
-	np = of_find_matching_node(NULL, ipmmu_of_ids);
-	if (!np)
-		return 0;
-
-	of_node_put(np);
-
-	ret = platform_driver_register(&ipmmu_driver);
-	if (ret < 0)
-		return ret;
-
-#if defined(CONFIG_ARM) && !defined(CONFIG_IOMMU_DMA)
-	if (!iommu_present(&platform_bus_type))
-		bus_set_iommu(&platform_bus_type, &ipmmu_ops);
-#endif
-
-	setup_done = true;
-	return 0;
-}
-subsys_initcall(ipmmu_init);
+builtin_platform_driver(ipmmu_driver);
-- 
2.35.3.dirty


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  parent reply	other threads:[~2022-04-28 13:18 UTC|newest]

Thread overview: 69+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-28 13:18 [PATCH v2 00/14] iommu: Retire bus_set_iommu() Robin Murphy
2022-04-28 13:18 ` Robin Murphy
2022-04-28 13:18 ` Robin Murphy
2022-04-28 13:18 ` [PATCH v2 01/14] iommu/vt-d: Temporarily reject probing non-PCI devices Robin Murphy
2022-04-28 13:18   ` Robin Murphy
2022-04-28 13:18   ` Robin Murphy
2022-04-28 13:18 ` [PATCH v2 02/14] iommu: Always register bus notifiers Robin Murphy
2022-04-28 13:18   ` Robin Murphy
2022-04-28 13:18   ` Robin Murphy
2022-04-28 13:18 ` [PATCH v2 03/14] iommu: Move bus setup to IOMMU device registration Robin Murphy
2022-04-28 13:18   ` Robin Murphy
2022-04-28 13:18   ` Robin Murphy
2022-04-29  6:57   ` Baolu Lu
2022-04-29  6:57     ` Baolu Lu
2022-04-29  6:57     ` Baolu Lu
2022-04-29  8:50     ` Robin Murphy
2022-04-29  8:50       ` Robin Murphy
2022-04-29  8:50       ` Robin Murphy
2022-04-29 18:06       ` Robin Murphy
2022-04-29 18:06         ` Robin Murphy
2022-04-29 18:06         ` Robin Murphy
2022-07-05  4:51         ` Baolu Lu
2022-07-05  4:51           ` Baolu Lu
2022-07-05  4:51           ` Baolu Lu
2022-07-05  9:06           ` Robin Murphy
2022-07-05  9:06             ` Robin Murphy
2022-07-05  9:06             ` Robin Murphy
2022-04-28 13:18 ` [PATCH v2 04/14] iommu/amd: Clean up bus_set_iommu() Robin Murphy
2022-04-28 13:18   ` Robin Murphy
2022-04-28 13:18   ` Robin Murphy
2022-04-28 13:18 ` [PATCH v2 05/14] iommu/arm-smmu: " Robin Murphy
2022-04-28 13:18   ` Robin Murphy
2022-04-28 13:18   ` Robin Murphy
2022-04-28 13:18 ` [PATCH v2 06/14] iommu/arm-smmu-v3: " Robin Murphy
2022-04-28 13:18   ` Robin Murphy
2022-04-28 13:18   ` Robin Murphy
2022-04-28 13:18 ` [PATCH v2 07/14] iommu/dart: " Robin Murphy
2022-04-28 13:18   ` Robin Murphy
2022-04-28 13:18   ` Robin Murphy
2022-04-28 13:18 ` [PATCH v2 08/14] iommu/exynos: " Robin Murphy
2022-04-28 13:18   ` Robin Murphy
2022-04-28 13:18   ` Robin Murphy
2022-04-28 13:18 ` Robin Murphy [this message]
2022-04-28 13:18   ` [PATCH v2 09/14] iommu/ipmmu-vmsa: " Robin Murphy
2022-04-28 13:18   ` Robin Murphy
2022-07-06  8:38   ` Alexey Kardashevskiy
2022-07-06  8:38     ` Alexey Kardashevskiy
2022-07-06  8:38     ` Alexey Kardashevskiy
2022-07-06 10:54     ` Robin Murphy
2022-07-06 10:54       ` Robin Murphy
2022-07-06 10:54       ` Robin Murphy
2022-04-28 13:18 ` [PATCH v2 10/14] iommu/mtk: " Robin Murphy
2022-04-28 13:18   ` Robin Murphy
2022-04-28 13:18   ` Robin Murphy
2022-04-28 13:18 ` [PATCH v2 11/14] iommu/omap: " Robin Murphy
2022-04-28 13:18   ` Robin Murphy
2022-04-28 13:18   ` Robin Murphy
2022-04-28 13:18 ` [PATCH v2 12/14] iommu/tegra-smmu: " Robin Murphy
2022-04-28 13:18   ` Robin Murphy
2022-04-28 13:18   ` Robin Murphy
2022-04-28 13:18 ` [PATCH v2 13/14] iommu/virtio: " Robin Murphy
2022-04-28 13:18   ` Robin Murphy
2022-04-28 13:18   ` Robin Murphy
2022-04-28 13:18 ` [PATCH v2 14/14] iommu: " Robin Murphy
2022-04-28 13:18   ` Robin Murphy
2022-04-28 13:18   ` Robin Murphy
2022-04-28 14:16 ` [PATCH v2 00/14] iommu: Retire bus_set_iommu() Robin Murphy
2022-04-28 14:16   ` Robin Murphy
2022-04-28 14:16   ` Robin Murphy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=01a58dcc9c70836b7556d54dbdac6a340f206781.1650890638.git.robin.murphy@arm.com \
    --to=robin.murphy@arm.com \
    --cc=gerald.schaefer@linux.ibm.com \
    --cc=iommu@lists.linux-foundation.org \
    --cc=jean-philippe@linaro.org \
    --cc=joro@8bytes.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=thierry.reding@gmail.com \
    --cc=will@kernel.org \
    --cc=zhang.lyra@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.