All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/9] iommu: clean up/remove modular stuff from non-modules.
@ 2018-11-26 22:31 ` Paul Gortmaker
  0 siblings, 0 replies; 52+ messages in thread
From: Paul Gortmaker @ 2018-11-26 22:31 UTC (permalink / raw)
  To: Joerg Roedel
  Cc: Heiko Stuebner, Will Deacon, Daniel Kurtz, Paul Gortmaker,
	Thierry Reding, Laurent Pinchart, Alexandre Courbot, Simon Xue,
	Rob Clark, linux-rockchip, linux-tegra, Stephen Warren,
	linux-arm-msm, Jeffy Chen, linux-mediatek, Stepan Moskovchenko,
	Honghui Zhang, Matthias Brugger, linux-arm-kernel, linux-kernel,
	iommu, Robin Murphy, Nate Watterson, Hi

The work here represents a scan over the iommu dir, looking for files/drivers
that have nothing to do with a modular use case, but are using modular
infrastructure regardless.

We are trying to make driver code consistent with the Makefiles/Kconfigs that
control them.  This means not using modular functions/macros for drivers that
can never be built as a module.  I've done this in other subsystem dirs
already, and some of this has already happened in drivers/iommu by others;
such as 98b72b94def9 ("iommu/rockchip: Prohibit unbind and remove").

Using modular infrastructure in non-modules might seem harmless, but some
of the downfalls this leads to are:

 (1) it is easy to accidentally write unused module_exit and remove code
 (2) it can be misleading when reading the source, thinking it can be
     modular when the Makefile and/or Kconfig prohibit it
 (3) it requires the include of the module.h header file which in turn
     includes nearly everything else, thus adding to CPP overhead.
 (4) it gets copied/replicated into other drivers and spreads quickly.

The last two commits (arm-smmu related ones) deserve an extra mention,
and I put them at the end in case they want to be deferred for later or
altered.  Normally a "module-ectomy" allows us to delete the ".remove"
function, as per the rockchip commit above, but ...

A kexec commit (7aa8619a66ae) tried to improve reliability by trying to
shutdown the iommu in the compromised/crashing kernel, but of course the
better solution is to have the recovery kernel be able to handle all of
the possible initial conditions.  It appears this was done later in the
commit b63b3439b856 - but I don't know if that means relying on an
orderly shutdown is no longer required - I don't have the platform and
am only going on what is in git history.

So, as the kexec commit recycled the ".remove" handle to also be the
".shutdown" handle, in this series the remove function was renamed to
shutdown, and the ".remove" handle was deleted.  This was IMHO the most
back compatible way to make this update.  If the reliance on the
compromised kernel to run ".shutdown" is no longer necessary, then it
can be removed in a future change.

Patches were build tested on top of next-20181122 for ARM, ARM64, x86-64
on an allyesconfig.

Paul.

---

Cc: Alexandre Courbot <gnurou@gmail.com>
Cc: Daniel Kurtz <djkurtz@chromium.org>
Cc: Heiko Stuebner <heiko@sntech.de>
Cc: Hiroshi Doyu <hdoyu@nvidia.com>
Cc: Honghui Zhang <honghui.zhang@mediatek.com>
Cc: Jeffy Chen <jeffy.chen@rock-chips.com>
Cc: Joerg Roedel <joro@8bytes.org>
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: Matthias Brugger <matthias.bgg@gmail.com>
Cc: Nate Watterson <nwatters@codeaurora.org>
Cc: Rob Clark <robdclark@gmail.com>
Cc: Robin Murphy <robin.murphy@arm.com>
Cc: Simon Xue <xxm@rock-chips.com>
Cc: Stepan Moskovchenko <stepanm@codeaurora.org>
Cc: Stephen Warren <swarren@wwwdotorg.org>
Cc: Thierry Reding <thierry.reding@gmail.com>
Cc: Will Deacon <will.deacon@arm.com>
Cc: iommu@lists.linux-foundation.org
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-arm-msm@vger.kernel.org
Cc: linux-mediatek@lists.infradead.org
Cc: linux-rockchip@lists.infradead.org
Cc: linux-tegra@vger.kernel.org

Paul Gortmaker (9):
  iommu: audit and remove any unnecessary uses of module.h
  iommu: rockchip: make it explicitly non-modular
  iommu: msm_iommu: make it explicitly non-modular
  iommu: mtk_iommu: make it explicitly non-modular
  iommu: ipmmu-vmsa: make it explicitly non-modular
  iommu: qcom_iommu: make it explicitly non-modular
  iommu: tegra-gart: make it explicitly non-modular
  iommu: arm-smmu: make it explicitly non-modular
  iommu: arm-smmu-v3: make it explicitly non-modular

 drivers/iommu/arm-smmu-v3.c    | 25 +++++++++----------------
 drivers/iommu/arm-smmu.c       | 32 +++++++++++++-------------------
 drivers/iommu/iommu-sysfs.c    |  2 +-
 drivers/iommu/iommu.c          |  3 ++-
 drivers/iommu/ipmmu-vmsa.c     | 16 +++-------------
 drivers/iommu/msm_iommu.c      | 13 +++----------
 drivers/iommu/mtk_iommu_v1.c   | 15 +++------------
 drivers/iommu/qcom_iommu.c     | 16 ++--------------
 drivers/iommu/rockchip-iommu.c | 13 ++++++-------
 drivers/iommu/tegra-gart.c     | 37 +++++++------------------------------
 10 files changed, 49 insertions(+), 123 deletions(-)

-- 
2.7.4

^ permalink raw reply	[flat|nested] 52+ messages in thread

* [PATCH 0/9] iommu: clean up/remove modular stuff from non-modules.
@ 2018-11-26 22:31 ` Paul Gortmaker
  0 siblings, 0 replies; 52+ messages in thread
From: Paul Gortmaker @ 2018-11-26 22:31 UTC (permalink / raw)
  To: Joerg Roedel
  Cc: iommu, linux-kernel, Paul Gortmaker, Alexandre Courbot,
	Daniel Kurtz, Heiko Stuebner, Hiroshi Doyu, Honghui Zhang,
	Jeffy Chen, Laurent Pinchart, Matthias Brugger, Nate Watterson,
	Rob Clark, Robin Murphy, Simon Xue, Stepan Moskovchenko,
	Stephen Warren, Thierry Reding, Will Deacon, linux-arm-kernel,
	linux-arm-msm, linux-mediatek, linux-rockchip, linux-tegra

The work here represents a scan over the iommu dir, looking for files/drivers
that have nothing to do with a modular use case, but are using modular
infrastructure regardless.

We are trying to make driver code consistent with the Makefiles/Kconfigs that
control them.  This means not using modular functions/macros for drivers that
can never be built as a module.  I've done this in other subsystem dirs
already, and some of this has already happened in drivers/iommu by others;
such as 98b72b94def9 ("iommu/rockchip: Prohibit unbind and remove").

Using modular infrastructure in non-modules might seem harmless, but some
of the downfalls this leads to are:

 (1) it is easy to accidentally write unused module_exit and remove code
 (2) it can be misleading when reading the source, thinking it can be
     modular when the Makefile and/or Kconfig prohibit it
 (3) it requires the include of the module.h header file which in turn
     includes nearly everything else, thus adding to CPP overhead.
 (4) it gets copied/replicated into other drivers and spreads quickly.

The last two commits (arm-smmu related ones) deserve an extra mention,
and I put them at the end in case they want to be deferred for later or
altered.  Normally a "module-ectomy" allows us to delete the ".remove"
function, as per the rockchip commit above, but ...

A kexec commit (7aa8619a66ae) tried to improve reliability by trying to
shutdown the iommu in the compromised/crashing kernel, but of course the
better solution is to have the recovery kernel be able to handle all of
the possible initial conditions.  It appears this was done later in the
commit b63b3439b856 - but I don't know if that means relying on an
orderly shutdown is no longer required - I don't have the platform and
am only going on what is in git history.

So, as the kexec commit recycled the ".remove" handle to also be the
".shutdown" handle, in this series the remove function was renamed to
shutdown, and the ".remove" handle was deleted.  This was IMHO the most
back compatible way to make this update.  If the reliance on the
compromised kernel to run ".shutdown" is no longer necessary, then it
can be removed in a future change.

Patches were build tested on top of next-20181122 for ARM, ARM64, x86-64
on an allyesconfig.

Paul.

---

Cc: Alexandre Courbot <gnurou@gmail.com>
Cc: Daniel Kurtz <djkurtz@chromium.org>
Cc: Heiko Stuebner <heiko@sntech.de>
Cc: Hiroshi Doyu <hdoyu@nvidia.com>
Cc: Honghui Zhang <honghui.zhang@mediatek.com>
Cc: Jeffy Chen <jeffy.chen@rock-chips.com>
Cc: Joerg Roedel <joro@8bytes.org>
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: Matthias Brugger <matthias.bgg@gmail.com>
Cc: Nate Watterson <nwatters@codeaurora.org>
Cc: Rob Clark <robdclark@gmail.com>
Cc: Robin Murphy <robin.murphy@arm.com>
Cc: Simon Xue <xxm@rock-chips.com>
Cc: Stepan Moskovchenko <stepanm@codeaurora.org>
Cc: Stephen Warren <swarren@wwwdotorg.org>
Cc: Thierry Reding <thierry.reding@gmail.com>
Cc: Will Deacon <will.deacon@arm.com>
Cc: iommu@lists.linux-foundation.org
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-arm-msm@vger.kernel.org
Cc: linux-mediatek@lists.infradead.org
Cc: linux-rockchip@lists.infradead.org
Cc: linux-tegra@vger.kernel.org

Paul Gortmaker (9):
  iommu: audit and remove any unnecessary uses of module.h
  iommu: rockchip: make it explicitly non-modular
  iommu: msm_iommu: make it explicitly non-modular
  iommu: mtk_iommu: make it explicitly non-modular
  iommu: ipmmu-vmsa: make it explicitly non-modular
  iommu: qcom_iommu: make it explicitly non-modular
  iommu: tegra-gart: make it explicitly non-modular
  iommu: arm-smmu: make it explicitly non-modular
  iommu: arm-smmu-v3: make it explicitly non-modular

 drivers/iommu/arm-smmu-v3.c    | 25 +++++++++----------------
 drivers/iommu/arm-smmu.c       | 32 +++++++++++++-------------------
 drivers/iommu/iommu-sysfs.c    |  2 +-
 drivers/iommu/iommu.c          |  3 ++-
 drivers/iommu/ipmmu-vmsa.c     | 16 +++-------------
 drivers/iommu/msm_iommu.c      | 13 +++----------
 drivers/iommu/mtk_iommu_v1.c   | 15 +++------------
 drivers/iommu/qcom_iommu.c     | 16 ++--------------
 drivers/iommu/rockchip-iommu.c | 13 ++++++-------
 drivers/iommu/tegra-gart.c     | 37 +++++++------------------------------
 10 files changed, 49 insertions(+), 123 deletions(-)

-- 
2.7.4


^ permalink raw reply	[flat|nested] 52+ messages in thread

* [PATCH 0/9] iommu: clean up/remove modular stuff from non-modules.
@ 2018-11-26 22:31 ` Paul Gortmaker
  0 siblings, 0 replies; 52+ messages in thread
From: Paul Gortmaker @ 2018-11-26 22:31 UTC (permalink / raw)
  To: linux-arm-kernel

The work here represents a scan over the iommu dir, looking for files/drivers
that have nothing to do with a modular use case, but are using modular
infrastructure regardless.

We are trying to make driver code consistent with the Makefiles/Kconfigs that
control them.  This means not using modular functions/macros for drivers that
can never be built as a module.  I've done this in other subsystem dirs
already, and some of this has already happened in drivers/iommu by others;
such as 98b72b94def9 ("iommu/rockchip: Prohibit unbind and remove").

Using modular infrastructure in non-modules might seem harmless, but some
of the downfalls this leads to are:

 (1) it is easy to accidentally write unused module_exit and remove code
 (2) it can be misleading when reading the source, thinking it can be
     modular when the Makefile and/or Kconfig prohibit it
 (3) it requires the include of the module.h header file which in turn
     includes nearly everything else, thus adding to CPP overhead.
 (4) it gets copied/replicated into other drivers and spreads quickly.

The last two commits (arm-smmu related ones) deserve an extra mention,
and I put them at the end in case they want to be deferred for later or
altered.  Normally a "module-ectomy" allows us to delete the ".remove"
function, as per the rockchip commit above, but ...

A kexec commit (7aa8619a66ae) tried to improve reliability by trying to
shutdown the iommu in the compromised/crashing kernel, but of course the
better solution is to have the recovery kernel be able to handle all of
the possible initial conditions.  It appears this was done later in the
commit b63b3439b856 - but I don't know if that means relying on an
orderly shutdown is no longer required - I don't have the platform and
am only going on what is in git history.

So, as the kexec commit recycled the ".remove" handle to also be the
".shutdown" handle, in this series the remove function was renamed to
shutdown, and the ".remove" handle was deleted.  This was IMHO the most
back compatible way to make this update.  If the reliance on the
compromised kernel to run ".shutdown" is no longer necessary, then it
can be removed in a future change.

Patches were build tested on top of next-20181122 for ARM, ARM64, x86-64
on an allyesconfig.

Paul.

---

Cc: Alexandre Courbot <gnurou@gmail.com>
Cc: Daniel Kurtz <djkurtz@chromium.org>
Cc: Heiko Stuebner <heiko@sntech.de>
Cc: Hiroshi Doyu <hdoyu@nvidia.com>
Cc: Honghui Zhang <honghui.zhang@mediatek.com>
Cc: Jeffy Chen <jeffy.chen@rock-chips.com>
Cc: Joerg Roedel <joro@8bytes.org>
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: Matthias Brugger <matthias.bgg@gmail.com>
Cc: Nate Watterson <nwatters@codeaurora.org>
Cc: Rob Clark <robdclark@gmail.com>
Cc: Robin Murphy <robin.murphy@arm.com>
Cc: Simon Xue <xxm@rock-chips.com>
Cc: Stepan Moskovchenko <stepanm@codeaurora.org>
Cc: Stephen Warren <swarren@wwwdotorg.org>
Cc: Thierry Reding <thierry.reding@gmail.com>
Cc: Will Deacon <will.deacon@arm.com>
Cc: iommu at lists.linux-foundation.org
Cc: linux-arm-kernel at lists.infradead.org
Cc: linux-arm-msm at vger.kernel.org
Cc: linux-mediatek at lists.infradead.org
Cc: linux-rockchip at lists.infradead.org
Cc: linux-tegra at vger.kernel.org

Paul Gortmaker (9):
  iommu: audit and remove any unnecessary uses of module.h
  iommu: rockchip: make it explicitly non-modular
  iommu: msm_iommu: make it explicitly non-modular
  iommu: mtk_iommu: make it explicitly non-modular
  iommu: ipmmu-vmsa: make it explicitly non-modular
  iommu: qcom_iommu: make it explicitly non-modular
  iommu: tegra-gart: make it explicitly non-modular
  iommu: arm-smmu: make it explicitly non-modular
  iommu: arm-smmu-v3: make it explicitly non-modular

 drivers/iommu/arm-smmu-v3.c    | 25 +++++++++----------------
 drivers/iommu/arm-smmu.c       | 32 +++++++++++++-------------------
 drivers/iommu/iommu-sysfs.c    |  2 +-
 drivers/iommu/iommu.c          |  3 ++-
 drivers/iommu/ipmmu-vmsa.c     | 16 +++-------------
 drivers/iommu/msm_iommu.c      | 13 +++----------
 drivers/iommu/mtk_iommu_v1.c   | 15 +++------------
 drivers/iommu/qcom_iommu.c     | 16 ++--------------
 drivers/iommu/rockchip-iommu.c | 13 ++++++-------
 drivers/iommu/tegra-gart.c     | 37 +++++++------------------------------
 10 files changed, 49 insertions(+), 123 deletions(-)

-- 
2.7.4

^ permalink raw reply	[flat|nested] 52+ messages in thread

* [PATCH 1/9] iommu: audit and remove any unnecessary uses of module.h
       [not found] ` <1543271498-28966-1-git-send-email-paul.gortmaker-CWA4WttNNZF54TAoqtyWWQ@public.gmane.org>
@ 2018-11-26 22:31   ` Paul Gortmaker
  2018-11-26 22:31     ` Paul Gortmaker
  1 sibling, 0 replies; 52+ messages in thread
From: Paul Gortmaker @ 2018-11-26 22:31 UTC (permalink / raw)
  To: Joerg Roedel; +Cc: iommu, linux-kernel, Paul Gortmaker

Historically a lot of these existed because we did not have
a distinction between what was modular code and what was providing
support to modules via EXPORT_SYMBOL and friends.  That changed
when we forked out support for the latter into the export.h file.
This means we should be able to reduce the usage of module.h
in code that is obj-y Makefile or bool Kconfig.

The advantage in removing such instances is that module.h itself
sources about 15 other headers; adding significantly to what we feed
cpp, and it can obscure what headers we are effectively using.

Since module.h might have been the implicit source for init.h
(for __init) and for export.h (for EXPORT_SYMBOL) we consider each
instance for the presence of either and replace as needed.

Cc: Joerg Roedel <joro@8bytes.org>
Cc: iommu@lists.linux-foundation.org
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
 drivers/iommu/iommu-sysfs.c | 2 +-
 drivers/iommu/iommu.c       | 3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/iommu/iommu-sysfs.c b/drivers/iommu/iommu-sysfs.c
index 36d1a7ce7fc4..c298330ba2b7 100644
--- a/drivers/iommu/iommu-sysfs.c
+++ b/drivers/iommu/iommu-sysfs.c
@@ -11,7 +11,7 @@
 
 #include <linux/device.h>
 #include <linux/iommu.h>
-#include <linux/module.h>
+#include <linux/init.h>
 #include <linux/slab.h>
 
 /*
diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c
index f8ec49e0f6c6..cc25ec6d4c06 100644
--- a/drivers/iommu/iommu.c
+++ b/drivers/iommu/iommu.c
@@ -22,7 +22,8 @@
 #include <linux/kernel.h>
 #include <linux/bug.h>
 #include <linux/types.h>
-#include <linux/module.h>
+#include <linux/init.h>
+#include <linux/export.h>
 #include <linux/slab.h>
 #include <linux/errno.h>
 #include <linux/iommu.h>
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 52+ messages in thread

* [PATCH 1/9] iommu: audit and remove any unnecessary uses of module.h
@ 2018-11-26 22:31   ` Paul Gortmaker
  0 siblings, 0 replies; 52+ messages in thread
From: Paul Gortmaker @ 2018-11-26 22:31 UTC (permalink / raw)
  To: Joerg Roedel
  Cc: Paul Gortmaker,
	iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA

Historically a lot of these existed because we did not have
a distinction between what was modular code and what was providing
support to modules via EXPORT_SYMBOL and friends.  That changed
when we forked out support for the latter into the export.h file.
This means we should be able to reduce the usage of module.h
in code that is obj-y Makefile or bool Kconfig.

The advantage in removing such instances is that module.h itself
sources about 15 other headers; adding significantly to what we feed
cpp, and it can obscure what headers we are effectively using.

Since module.h might have been the implicit source for init.h
(for __init) and for export.h (for EXPORT_SYMBOL) we consider each
instance for the presence of either and replace as needed.

Cc: Joerg Roedel <joro-zLv9SwRftAIdnm+yROfE0A@public.gmane.org>
Cc: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org
Signed-off-by: Paul Gortmaker <paul.gortmaker-CWA4WttNNZF54TAoqtyWWQ@public.gmane.org>
---
 drivers/iommu/iommu-sysfs.c | 2 +-
 drivers/iommu/iommu.c       | 3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/iommu/iommu-sysfs.c b/drivers/iommu/iommu-sysfs.c
index 36d1a7ce7fc4..c298330ba2b7 100644
--- a/drivers/iommu/iommu-sysfs.c
+++ b/drivers/iommu/iommu-sysfs.c
@@ -11,7 +11,7 @@
 
 #include <linux/device.h>
 #include <linux/iommu.h>
-#include <linux/module.h>
+#include <linux/init.h>
 #include <linux/slab.h>
 
 /*
diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c
index f8ec49e0f6c6..cc25ec6d4c06 100644
--- a/drivers/iommu/iommu.c
+++ b/drivers/iommu/iommu.c
@@ -22,7 +22,8 @@
 #include <linux/kernel.h>
 #include <linux/bug.h>
 #include <linux/types.h>
-#include <linux/module.h>
+#include <linux/init.h>
+#include <linux/export.h>
 #include <linux/slab.h>
 #include <linux/errno.h>
 #include <linux/iommu.h>
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 52+ messages in thread

* [PATCH 2/9] iommu: rockchip: make it explicitly non-modular
  2018-11-26 22:31 ` Paul Gortmaker
  (?)
@ 2018-11-26 22:31   ` Paul Gortmaker
  -1 siblings, 0 replies; 52+ messages in thread
From: Paul Gortmaker @ 2018-11-26 22:31 UTC (permalink / raw)
  To: Joerg Roedel
  Cc: iommu, linux-kernel, Paul Gortmaker, Heiko Stuebner, Simon Xue,
	Daniel Kurtz, Jeffy Chen, linux-arm-kernel, linux-rockchip

The Kconfig currently controlling compilation of this code is:

drivers/iommu/Kconfig:config ROCKCHIP_IOMMU
drivers/iommu/Kconfig:  bool "Rockchip IOMMU Support"

...meaning that it currently is not being built as a module by anyone.

The bind/unbind/remove was already explicitly disabled in commit
98b72b94def9 ("iommu/rockchip: Prohibit unbind and remove").

Lets remove the remaining traces of  modular infrastructure, so that
when reading the driver there is no doubt it is builtin-only.

Since module_init was not in use by this code, the init ordering
remains unchanged with this commit.

Also note that MODULE_DEVICE_TABLE is a no-op for non-modular code.

We also delete the MODULE_LICENSE tag etc. since all that information
was (or is now) contained at the top of the file in the comments.

Cc: Joerg Roedel <joro@8bytes.org>
Cc: Heiko Stuebner <heiko@sntech.de>
Cc: Simon Xue <xxm@rock-chips.com>
Cc: Daniel Kurtz <djkurtz@chromium.org>
Cc: Jeffy Chen <jeffy.chen@rock-chips.com>
Cc: iommu@lists.linux-foundation.org
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-rockchip@lists.infradead.org
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
 drivers/iommu/rockchip-iommu.c | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/drivers/iommu/rockchip-iommu.c b/drivers/iommu/rockchip-iommu.c
index ad3e2b97469e..c9ba9f377f63 100644
--- a/drivers/iommu/rockchip-iommu.c
+++ b/drivers/iommu/rockchip-iommu.c
@@ -1,4 +1,9 @@
 /*
+ * IOMMU API for Rockchip
+ *
+ * Module Authors:	Simon Xue <xxm@rock-chips.com>
+ *			Daniel Kurtz <djkurtz@chromium.org>
+ *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 as
  * published by the Free Software Foundation.
@@ -17,7 +22,7 @@
 #include <linux/iopoll.h>
 #include <linux/list.h>
 #include <linux/mm.h>
-#include <linux/module.h>
+#include <linux/init.h>
 #include <linux/of.h>
 #include <linux/of_iommu.h>
 #include <linux/of_platform.h>
@@ -1281,7 +1286,6 @@ static const struct of_device_id rk_iommu_dt_ids[] = {
 	{ .compatible = "rockchip,iommu" },
 	{ /* sentinel */ }
 };
-MODULE_DEVICE_TABLE(of, rk_iommu_dt_ids);
 
 static struct platform_driver rk_iommu_driver = {
 	.probe = rk_iommu_probe,
@@ -1299,8 +1303,3 @@ static int __init rk_iommu_init(void)
 	return platform_driver_register(&rk_iommu_driver);
 }
 subsys_initcall(rk_iommu_init);
-
-MODULE_DESCRIPTION("IOMMU API for Rockchip");
-MODULE_AUTHOR("Simon Xue <xxm@rock-chips.com> and Daniel Kurtz <djkurtz@chromium.org>");
-MODULE_ALIAS("platform:rockchip-iommu");
-MODULE_LICENSE("GPL v2");
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 52+ messages in thread

* [PATCH 2/9] iommu: rockchip: make it explicitly non-modular
@ 2018-11-26 22:31   ` Paul Gortmaker
  0 siblings, 0 replies; 52+ messages in thread
From: Paul Gortmaker @ 2018-11-26 22:31 UTC (permalink / raw)
  To: Joerg Roedel
  Cc: Simon Xue, linux-rockchip, Jeffy Chen, linux-kernel,
	Daniel Kurtz, Paul Gortmaker, iommu, linux-arm-kernel,
	Heiko Stuebner

The Kconfig currently controlling compilation of this code is:

drivers/iommu/Kconfig:config ROCKCHIP_IOMMU
drivers/iommu/Kconfig:  bool "Rockchip IOMMU Support"

...meaning that it currently is not being built as a module by anyone.

The bind/unbind/remove was already explicitly disabled in commit
98b72b94def9 ("iommu/rockchip: Prohibit unbind and remove").

Lets remove the remaining traces of  modular infrastructure, so that
when reading the driver there is no doubt it is builtin-only.

Since module_init was not in use by this code, the init ordering
remains unchanged with this commit.

Also note that MODULE_DEVICE_TABLE is a no-op for non-modular code.

We also delete the MODULE_LICENSE tag etc. since all that information
was (or is now) contained at the top of the file in the comments.

Cc: Joerg Roedel <joro@8bytes.org>
Cc: Heiko Stuebner <heiko@sntech.de>
Cc: Simon Xue <xxm@rock-chips.com>
Cc: Daniel Kurtz <djkurtz@chromium.org>
Cc: Jeffy Chen <jeffy.chen@rock-chips.com>
Cc: iommu@lists.linux-foundation.org
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-rockchip@lists.infradead.org
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
 drivers/iommu/rockchip-iommu.c | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/drivers/iommu/rockchip-iommu.c b/drivers/iommu/rockchip-iommu.c
index ad3e2b97469e..c9ba9f377f63 100644
--- a/drivers/iommu/rockchip-iommu.c
+++ b/drivers/iommu/rockchip-iommu.c
@@ -1,4 +1,9 @@
 /*
+ * IOMMU API for Rockchip
+ *
+ * Module Authors:	Simon Xue <xxm@rock-chips.com>
+ *			Daniel Kurtz <djkurtz@chromium.org>
+ *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 as
  * published by the Free Software Foundation.
@@ -17,7 +22,7 @@
 #include <linux/iopoll.h>
 #include <linux/list.h>
 #include <linux/mm.h>
-#include <linux/module.h>
+#include <linux/init.h>
 #include <linux/of.h>
 #include <linux/of_iommu.h>
 #include <linux/of_platform.h>
@@ -1281,7 +1286,6 @@ static const struct of_device_id rk_iommu_dt_ids[] = {
 	{ .compatible = "rockchip,iommu" },
 	{ /* sentinel */ }
 };
-MODULE_DEVICE_TABLE(of, rk_iommu_dt_ids);
 
 static struct platform_driver rk_iommu_driver = {
 	.probe = rk_iommu_probe,
@@ -1299,8 +1303,3 @@ static int __init rk_iommu_init(void)
 	return platform_driver_register(&rk_iommu_driver);
 }
 subsys_initcall(rk_iommu_init);
-
-MODULE_DESCRIPTION("IOMMU API for Rockchip");
-MODULE_AUTHOR("Simon Xue <xxm@rock-chips.com> and Daniel Kurtz <djkurtz@chromium.org>");
-MODULE_ALIAS("platform:rockchip-iommu");
-MODULE_LICENSE("GPL v2");
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 52+ messages in thread

* [PATCH 2/9] iommu: rockchip: make it explicitly non-modular
@ 2018-11-26 22:31   ` Paul Gortmaker
  0 siblings, 0 replies; 52+ messages in thread
From: Paul Gortmaker @ 2018-11-26 22:31 UTC (permalink / raw)
  To: linux-arm-kernel

The Kconfig currently controlling compilation of this code is:

drivers/iommu/Kconfig:config ROCKCHIP_IOMMU
drivers/iommu/Kconfig:  bool "Rockchip IOMMU Support"

...meaning that it currently is not being built as a module by anyone.

The bind/unbind/remove was already explicitly disabled in commit
98b72b94def9 ("iommu/rockchip: Prohibit unbind and remove").

Lets remove the remaining traces of  modular infrastructure, so that
when reading the driver there is no doubt it is builtin-only.

Since module_init was not in use by this code, the init ordering
remains unchanged with this commit.

Also note that MODULE_DEVICE_TABLE is a no-op for non-modular code.

We also delete the MODULE_LICENSE tag etc. since all that information
was (or is now) contained at the top of the file in the comments.

Cc: Joerg Roedel <joro@8bytes.org>
Cc: Heiko Stuebner <heiko@sntech.de>
Cc: Simon Xue <xxm@rock-chips.com>
Cc: Daniel Kurtz <djkurtz@chromium.org>
Cc: Jeffy Chen <jeffy.chen@rock-chips.com>
Cc: iommu at lists.linux-foundation.org
Cc: linux-arm-kernel at lists.infradead.org
Cc: linux-rockchip at lists.infradead.org
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
 drivers/iommu/rockchip-iommu.c | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/drivers/iommu/rockchip-iommu.c b/drivers/iommu/rockchip-iommu.c
index ad3e2b97469e..c9ba9f377f63 100644
--- a/drivers/iommu/rockchip-iommu.c
+++ b/drivers/iommu/rockchip-iommu.c
@@ -1,4 +1,9 @@
 /*
+ * IOMMU API for Rockchip
+ *
+ * Module Authors:	Simon Xue <xxm@rock-chips.com>
+ *			Daniel Kurtz <djkurtz@chromium.org>
+ *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 as
  * published by the Free Software Foundation.
@@ -17,7 +22,7 @@
 #include <linux/iopoll.h>
 #include <linux/list.h>
 #include <linux/mm.h>
-#include <linux/module.h>
+#include <linux/init.h>
 #include <linux/of.h>
 #include <linux/of_iommu.h>
 #include <linux/of_platform.h>
@@ -1281,7 +1286,6 @@ static const struct of_device_id rk_iommu_dt_ids[] = {
 	{ .compatible = "rockchip,iommu" },
 	{ /* sentinel */ }
 };
-MODULE_DEVICE_TABLE(of, rk_iommu_dt_ids);
 
 static struct platform_driver rk_iommu_driver = {
 	.probe = rk_iommu_probe,
@@ -1299,8 +1303,3 @@ static int __init rk_iommu_init(void)
 	return platform_driver_register(&rk_iommu_driver);
 }
 subsys_initcall(rk_iommu_init);
-
-MODULE_DESCRIPTION("IOMMU API for Rockchip");
-MODULE_AUTHOR("Simon Xue <xxm@rock-chips.com> and Daniel Kurtz <djkurtz@chromium.org>");
-MODULE_ALIAS("platform:rockchip-iommu");
-MODULE_LICENSE("GPL v2");
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 52+ messages in thread

* [PATCH 3/9] iommu: msm_iommu: make it explicitly non-modular
       [not found] ` <1543271498-28966-1-git-send-email-paul.gortmaker-CWA4WttNNZF54TAoqtyWWQ@public.gmane.org>
@ 2018-11-26 22:31   ` Paul Gortmaker
  2018-11-26 22:31     ` Paul Gortmaker
  1 sibling, 0 replies; 52+ messages in thread
From: Paul Gortmaker @ 2018-11-26 22:31 UTC (permalink / raw)
  To: Joerg Roedel; +Cc: iommu, linux-kernel, Paul Gortmaker, Stepan Moskovchenko

The Kconfig currently controlling compilation of this code is:

drivers/iommu/Kconfig:config MSM_IOMMU
drivers/iommu/Kconfig:  bool "MSM IOMMU Support"

...meaning that it currently is not being built as a module by anyone.

Lets remove the modular code that is essentially orphaned, so that
when reading the driver there is no doubt it is builtin-only.

Since module_init was not even used by this driver, the init ordering
remains unchanged with this commit.

We also delete the MODULE_LICENSE tag etc. since all that information
was (or is now) contained at the top of the file in the comments.

Cc: Joerg Roedel <joro@8bytes.org>
Cc: Stepan Moskovchenko <stepanm@codeaurora.org>
Cc: iommu@lists.linux-foundation.org
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
 drivers/iommu/msm_iommu.c | 13 +++----------
 1 file changed, 3 insertions(+), 10 deletions(-)

diff --git a/drivers/iommu/msm_iommu.c b/drivers/iommu/msm_iommu.c
index fc5f0b53adaf..fc4270733f11 100644
--- a/drivers/iommu/msm_iommu.c
+++ b/drivers/iommu/msm_iommu.c
@@ -1,5 +1,7 @@
 /* Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved.
  *
+ * Author: Stepan Moskovchenko <stepanm@codeaurora.org>
+ *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 and
  * only version 2 as published by the Free Software Foundation.
@@ -17,7 +19,7 @@
 
 #define pr_fmt(fmt)	KBUILD_MODNAME ": " fmt
 #include <linux/kernel.h>
-#include <linux/module.h>
+#include <linux/init.h>
 #include <linux/platform_device.h>
 #include <linux/errno.h>
 #include <linux/io.h>
@@ -861,14 +863,5 @@ static int __init msm_iommu_driver_init(void)
 
 	return ret;
 }
-
-static void __exit msm_iommu_driver_exit(void)
-{
-	platform_driver_unregister(&msm_iommu_driver);
-}
-
 subsys_initcall(msm_iommu_driver_init);
-module_exit(msm_iommu_driver_exit);
 
-MODULE_LICENSE("GPL v2");
-MODULE_AUTHOR("Stepan Moskovchenko <stepanm@codeaurora.org>");
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 52+ messages in thread

* [PATCH 3/9] iommu: msm_iommu: make it explicitly non-modular
@ 2018-11-26 22:31   ` Paul Gortmaker
  0 siblings, 0 replies; 52+ messages in thread
From: Paul Gortmaker @ 2018-11-26 22:31 UTC (permalink / raw)
  To: Joerg Roedel
  Cc: Paul Gortmaker,
	iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA, Stepan Moskovchenko

The Kconfig currently controlling compilation of this code is:

drivers/iommu/Kconfig:config MSM_IOMMU
drivers/iommu/Kconfig:  bool "MSM IOMMU Support"

...meaning that it currently is not being built as a module by anyone.

Lets remove the modular code that is essentially orphaned, so that
when reading the driver there is no doubt it is builtin-only.

Since module_init was not even used by this driver, the init ordering
remains unchanged with this commit.

We also delete the MODULE_LICENSE tag etc. since all that information
was (or is now) contained at the top of the file in the comments.

Cc: Joerg Roedel <joro-zLv9SwRftAIdnm+yROfE0A@public.gmane.org>
Cc: Stepan Moskovchenko <stepanm-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
Cc: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org
Signed-off-by: Paul Gortmaker <paul.gortmaker-CWA4WttNNZF54TAoqtyWWQ@public.gmane.org>
---
 drivers/iommu/msm_iommu.c | 13 +++----------
 1 file changed, 3 insertions(+), 10 deletions(-)

diff --git a/drivers/iommu/msm_iommu.c b/drivers/iommu/msm_iommu.c
index fc5f0b53adaf..fc4270733f11 100644
--- a/drivers/iommu/msm_iommu.c
+++ b/drivers/iommu/msm_iommu.c
@@ -1,5 +1,7 @@
 /* Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved.
  *
+ * Author: Stepan Moskovchenko <stepanm-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
+ *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 and
  * only version 2 as published by the Free Software Foundation.
@@ -17,7 +19,7 @@
 
 #define pr_fmt(fmt)	KBUILD_MODNAME ": " fmt
 #include <linux/kernel.h>
-#include <linux/module.h>
+#include <linux/init.h>
 #include <linux/platform_device.h>
 #include <linux/errno.h>
 #include <linux/io.h>
@@ -861,14 +863,5 @@ static int __init msm_iommu_driver_init(void)
 
 	return ret;
 }
-
-static void __exit msm_iommu_driver_exit(void)
-{
-	platform_driver_unregister(&msm_iommu_driver);
-}
-
 subsys_initcall(msm_iommu_driver_init);
-module_exit(msm_iommu_driver_exit);
 
-MODULE_LICENSE("GPL v2");
-MODULE_AUTHOR("Stepan Moskovchenko <stepanm-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>");
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 52+ messages in thread

* [PATCH 4/9] iommu: mtk_iommu: make it explicitly non-modular
       [not found] ` <1543271498-28966-1-git-send-email-paul.gortmaker-CWA4WttNNZF54TAoqtyWWQ@public.gmane.org>
@ 2018-11-26 22:31   ` Paul Gortmaker
  2018-11-26 22:31     ` Paul Gortmaker
  1 sibling, 0 replies; 52+ messages in thread
From: Paul Gortmaker @ 2018-11-26 22:31 UTC (permalink / raw)
  To: Joerg Roedel
  Cc: iommu, linux-kernel, Paul Gortmaker, Matthias Brugger,
	Honghui Zhang, linux-mediatek

The Kconfig currently controlling compilation of this code is:

drivers/iommu/Kconfig:config MTK_IOMMU_V1
drivers/iommu/Kconfig:  bool "MTK IOMMU Version 1 (M4U gen1) Support"

...meaning that it currently is not being built as a module by anyone.

Lets remove the modular code that is essentially orphaned, so that
when reading the driver there is no doubt it is builtin-only.

Since module_init was not even used by this driver, the init ordering
remains unchanged with this commit.

We also delete the MODULE_LICENSE tag etc. since all that information
was (or is now) contained at the top of the file in the comments.

Cc: Joerg Roedel <joro@8bytes.org>
Cc: Matthias Brugger <matthias.bgg@gmail.com>
Cc: Honghui Zhang <honghui.zhang@mediatek.com>
Cc: iommu@lists.linux-foundation.org
Cc: linux-mediatek@lists.infradead.org
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
 drivers/iommu/mtk_iommu_v1.c | 15 +++------------
 1 file changed, 3 insertions(+), 12 deletions(-)

diff --git a/drivers/iommu/mtk_iommu_v1.c b/drivers/iommu/mtk_iommu_v1.c
index 27867b862d7a..5fbf3cecb87f 100644
--- a/drivers/iommu/mtk_iommu_v1.c
+++ b/drivers/iommu/mtk_iommu_v1.c
@@ -1,4 +1,6 @@
 /*
+ * IOMMU API for MTK architected m4u v1 implementations
+ *
  * Copyright (c) 2015-2016 MediaTek Inc.
  * Author: Honghui Zhang <honghui.zhang@mediatek.com>
  *
@@ -35,7 +37,7 @@
 #include <linux/spinlock.h>
 #include <asm/barrier.h>
 #include <asm/dma-iommu.h>
-#include <linux/module.h>
+#include <linux/init.h>
 #include <dt-bindings/memory/mt2701-larb-port.h>
 #include <soc/mediatek/smi.h>
 #include "mtk_iommu.h"
@@ -704,15 +706,4 @@ static int __init m4u_init(void)
 {
 	return platform_driver_register(&mtk_iommu_driver);
 }
-
-static void __exit m4u_exit(void)
-{
-	return platform_driver_unregister(&mtk_iommu_driver);
-}
-
 subsys_initcall(m4u_init);
-module_exit(m4u_exit);
-
-MODULE_DESCRIPTION("IOMMU API for MTK architected m4u v1 implementations");
-MODULE_AUTHOR("Honghui Zhang <honghui.zhang@mediatek.com>");
-MODULE_LICENSE("GPL v2");
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 52+ messages in thread

* [PATCH 4/9] iommu: mtk_iommu: make it explicitly non-modular
@ 2018-11-26 22:31   ` Paul Gortmaker
  0 siblings, 0 replies; 52+ messages in thread
From: Paul Gortmaker @ 2018-11-26 22:31 UTC (permalink / raw)
  To: Joerg Roedel
  Cc: linux-kernel-u79uwXL29TY76Z2rM5mHXA, Paul Gortmaker,
	iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
	linux-mediatek-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	Matthias Brugger

The Kconfig currently controlling compilation of this code is:

drivers/iommu/Kconfig:config MTK_IOMMU_V1
drivers/iommu/Kconfig:  bool "MTK IOMMU Version 1 (M4U gen1) Support"

...meaning that it currently is not being built as a module by anyone.

Lets remove the modular code that is essentially orphaned, so that
when reading the driver there is no doubt it is builtin-only.

Since module_init was not even used by this driver, the init ordering
remains unchanged with this commit.

We also delete the MODULE_LICENSE tag etc. since all that information
was (or is now) contained at the top of the file in the comments.

Cc: Joerg Roedel <joro-zLv9SwRftAIdnm+yROfE0A@public.gmane.org>
Cc: Matthias Brugger <matthias.bgg-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: Honghui Zhang <honghui.zhang-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
Cc: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org
Cc: linux-mediatek-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
Signed-off-by: Paul Gortmaker <paul.gortmaker-CWA4WttNNZF54TAoqtyWWQ@public.gmane.org>
---
 drivers/iommu/mtk_iommu_v1.c | 15 +++------------
 1 file changed, 3 insertions(+), 12 deletions(-)

diff --git a/drivers/iommu/mtk_iommu_v1.c b/drivers/iommu/mtk_iommu_v1.c
index 27867b862d7a..5fbf3cecb87f 100644
--- a/drivers/iommu/mtk_iommu_v1.c
+++ b/drivers/iommu/mtk_iommu_v1.c
@@ -1,4 +1,6 @@
 /*
+ * IOMMU API for MTK architected m4u v1 implementations
+ *
  * Copyright (c) 2015-2016 MediaTek Inc.
  * Author: Honghui Zhang <honghui.zhang-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
  *
@@ -35,7 +37,7 @@
 #include <linux/spinlock.h>
 #include <asm/barrier.h>
 #include <asm/dma-iommu.h>
-#include <linux/module.h>
+#include <linux/init.h>
 #include <dt-bindings/memory/mt2701-larb-port.h>
 #include <soc/mediatek/smi.h>
 #include "mtk_iommu.h"
@@ -704,15 +706,4 @@ static int __init m4u_init(void)
 {
 	return platform_driver_register(&mtk_iommu_driver);
 }
-
-static void __exit m4u_exit(void)
-{
-	return platform_driver_unregister(&mtk_iommu_driver);
-}
-
 subsys_initcall(m4u_init);
-module_exit(m4u_exit);
-
-MODULE_DESCRIPTION("IOMMU API for MTK architected m4u v1 implementations");
-MODULE_AUTHOR("Honghui Zhang <honghui.zhang-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>");
-MODULE_LICENSE("GPL v2");
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 52+ messages in thread

* [PATCH 5/9] iommu: ipmmu-vmsa: make it explicitly non-modular
       [not found] ` <1543271498-28966-1-git-send-email-paul.gortmaker-CWA4WttNNZF54TAoqtyWWQ@public.gmane.org>
@ 2018-11-26 22:31   ` Paul Gortmaker
  2018-11-26 22:31     ` Paul Gortmaker
  1 sibling, 0 replies; 52+ messages in thread
From: Paul Gortmaker @ 2018-11-26 22:31 UTC (permalink / raw)
  To: Joerg Roedel; +Cc: iommu, linux-kernel, Paul Gortmaker, Laurent Pinchart

The Kconfig currently controlling compilation of this code is:

drivers/iommu/Kconfig:config IPMMU_VMSA
drivers/iommu/Kconfig:        bool "Renesas VMSA-compatible IPMMU"

...meaning that it currently is not being built as a module by anyone.

Lets remove the modular code that is essentially orphaned, so that
when reading the driver there is no doubt it is builtin-only.

Since module_init was not even used by this driver, the init ordering
remains unchanged with this commit.

We also delete the MODULE_LICENSE tag etc. since all that information
was (or is now) contained at the top of the file in the comments.

Also note that MODULE_DEVICE_TABLE is a no-op for non-modular code.

Cc: Joerg Roedel <joro@8bytes.org>
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: iommu@lists.linux-foundation.org
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
 drivers/iommu/ipmmu-vmsa.c | 16 +++-------------
 1 file changed, 3 insertions(+), 13 deletions(-)

diff --git a/drivers/iommu/ipmmu-vmsa.c b/drivers/iommu/ipmmu-vmsa.c
index 9e2655f1c1bf..de39ef992d8a 100644
--- a/drivers/iommu/ipmmu-vmsa.c
+++ b/drivers/iommu/ipmmu-vmsa.c
@@ -1,6 +1,8 @@
 // SPDX-License-Identifier: GPL-2.0
 /*
  * IPMMU VMSA
+ * IOMMU API for Renesas VMSA-compatible IPMMU
+ * Author: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
  *
  * Copyright (C) 2014 Renesas Electronics Corporation
  */
@@ -14,7 +16,7 @@
 #include <linux/interrupt.h>
 #include <linux/io.h>
 #include <linux/iommu.h>
-#include <linux/module.h>
+#include <linux/init.h>
 #include <linux/of.h>
 #include <linux/of_device.h>
 #include <linux/of_iommu.h>
@@ -968,7 +970,6 @@ static const struct of_device_id ipmmu_of_ids[] = {
 	},
 };
 
-MODULE_DEVICE_TABLE(of, ipmmu_of_ids);
 
 static int ipmmu_probe(struct platform_device *pdev)
 {
@@ -1140,15 +1141,4 @@ static int __init ipmmu_init(void)
 	setup_done = true;
 	return 0;
 }
-
-static void __exit ipmmu_exit(void)
-{
-	return platform_driver_unregister(&ipmmu_driver);
-}
-
 subsys_initcall(ipmmu_init);
-module_exit(ipmmu_exit);
-
-MODULE_DESCRIPTION("IOMMU API for Renesas VMSA-compatible IPMMU");
-MODULE_AUTHOR("Laurent Pinchart <laurent.pinchart@ideasonboard.com>");
-MODULE_LICENSE("GPL v2");
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 52+ messages in thread

* [PATCH 5/9] iommu: ipmmu-vmsa: make it explicitly non-modular
@ 2018-11-26 22:31   ` Paul Gortmaker
  0 siblings, 0 replies; 52+ messages in thread
From: Paul Gortmaker @ 2018-11-26 22:31 UTC (permalink / raw)
  To: Joerg Roedel
  Cc: Paul Gortmaker,
	iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA, Laurent Pinchart

The Kconfig currently controlling compilation of this code is:

drivers/iommu/Kconfig:config IPMMU_VMSA
drivers/iommu/Kconfig:        bool "Renesas VMSA-compatible IPMMU"

...meaning that it currently is not being built as a module by anyone.

Lets remove the modular code that is essentially orphaned, so that
when reading the driver there is no doubt it is builtin-only.

Since module_init was not even used by this driver, the init ordering
remains unchanged with this commit.

We also delete the MODULE_LICENSE tag etc. since all that information
was (or is now) contained at the top of the file in the comments.

Also note that MODULE_DEVICE_TABLE is a no-op for non-modular code.

Cc: Joerg Roedel <joro-zLv9SwRftAIdnm+yROfE0A@public.gmane.org>
Cc: Laurent Pinchart <laurent.pinchart-ryLnwIuWjnjg/C1BVhZhaw@public.gmane.org>
Cc: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org
Signed-off-by: Paul Gortmaker <paul.gortmaker-CWA4WttNNZF54TAoqtyWWQ@public.gmane.org>
---
 drivers/iommu/ipmmu-vmsa.c | 16 +++-------------
 1 file changed, 3 insertions(+), 13 deletions(-)

diff --git a/drivers/iommu/ipmmu-vmsa.c b/drivers/iommu/ipmmu-vmsa.c
index 9e2655f1c1bf..de39ef992d8a 100644
--- a/drivers/iommu/ipmmu-vmsa.c
+++ b/drivers/iommu/ipmmu-vmsa.c
@@ -1,6 +1,8 @@
 // SPDX-License-Identifier: GPL-2.0
 /*
  * IPMMU VMSA
+ * IOMMU API for Renesas VMSA-compatible IPMMU
+ * Author: Laurent Pinchart <laurent.pinchart-ryLnwIuWjnjg/C1BVhZhaw@public.gmane.org>
  *
  * Copyright (C) 2014 Renesas Electronics Corporation
  */
@@ -14,7 +16,7 @@
 #include <linux/interrupt.h>
 #include <linux/io.h>
 #include <linux/iommu.h>
-#include <linux/module.h>
+#include <linux/init.h>
 #include <linux/of.h>
 #include <linux/of_device.h>
 #include <linux/of_iommu.h>
@@ -968,7 +970,6 @@ static const struct of_device_id ipmmu_of_ids[] = {
 	},
 };
 
-MODULE_DEVICE_TABLE(of, ipmmu_of_ids);
 
 static int ipmmu_probe(struct platform_device *pdev)
 {
@@ -1140,15 +1141,4 @@ static int __init ipmmu_init(void)
 	setup_done = true;
 	return 0;
 }
-
-static void __exit ipmmu_exit(void)
-{
-	return platform_driver_unregister(&ipmmu_driver);
-}
-
 subsys_initcall(ipmmu_init);
-module_exit(ipmmu_exit);
-
-MODULE_DESCRIPTION("IOMMU API for Renesas VMSA-compatible IPMMU");
-MODULE_AUTHOR("Laurent Pinchart <laurent.pinchart-ryLnwIuWjnjg/C1BVhZhaw@public.gmane.org>");
-MODULE_LICENSE("GPL v2");
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 52+ messages in thread

* [PATCH 6/9] iommu: qcom_iommu: make it explicitly non-modular
  2018-11-26 22:31 ` Paul Gortmaker
@ 2018-11-26 22:31     ` Paul Gortmaker
  -1 siblings, 0 replies; 52+ messages in thread
From: Paul Gortmaker @ 2018-11-26 22:31 UTC (permalink / raw)
  To: Joerg Roedel
  Cc: Paul Gortmaker,
	iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-msm-u79uwXL29TY76Z2rM5mHXA

The Kconfig currently controlling compilation of this code is:

drivers/iommu/Kconfig:config MTK_IOMMU_V1
drivers/iommu/Kconfig:  bool "MTK IOMMU Version 1 (M4U gen1) Support"

...meaning that it currently is not being built as a module by anyone.

Lets remove the modular code that is essentially orphaned, so that
when reading the driver there is no doubt it is builtin-only.

Since module_init just becomes device_initcall for non-modules, the
init ordering remains unchanged with this commit.

Also note that MODULE_DEVICE_TABLE is a no-op for non-modular code.

We also delete the MODULE_LICENSE tag etc. since all that information
was (or is now) contained at the top of the file in the comments.

Cc: Rob Clark <robdclark-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: Joerg Roedel <joro-zLv9SwRftAIdnm+yROfE0A@public.gmane.org>
Cc: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org
Cc: linux-arm-msm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Signed-off-by: Paul Gortmaker <paul.gortmaker-CWA4WttNNZF54TAoqtyWWQ@public.gmane.org>
---
 drivers/iommu/qcom_iommu.c | 16 ++--------------
 1 file changed, 2 insertions(+), 14 deletions(-)

diff --git a/drivers/iommu/qcom_iommu.c b/drivers/iommu/qcom_iommu.c
index ee70e9921cf1..4c8f4fc54106 100644
--- a/drivers/iommu/qcom_iommu.c
+++ b/drivers/iommu/qcom_iommu.c
@@ -29,7 +29,7 @@
 #include <linux/iommu.h>
 #include <linux/iopoll.h>
 #include <linux/kconfig.h>
-#include <linux/module.h>
+#include <linux/init.h>
 #include <linux/mutex.h>
 #include <linux/of.h>
 #include <linux/of_address.h>
@@ -908,7 +908,6 @@ static const struct of_device_id qcom_iommu_of_match[] = {
 	{ .compatible = "qcom,msm-iommu-v1" },
 	{ /* sentinel */ }
 };
-MODULE_DEVICE_TABLE(of, qcom_iommu_of_match);
 
 static struct platform_driver qcom_iommu_driver = {
 	.driver	= {
@@ -934,15 +933,4 @@ static int __init qcom_iommu_init(void)
 
 	return ret;
 }
-
-static void __exit qcom_iommu_exit(void)
-{
-	platform_driver_unregister(&qcom_iommu_driver);
-	platform_driver_unregister(&qcom_iommu_ctx_driver);
-}
-
-module_init(qcom_iommu_init);
-module_exit(qcom_iommu_exit);
-
-MODULE_DESCRIPTION("IOMMU API for QCOM IOMMU v1 implementations");
-MODULE_LICENSE("GPL v2");
+device_initcall(qcom_iommu_init);
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 52+ messages in thread

* [PATCH 6/9] iommu: qcom_iommu: make it explicitly non-modular
@ 2018-11-26 22:31     ` Paul Gortmaker
  0 siblings, 0 replies; 52+ messages in thread
From: Paul Gortmaker @ 2018-11-26 22:31 UTC (permalink / raw)
  To: Joerg Roedel
  Cc: iommu, linux-kernel, Paul Gortmaker, Rob Clark, linux-arm-msm

The Kconfig currently controlling compilation of this code is:

drivers/iommu/Kconfig:config MTK_IOMMU_V1
drivers/iommu/Kconfig:  bool "MTK IOMMU Version 1 (M4U gen1) Support"

...meaning that it currently is not being built as a module by anyone.

Lets remove the modular code that is essentially orphaned, so that
when reading the driver there is no doubt it is builtin-only.

Since module_init just becomes device_initcall for non-modules, the
init ordering remains unchanged with this commit.

Also note that MODULE_DEVICE_TABLE is a no-op for non-modular code.

We also delete the MODULE_LICENSE tag etc. since all that information
was (or is now) contained at the top of the file in the comments.

Cc: Rob Clark <robdclark@gmail.com>
Cc: Joerg Roedel <joro@8bytes.org>
Cc: iommu@lists.linux-foundation.org
Cc: linux-arm-msm@vger.kernel.org
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
 drivers/iommu/qcom_iommu.c | 16 ++--------------
 1 file changed, 2 insertions(+), 14 deletions(-)

diff --git a/drivers/iommu/qcom_iommu.c b/drivers/iommu/qcom_iommu.c
index ee70e9921cf1..4c8f4fc54106 100644
--- a/drivers/iommu/qcom_iommu.c
+++ b/drivers/iommu/qcom_iommu.c
@@ -29,7 +29,7 @@
 #include <linux/iommu.h>
 #include <linux/iopoll.h>
 #include <linux/kconfig.h>
-#include <linux/module.h>
+#include <linux/init.h>
 #include <linux/mutex.h>
 #include <linux/of.h>
 #include <linux/of_address.h>
@@ -908,7 +908,6 @@ static const struct of_device_id qcom_iommu_of_match[] = {
 	{ .compatible = "qcom,msm-iommu-v1" },
 	{ /* sentinel */ }
 };
-MODULE_DEVICE_TABLE(of, qcom_iommu_of_match);
 
 static struct platform_driver qcom_iommu_driver = {
 	.driver	= {
@@ -934,15 +933,4 @@ static int __init qcom_iommu_init(void)
 
 	return ret;
 }
-
-static void __exit qcom_iommu_exit(void)
-{
-	platform_driver_unregister(&qcom_iommu_driver);
-	platform_driver_unregister(&qcom_iommu_ctx_driver);
-}
-
-module_init(qcom_iommu_init);
-module_exit(qcom_iommu_exit);
-
-MODULE_DESCRIPTION("IOMMU API for QCOM IOMMU v1 implementations");
-MODULE_LICENSE("GPL v2");
+device_initcall(qcom_iommu_init);
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 52+ messages in thread

* [PATCH 7/9] iommu: tegra-gart: make it explicitly non-modular
  2018-11-26 22:31 ` Paul Gortmaker
@ 2018-11-26 22:31     ` Paul Gortmaker
  -1 siblings, 0 replies; 52+ messages in thread
From: Paul Gortmaker @ 2018-11-26 22:31 UTC (permalink / raw)
  To: Joerg Roedel
  Cc: Alexandre Courbot, Stephen Warren,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA, Paul Gortmaker,
	iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
	Thierry Reding, linux-tegra-u79uwXL29TY76Z2rM5mHXA, Hiroshi Doyu

The Kconfig currently controlling compilation of this code is:

drivers/iommu/Kconfig:config TEGRA_IOMMU_GART
drivers/iommu/Kconfig:  bool "Tegra GART IOMMU Support"

...meaning that it currently is not being built as a module by anyone.

Lets remove the modular code that is essentially orphaned, so that
when reading the driver there is no doubt it is builtin-only.

We explicitly disallow a driver unbind, since that doesn't have a
sensible use case anyway, and it allows us to drop the ".remove"
code for non-modular drivers.

Since module_init was not in use by this code, the init ordering
remains unchanged with this commit.

We replace module.h with moduleparam.h since the file does actually
declare some module_param() and the easiest way to keep back
compatibility with existing use cases is to leave it as-is for now.

The init function was missing an __init annotation, so it was added.

We also delete the MODULE_LICENSE tag etc. since all that information
was (or is now) contained at the top of the file in the comments.

Cc: Hiroshi Doyu <hdoyu-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
Cc: Joerg Roedel <joro-zLv9SwRftAIdnm+yROfE0A@public.gmane.org>
Cc: Stephen Warren <swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
Cc: Thierry Reding <thierry.reding-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: Alexandre Courbot <gnurou-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org
Cc: linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Signed-off-by: Paul Gortmaker <paul.gortmaker-CWA4WttNNZF54TAoqtyWWQ@public.gmane.org>
---
 drivers/iommu/tegra-gart.c | 37 +++++++------------------------------
 1 file changed, 7 insertions(+), 30 deletions(-)

diff --git a/drivers/iommu/tegra-gart.c b/drivers/iommu/tegra-gart.c
index 7b1361d57a17..da6a4e357b2b 100644
--- a/drivers/iommu/tegra-gart.c
+++ b/drivers/iommu/tegra-gart.c
@@ -3,6 +3,8 @@
  *
  * Copyright (c) 2010-2012, NVIDIA CORPORATION.  All rights reserved.
  *
+ * Author: Hiroshi DOYU <hdoyu-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
+ *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
  * version 2, as published by the Free Software Foundation.
@@ -19,7 +21,8 @@
 
 #define pr_fmt(fmt)	"%s(): " fmt, __func__
 
-#include <linux/module.h>
+#include <linux/init.h>
+#include <linux/moduleparam.h>
 #include <linux/platform_device.h>
 #include <linux/spinlock.h>
 #include <linux/slab.h>
@@ -478,20 +481,6 @@ static int tegra_gart_probe(struct platform_device *pdev)
 	return 0;
 }
 
-static int tegra_gart_remove(struct platform_device *pdev)
-{
-	struct gart_device *gart = platform_get_drvdata(pdev);
-
-	iommu_device_unregister(&gart->iommu);
-	iommu_device_sysfs_remove(&gart->iommu);
-
-	writel(0, gart->regs + GART_CONFIG);
-	if (gart->savedata)
-		vfree(gart->savedata);
-	gart_handle = NULL;
-	return 0;
-}
-
 static const struct dev_pm_ops tegra_gart_pm_ops = {
 	.suspend	= tegra_gart_suspend,
 	.resume		= tegra_gart_resume,
@@ -501,34 +490,22 @@ static const struct of_device_id tegra_gart_of_match[] = {
 	{ .compatible = "nvidia,tegra20-gart", },
 	{ },
 };
-MODULE_DEVICE_TABLE(of, tegra_gart_of_match);
 
 static struct platform_driver tegra_gart_driver = {
 	.probe		= tegra_gart_probe,
-	.remove		= tegra_gart_remove,
 	.driver = {
 		.name	= "tegra-gart",
 		.pm	= &tegra_gart_pm_ops,
 		.of_match_table = tegra_gart_of_match,
+		.suppress_bind_attrs = true,
 	},
 };
 
-static int tegra_gart_init(void)
+static int __init tegra_gart_init(void)
 {
 	return platform_driver_register(&tegra_gart_driver);
 }
-
-static void __exit tegra_gart_exit(void)
-{
-	platform_driver_unregister(&tegra_gart_driver);
-}
-
 subsys_initcall(tegra_gart_init);
-module_exit(tegra_gart_exit);
-module_param(gart_debug, bool, 0644);
 
+module_param(gart_debug, bool, 0644);
 MODULE_PARM_DESC(gart_debug, "Enable GART debugging");
-MODULE_DESCRIPTION("IOMMU API for GART in Tegra20");
-MODULE_AUTHOR("Hiroshi DOYU <hdoyu-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>");
-MODULE_ALIAS("platform:tegra-gart");
-MODULE_LICENSE("GPL v2");
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 52+ messages in thread

* [PATCH 7/9] iommu: tegra-gart: make it explicitly non-modular
@ 2018-11-26 22:31     ` Paul Gortmaker
  0 siblings, 0 replies; 52+ messages in thread
From: Paul Gortmaker @ 2018-11-26 22:31 UTC (permalink / raw)
  To: Joerg Roedel
  Cc: iommu, linux-kernel, Paul Gortmaker, Hiroshi Doyu,
	Stephen Warren, Thierry Reding, Alexandre Courbot, linux-tegra

The Kconfig currently controlling compilation of this code is:

drivers/iommu/Kconfig:config TEGRA_IOMMU_GART
drivers/iommu/Kconfig:  bool "Tegra GART IOMMU Support"

...meaning that it currently is not being built as a module by anyone.

Lets remove the modular code that is essentially orphaned, so that
when reading the driver there is no doubt it is builtin-only.

We explicitly disallow a driver unbind, since that doesn't have a
sensible use case anyway, and it allows us to drop the ".remove"
code for non-modular drivers.

Since module_init was not in use by this code, the init ordering
remains unchanged with this commit.

We replace module.h with moduleparam.h since the file does actually
declare some module_param() and the easiest way to keep back
compatibility with existing use cases is to leave it as-is for now.

The init function was missing an __init annotation, so it was added.

We also delete the MODULE_LICENSE tag etc. since all that information
was (or is now) contained at the top of the file in the comments.

Cc: Hiroshi Doyu <hdoyu@nvidia.com>
Cc: Joerg Roedel <joro@8bytes.org>
Cc: Stephen Warren <swarren@wwwdotorg.org>
Cc: Thierry Reding <thierry.reding@gmail.com>
Cc: Alexandre Courbot <gnurou@gmail.com>
Cc: iommu@lists.linux-foundation.org
Cc: linux-tegra@vger.kernel.org
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
 drivers/iommu/tegra-gart.c | 37 +++++++------------------------------
 1 file changed, 7 insertions(+), 30 deletions(-)

diff --git a/drivers/iommu/tegra-gart.c b/drivers/iommu/tegra-gart.c
index 7b1361d57a17..da6a4e357b2b 100644
--- a/drivers/iommu/tegra-gart.c
+++ b/drivers/iommu/tegra-gart.c
@@ -3,6 +3,8 @@
  *
  * Copyright (c) 2010-2012, NVIDIA CORPORATION.  All rights reserved.
  *
+ * Author: Hiroshi DOYU <hdoyu@nvidia.com>
+ *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
  * version 2, as published by the Free Software Foundation.
@@ -19,7 +21,8 @@
 
 #define pr_fmt(fmt)	"%s(): " fmt, __func__
 
-#include <linux/module.h>
+#include <linux/init.h>
+#include <linux/moduleparam.h>
 #include <linux/platform_device.h>
 #include <linux/spinlock.h>
 #include <linux/slab.h>
@@ -478,20 +481,6 @@ static int tegra_gart_probe(struct platform_device *pdev)
 	return 0;
 }
 
-static int tegra_gart_remove(struct platform_device *pdev)
-{
-	struct gart_device *gart = platform_get_drvdata(pdev);
-
-	iommu_device_unregister(&gart->iommu);
-	iommu_device_sysfs_remove(&gart->iommu);
-
-	writel(0, gart->regs + GART_CONFIG);
-	if (gart->savedata)
-		vfree(gart->savedata);
-	gart_handle = NULL;
-	return 0;
-}
-
 static const struct dev_pm_ops tegra_gart_pm_ops = {
 	.suspend	= tegra_gart_suspend,
 	.resume		= tegra_gart_resume,
@@ -501,34 +490,22 @@ static const struct of_device_id tegra_gart_of_match[] = {
 	{ .compatible = "nvidia,tegra20-gart", },
 	{ },
 };
-MODULE_DEVICE_TABLE(of, tegra_gart_of_match);
 
 static struct platform_driver tegra_gart_driver = {
 	.probe		= tegra_gart_probe,
-	.remove		= tegra_gart_remove,
 	.driver = {
 		.name	= "tegra-gart",
 		.pm	= &tegra_gart_pm_ops,
 		.of_match_table = tegra_gart_of_match,
+		.suppress_bind_attrs = true,
 	},
 };
 
-static int tegra_gart_init(void)
+static int __init tegra_gart_init(void)
 {
 	return platform_driver_register(&tegra_gart_driver);
 }
-
-static void __exit tegra_gart_exit(void)
-{
-	platform_driver_unregister(&tegra_gart_driver);
-}
-
 subsys_initcall(tegra_gart_init);
-module_exit(tegra_gart_exit);
-module_param(gart_debug, bool, 0644);
 
+module_param(gart_debug, bool, 0644);
 MODULE_PARM_DESC(gart_debug, "Enable GART debugging");
-MODULE_DESCRIPTION("IOMMU API for GART in Tegra20");
-MODULE_AUTHOR("Hiroshi DOYU <hdoyu@nvidia.com>");
-MODULE_ALIAS("platform:tegra-gart");
-MODULE_LICENSE("GPL v2");
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 52+ messages in thread

* [PATCH 8/9] iommu: arm-smmu: make it explicitly non-modular
       [not found] ` <1543271498-28966-1-git-send-email-paul.gortmaker-CWA4WttNNZF54TAoqtyWWQ@public.gmane.org>
  2018-11-26 22:31     ` Paul Gortmaker
@ 2018-11-26 22:31   ` Paul Gortmaker
  1 sibling, 0 replies; 52+ messages in thread
From: Paul Gortmaker @ 2018-11-26 22:31 UTC (permalink / raw)
  To: Joerg Roedel
  Cc: iommu, linux-kernel, Paul Gortmaker, Will Deacon, Robin Murphy,
	Nate Watterson, linux-arm-kernel

The Kconfig currently controlling compilation of this code is:

drivers/iommu/Kconfig:config ARM_SMMU
drivers/iommu/Kconfig:  bool "ARM Ltd. System MMU (SMMU) Support"

...meaning that it currently is not being built as a module by anyone.

Lets remove the modular code that is essentially orphaned, so that
when reading the driver there is no doubt it is builtin-only.

Since module_platform_driver() uses the same init level priority as
builtin_platform_driver() the init ordering remains unchanged with
this commit.

We explicitly disallow a driver unbind, since that doesn't have a
sensible use case anyway, but unlike most drivers, we can't delete the
function tied to the ".remove" field.  This is because as of commit
7aa8619a66ae ("iommu/arm-smmu-v3: Implement shutdown method") the
.remove function was given a one line wrapper and re-used to provide a
.shutdown service.  So we delete the wrapper and re-name the function
from remove to shutdown.

We add a moduleparam.h include since the file does actually declare
some module parameters, and leaving them as such is the easiest way
currently to remain backwards compatible with existing use cases.

We also delete the MODULE_LICENSE tag etc. since all that information
is already contained at the top of the file in the comments.

Cc: Will Deacon <will.deacon@arm.com>
Cc: Joerg Roedel <joro@8bytes.org>
Cc: Robin Murphy <robin.murphy@arm.com>
Cc: Nate Watterson <nwatters@codeaurora.org>
Cc: linux-arm-kernel@lists.infradead.org
Cc: iommu@lists.linux-foundation.org
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
 drivers/iommu/arm-smmu.c | 32 +++++++++++++-------------------
 1 file changed, 13 insertions(+), 19 deletions(-)

diff --git a/drivers/iommu/arm-smmu.c b/drivers/iommu/arm-smmu.c
index 5a28ae892504..4a2e143fdf52 100644
--- a/drivers/iommu/arm-smmu.c
+++ b/drivers/iommu/arm-smmu.c
@@ -41,7 +41,8 @@
 #include <linux/io-64-nonatomic-hi-lo.h>
 #include <linux/iommu.h>
 #include <linux/iopoll.h>
-#include <linux/module.h>
+#include <linux/init.h>
+#include <linux/moduleparam.h>
 #include <linux/of.h>
 #include <linux/of_address.h>
 #include <linux/of_device.h>
@@ -101,6 +102,10 @@
 #define MSI_IOVA_LENGTH			0x100000
 
 static int force_stage;
+/*
+ * not really modular, but the easiest way to keep compat with existing
+ * bootargs behaviour is to continue using module_param() here.
+ */
 module_param(force_stage, int, S_IRUGO);
 MODULE_PARM_DESC(force_stage,
 	"Force SMMU mappings to be installed at a particular stage of translation. A value of '1' or '2' forces the corresponding stage. All other values are ignored (i.e. no stage is forced). Note that selecting a specific stage will disable support for nested translation.");
@@ -1964,7 +1969,6 @@ static const struct of_device_id arm_smmu_of_match[] = {
 	{ .compatible = "cavium,smmu-v2", .data = &cavium_smmuv2 },
 	{ },
 };
-MODULE_DEVICE_TABLE(of, arm_smmu_of_match);
 
 #ifdef CONFIG_ACPI
 static int acpi_smmu_get_data(u32 model, struct arm_smmu_device *smmu)
@@ -2224,24 +2228,18 @@ static int arm_smmu_legacy_bus_init(void)
 }
 device_initcall_sync(arm_smmu_legacy_bus_init);
 
-static int arm_smmu_device_remove(struct platform_device *pdev)
+static void arm_smmu_device_shutdown(struct platform_device *pdev)
 {
 	struct arm_smmu_device *smmu = platform_get_drvdata(pdev);
 
 	if (!smmu)
-		return -ENODEV;
+		return;
 
 	if (!bitmap_empty(smmu->context_map, ARM_SMMU_MAX_CBS))
 		dev_err(&pdev->dev, "removing device with active domains!\n");
 
 	/* Turn the thing off */
 	writel(sCR0_CLIENTPD, ARM_SMMU_GR0_NS(smmu) + ARM_SMMU_GR0_sCR0);
-	return 0;
-}
-
-static void arm_smmu_device_shutdown(struct platform_device *pdev)
-{
-	arm_smmu_device_remove(pdev);
 }
 
 static int __maybe_unused arm_smmu_pm_resume(struct device *dev)
@@ -2256,16 +2254,12 @@ static SIMPLE_DEV_PM_OPS(arm_smmu_pm_ops, NULL, arm_smmu_pm_resume);
 
 static struct platform_driver arm_smmu_driver = {
 	.driver	= {
-		.name		= "arm-smmu",
-		.of_match_table	= of_match_ptr(arm_smmu_of_match),
-		.pm		= &arm_smmu_pm_ops,
+		.name			= "arm-smmu",
+		.of_match_table		= of_match_ptr(arm_smmu_of_match),
+		.pm			= &arm_smmu_pm_ops,
+		.suppress_bind_attrs	= true,
 	},
 	.probe	= arm_smmu_device_probe,
-	.remove	= arm_smmu_device_remove,
 	.shutdown = arm_smmu_device_shutdown,
 };
-module_platform_driver(arm_smmu_driver);
-
-MODULE_DESCRIPTION("IOMMU API for ARM architected SMMU implementations");
-MODULE_AUTHOR("Will Deacon <will.deacon@arm.com>");
-MODULE_LICENSE("GPL v2");
+builtin_platform_driver(arm_smmu_driver);
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 52+ messages in thread

* [PATCH 8/9] iommu: arm-smmu: make it explicitly non-modular
@ 2018-11-26 22:31   ` Paul Gortmaker
  0 siblings, 0 replies; 52+ messages in thread
From: Paul Gortmaker @ 2018-11-26 22:31 UTC (permalink / raw)
  To: Joerg Roedel
  Cc: Will Deacon, linux-kernel-u79uwXL29TY76Z2rM5mHXA, Paul Gortmaker,
	iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, Robin Murphy

The Kconfig currently controlling compilation of this code is:

drivers/iommu/Kconfig:config ARM_SMMU
drivers/iommu/Kconfig:  bool "ARM Ltd. System MMU (SMMU) Support"

...meaning that it currently is not being built as a module by anyone.

Lets remove the modular code that is essentially orphaned, so that
when reading the driver there is no doubt it is builtin-only.

Since module_platform_driver() uses the same init level priority as
builtin_platform_driver() the init ordering remains unchanged with
this commit.

We explicitly disallow a driver unbind, since that doesn't have a
sensible use case anyway, but unlike most drivers, we can't delete the
function tied to the ".remove" field.  This is because as of commit
7aa8619a66ae ("iommu/arm-smmu-v3: Implement shutdown method") the
.remove function was given a one line wrapper and re-used to provide a
.shutdown service.  So we delete the wrapper and re-name the function
from remove to shutdown.

We add a moduleparam.h include since the file does actually declare
some module parameters, and leaving them as such is the easiest way
currently to remain backwards compatible with existing use cases.

We also delete the MODULE_LICENSE tag etc. since all that information
is already contained at the top of the file in the comments.

Cc: Will Deacon <will.deacon-5wv7dgnIgG8@public.gmane.org>
Cc: Joerg Roedel <joro-zLv9SwRftAIdnm+yROfE0A@public.gmane.org>
Cc: Robin Murphy <robin.murphy-5wv7dgnIgG8@public.gmane.org>
Cc: Nate Watterson <nwatters-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
Cc: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
Cc: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org
Signed-off-by: Paul Gortmaker <paul.gortmaker-CWA4WttNNZF54TAoqtyWWQ@public.gmane.org>
---
 drivers/iommu/arm-smmu.c | 32 +++++++++++++-------------------
 1 file changed, 13 insertions(+), 19 deletions(-)

diff --git a/drivers/iommu/arm-smmu.c b/drivers/iommu/arm-smmu.c
index 5a28ae892504..4a2e143fdf52 100644
--- a/drivers/iommu/arm-smmu.c
+++ b/drivers/iommu/arm-smmu.c
@@ -41,7 +41,8 @@
 #include <linux/io-64-nonatomic-hi-lo.h>
 #include <linux/iommu.h>
 #include <linux/iopoll.h>
-#include <linux/module.h>
+#include <linux/init.h>
+#include <linux/moduleparam.h>
 #include <linux/of.h>
 #include <linux/of_address.h>
 #include <linux/of_device.h>
@@ -101,6 +102,10 @@
 #define MSI_IOVA_LENGTH			0x100000
 
 static int force_stage;
+/*
+ * not really modular, but the easiest way to keep compat with existing
+ * bootargs behaviour is to continue using module_param() here.
+ */
 module_param(force_stage, int, S_IRUGO);
 MODULE_PARM_DESC(force_stage,
 	"Force SMMU mappings to be installed at a particular stage of translation. A value of '1' or '2' forces the corresponding stage. All other values are ignored (i.e. no stage is forced). Note that selecting a specific stage will disable support for nested translation.");
@@ -1964,7 +1969,6 @@ static const struct of_device_id arm_smmu_of_match[] = {
 	{ .compatible = "cavium,smmu-v2", .data = &cavium_smmuv2 },
 	{ },
 };
-MODULE_DEVICE_TABLE(of, arm_smmu_of_match);
 
 #ifdef CONFIG_ACPI
 static int acpi_smmu_get_data(u32 model, struct arm_smmu_device *smmu)
@@ -2224,24 +2228,18 @@ static int arm_smmu_legacy_bus_init(void)
 }
 device_initcall_sync(arm_smmu_legacy_bus_init);
 
-static int arm_smmu_device_remove(struct platform_device *pdev)
+static void arm_smmu_device_shutdown(struct platform_device *pdev)
 {
 	struct arm_smmu_device *smmu = platform_get_drvdata(pdev);
 
 	if (!smmu)
-		return -ENODEV;
+		return;
 
 	if (!bitmap_empty(smmu->context_map, ARM_SMMU_MAX_CBS))
 		dev_err(&pdev->dev, "removing device with active domains!\n");
 
 	/* Turn the thing off */
 	writel(sCR0_CLIENTPD, ARM_SMMU_GR0_NS(smmu) + ARM_SMMU_GR0_sCR0);
-	return 0;
-}
-
-static void arm_smmu_device_shutdown(struct platform_device *pdev)
-{
-	arm_smmu_device_remove(pdev);
 }
 
 static int __maybe_unused arm_smmu_pm_resume(struct device *dev)
@@ -2256,16 +2254,12 @@ static SIMPLE_DEV_PM_OPS(arm_smmu_pm_ops, NULL, arm_smmu_pm_resume);
 
 static struct platform_driver arm_smmu_driver = {
 	.driver	= {
-		.name		= "arm-smmu",
-		.of_match_table	= of_match_ptr(arm_smmu_of_match),
-		.pm		= &arm_smmu_pm_ops,
+		.name			= "arm-smmu",
+		.of_match_table		= of_match_ptr(arm_smmu_of_match),
+		.pm			= &arm_smmu_pm_ops,
+		.suppress_bind_attrs	= true,
 	},
 	.probe	= arm_smmu_device_probe,
-	.remove	= arm_smmu_device_remove,
 	.shutdown = arm_smmu_device_shutdown,
 };
-module_platform_driver(arm_smmu_driver);
-
-MODULE_DESCRIPTION("IOMMU API for ARM architected SMMU implementations");
-MODULE_AUTHOR("Will Deacon <will.deacon-5wv7dgnIgG8@public.gmane.org>");
-MODULE_LICENSE("GPL v2");
+builtin_platform_driver(arm_smmu_driver);
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 52+ messages in thread

* [PATCH 8/9] iommu: arm-smmu: make it explicitly non-modular
@ 2018-11-26 22:31   ` Paul Gortmaker
  0 siblings, 0 replies; 52+ messages in thread
From: Paul Gortmaker @ 2018-11-26 22:31 UTC (permalink / raw)
  To: linux-arm-kernel

The Kconfig currently controlling compilation of this code is:

drivers/iommu/Kconfig:config ARM_SMMU
drivers/iommu/Kconfig:  bool "ARM Ltd. System MMU (SMMU) Support"

...meaning that it currently is not being built as a module by anyone.

Lets remove the modular code that is essentially orphaned, so that
when reading the driver there is no doubt it is builtin-only.

Since module_platform_driver() uses the same init level priority as
builtin_platform_driver() the init ordering remains unchanged with
this commit.

We explicitly disallow a driver unbind, since that doesn't have a
sensible use case anyway, but unlike most drivers, we can't delete the
function tied to the ".remove" field.  This is because as of commit
7aa8619a66ae ("iommu/arm-smmu-v3: Implement shutdown method") the
.remove function was given a one line wrapper and re-used to provide a
.shutdown service.  So we delete the wrapper and re-name the function
from remove to shutdown.

We add a moduleparam.h include since the file does actually declare
some module parameters, and leaving them as such is the easiest way
currently to remain backwards compatible with existing use cases.

We also delete the MODULE_LICENSE tag etc. since all that information
is already contained at the top of the file in the comments.

Cc: Will Deacon <will.deacon@arm.com>
Cc: Joerg Roedel <joro@8bytes.org>
Cc: Robin Murphy <robin.murphy@arm.com>
Cc: Nate Watterson <nwatters@codeaurora.org>
Cc: linux-arm-kernel at lists.infradead.org
Cc: iommu at lists.linux-foundation.org
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
 drivers/iommu/arm-smmu.c | 32 +++++++++++++-------------------
 1 file changed, 13 insertions(+), 19 deletions(-)

diff --git a/drivers/iommu/arm-smmu.c b/drivers/iommu/arm-smmu.c
index 5a28ae892504..4a2e143fdf52 100644
--- a/drivers/iommu/arm-smmu.c
+++ b/drivers/iommu/arm-smmu.c
@@ -41,7 +41,8 @@
 #include <linux/io-64-nonatomic-hi-lo.h>
 #include <linux/iommu.h>
 #include <linux/iopoll.h>
-#include <linux/module.h>
+#include <linux/init.h>
+#include <linux/moduleparam.h>
 #include <linux/of.h>
 #include <linux/of_address.h>
 #include <linux/of_device.h>
@@ -101,6 +102,10 @@
 #define MSI_IOVA_LENGTH			0x100000
 
 static int force_stage;
+/*
+ * not really modular, but the easiest way to keep compat with existing
+ * bootargs behaviour is to continue using module_param() here.
+ */
 module_param(force_stage, int, S_IRUGO);
 MODULE_PARM_DESC(force_stage,
 	"Force SMMU mappings to be installed at a particular stage of translation. A value of '1' or '2' forces the corresponding stage. All other values are ignored (i.e. no stage is forced). Note that selecting a specific stage will disable support for nested translation.");
@@ -1964,7 +1969,6 @@ static const struct of_device_id arm_smmu_of_match[] = {
 	{ .compatible = "cavium,smmu-v2", .data = &cavium_smmuv2 },
 	{ },
 };
-MODULE_DEVICE_TABLE(of, arm_smmu_of_match);
 
 #ifdef CONFIG_ACPI
 static int acpi_smmu_get_data(u32 model, struct arm_smmu_device *smmu)
@@ -2224,24 +2228,18 @@ static int arm_smmu_legacy_bus_init(void)
 }
 device_initcall_sync(arm_smmu_legacy_bus_init);
 
-static int arm_smmu_device_remove(struct platform_device *pdev)
+static void arm_smmu_device_shutdown(struct platform_device *pdev)
 {
 	struct arm_smmu_device *smmu = platform_get_drvdata(pdev);
 
 	if (!smmu)
-		return -ENODEV;
+		return;
 
 	if (!bitmap_empty(smmu->context_map, ARM_SMMU_MAX_CBS))
 		dev_err(&pdev->dev, "removing device with active domains!\n");
 
 	/* Turn the thing off */
 	writel(sCR0_CLIENTPD, ARM_SMMU_GR0_NS(smmu) + ARM_SMMU_GR0_sCR0);
-	return 0;
-}
-
-static void arm_smmu_device_shutdown(struct platform_device *pdev)
-{
-	arm_smmu_device_remove(pdev);
 }
 
 static int __maybe_unused arm_smmu_pm_resume(struct device *dev)
@@ -2256,16 +2254,12 @@ static SIMPLE_DEV_PM_OPS(arm_smmu_pm_ops, NULL, arm_smmu_pm_resume);
 
 static struct platform_driver arm_smmu_driver = {
 	.driver	= {
-		.name		= "arm-smmu",
-		.of_match_table	= of_match_ptr(arm_smmu_of_match),
-		.pm		= &arm_smmu_pm_ops,
+		.name			= "arm-smmu",
+		.of_match_table		= of_match_ptr(arm_smmu_of_match),
+		.pm			= &arm_smmu_pm_ops,
+		.suppress_bind_attrs	= true,
 	},
 	.probe	= arm_smmu_device_probe,
-	.remove	= arm_smmu_device_remove,
 	.shutdown = arm_smmu_device_shutdown,
 };
-module_platform_driver(arm_smmu_driver);
-
-MODULE_DESCRIPTION("IOMMU API for ARM architected SMMU implementations");
-MODULE_AUTHOR("Will Deacon <will.deacon@arm.com>");
-MODULE_LICENSE("GPL v2");
+builtin_platform_driver(arm_smmu_driver);
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 52+ messages in thread

* [PATCH 9/9] iommu: arm-smmu-v3: make it explicitly non-modular
       [not found] ` <1543271498-28966-1-git-send-email-paul.gortmaker-CWA4WttNNZF54TAoqtyWWQ@public.gmane.org>
  2018-11-26 22:31     ` Paul Gortmaker
@ 2018-11-26 22:31   ` Paul Gortmaker
  1 sibling, 0 replies; 52+ messages in thread
From: Paul Gortmaker @ 2018-11-26 22:31 UTC (permalink / raw)
  To: Joerg Roedel
  Cc: iommu, linux-kernel, Paul Gortmaker, Will Deacon, Robin Murphy,
	Nate Watterson, linux-arm-kernel

The Kconfig currently controlling compilation of this code is:

drivers/iommu/Kconfig:config ARM_SMMU_V3
drivers/iommu/Kconfig:  bool "ARM Ltd. System MMU Version 3 (SMMUv3) Support"

...meaning that it currently is not being built as a module by anyone.

Lets remove the modular code that is essentially orphaned, so that
when reading the driver there is no doubt it is builtin-only.

Since module_platform_driver() uses the same init level priority as
builtin_platform_driver() the init ordering remains unchanged with
this commit.

We explicitly disallow a driver unbind, since that doesn't have a
sensible use case anyway, but unlike most drivers, we can't delete the
function tied to the ".remove" field.  This is because as of commit
7aa8619a66ae ("iommu/arm-smmu-v3: Implement shutdown method") the
.remove function was given a one line wrapper and re-used to provide a
.shutdown service.  So we delete the wrapper and re-name the function
from remove to shutdown.

We add a moduleparam.h include since the file does actually declare
some module parameters, and leaving them as such is the easiest way
currently to remain backwards compatible with existing use cases.

Also note that MODULE_DEVICE_TABLE is a no-op for non-modular code.

We also delete the MODULE_LICENSE tag etc. since all that information
is already contained at the top of the file in the comments.

Cc: Will Deacon <will.deacon@arm.com>
Cc: Joerg Roedel <joro@8bytes.org>
Cc: Robin Murphy <robin.murphy@arm.com>
Cc: Nate Watterson <nwatters@codeaurora.org>
Cc: linux-arm-kernel@lists.infradead.org
Cc: iommu@lists.linux-foundation.org
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
 drivers/iommu/arm-smmu-v3.c | 25 +++++++++----------------
 1 file changed, 9 insertions(+), 16 deletions(-)

diff --git a/drivers/iommu/arm-smmu-v3.c b/drivers/iommu/arm-smmu-v3.c
index 6947ccf26512..1189c06079d4 100644
--- a/drivers/iommu/arm-smmu-v3.c
+++ b/drivers/iommu/arm-smmu-v3.c
@@ -20,7 +20,8 @@
 #include <linux/interrupt.h>
 #include <linux/iommu.h>
 #include <linux/iopoll.h>
-#include <linux/module.h>
+#include <linux/init.h>
+#include <linux/moduleparam.h>
 #include <linux/msi.h>
 #include <linux/of.h>
 #include <linux/of_address.h>
@@ -356,6 +357,10 @@
 #define MSI_IOVA_BASE			0x8000000
 #define MSI_IOVA_LENGTH			0x100000
 
+/*
+ * not really modular, but the easiest way to keep compat with existing
+ * bootargs behaviour is to continue using module_param_named here.
+ */
 static bool disable_bypass = 1;
 module_param_named(disable_bypass, disable_bypass, bool, S_IRUGO);
 MODULE_PARM_DESC(disable_bypass,
@@ -2928,37 +2933,25 @@ static int arm_smmu_device_probe(struct platform_device *pdev)
 	return 0;
 }
 
-static int arm_smmu_device_remove(struct platform_device *pdev)
+static void arm_smmu_device_shutdown(struct platform_device *pdev)
 {
 	struct arm_smmu_device *smmu = platform_get_drvdata(pdev);
 
 	arm_smmu_device_disable(smmu);
-
-	return 0;
-}
-
-static void arm_smmu_device_shutdown(struct platform_device *pdev)
-{
-	arm_smmu_device_remove(pdev);
 }
 
 static const struct of_device_id arm_smmu_of_match[] = {
 	{ .compatible = "arm,smmu-v3", },
 	{ },
 };
-MODULE_DEVICE_TABLE(of, arm_smmu_of_match);
 
 static struct platform_driver arm_smmu_driver = {
 	.driver	= {
 		.name		= "arm-smmu-v3",
 		.of_match_table	= of_match_ptr(arm_smmu_of_match),
+		.suppress_bind_attrs = true,
 	},
 	.probe	= arm_smmu_device_probe,
-	.remove	= arm_smmu_device_remove,
 	.shutdown = arm_smmu_device_shutdown,
 };
-module_platform_driver(arm_smmu_driver);
-
-MODULE_DESCRIPTION("IOMMU API for ARM architected SMMUv3 implementations");
-MODULE_AUTHOR("Will Deacon <will.deacon@arm.com>");
-MODULE_LICENSE("GPL v2");
+builtin_platform_driver(arm_smmu_driver);
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 52+ messages in thread

* [PATCH 9/9] iommu: arm-smmu-v3: make it explicitly non-modular
@ 2018-11-26 22:31   ` Paul Gortmaker
  0 siblings, 0 replies; 52+ messages in thread
From: Paul Gortmaker @ 2018-11-26 22:31 UTC (permalink / raw)
  To: Joerg Roedel
  Cc: Will Deacon, linux-kernel-u79uwXL29TY76Z2rM5mHXA, Paul Gortmaker,
	iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, Robin Murphy

The Kconfig currently controlling compilation of this code is:

drivers/iommu/Kconfig:config ARM_SMMU_V3
drivers/iommu/Kconfig:  bool "ARM Ltd. System MMU Version 3 (SMMUv3) Support"

...meaning that it currently is not being built as a module by anyone.

Lets remove the modular code that is essentially orphaned, so that
when reading the driver there is no doubt it is builtin-only.

Since module_platform_driver() uses the same init level priority as
builtin_platform_driver() the init ordering remains unchanged with
this commit.

We explicitly disallow a driver unbind, since that doesn't have a
sensible use case anyway, but unlike most drivers, we can't delete the
function tied to the ".remove" field.  This is because as of commit
7aa8619a66ae ("iommu/arm-smmu-v3: Implement shutdown method") the
.remove function was given a one line wrapper and re-used to provide a
.shutdown service.  So we delete the wrapper and re-name the function
from remove to shutdown.

We add a moduleparam.h include since the file does actually declare
some module parameters, and leaving them as such is the easiest way
currently to remain backwards compatible with existing use cases.

Also note that MODULE_DEVICE_TABLE is a no-op for non-modular code.

We also delete the MODULE_LICENSE tag etc. since all that information
is already contained at the top of the file in the comments.

Cc: Will Deacon <will.deacon-5wv7dgnIgG8@public.gmane.org>
Cc: Joerg Roedel <joro-zLv9SwRftAIdnm+yROfE0A@public.gmane.org>
Cc: Robin Murphy <robin.murphy-5wv7dgnIgG8@public.gmane.org>
Cc: Nate Watterson <nwatters-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
Cc: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
Cc: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org
Signed-off-by: Paul Gortmaker <paul.gortmaker-CWA4WttNNZF54TAoqtyWWQ@public.gmane.org>
---
 drivers/iommu/arm-smmu-v3.c | 25 +++++++++----------------
 1 file changed, 9 insertions(+), 16 deletions(-)

diff --git a/drivers/iommu/arm-smmu-v3.c b/drivers/iommu/arm-smmu-v3.c
index 6947ccf26512..1189c06079d4 100644
--- a/drivers/iommu/arm-smmu-v3.c
+++ b/drivers/iommu/arm-smmu-v3.c
@@ -20,7 +20,8 @@
 #include <linux/interrupt.h>
 #include <linux/iommu.h>
 #include <linux/iopoll.h>
-#include <linux/module.h>
+#include <linux/init.h>
+#include <linux/moduleparam.h>
 #include <linux/msi.h>
 #include <linux/of.h>
 #include <linux/of_address.h>
@@ -356,6 +357,10 @@
 #define MSI_IOVA_BASE			0x8000000
 #define MSI_IOVA_LENGTH			0x100000
 
+/*
+ * not really modular, but the easiest way to keep compat with existing
+ * bootargs behaviour is to continue using module_param_named here.
+ */
 static bool disable_bypass = 1;
 module_param_named(disable_bypass, disable_bypass, bool, S_IRUGO);
 MODULE_PARM_DESC(disable_bypass,
@@ -2928,37 +2933,25 @@ static int arm_smmu_device_probe(struct platform_device *pdev)
 	return 0;
 }
 
-static int arm_smmu_device_remove(struct platform_device *pdev)
+static void arm_smmu_device_shutdown(struct platform_device *pdev)
 {
 	struct arm_smmu_device *smmu = platform_get_drvdata(pdev);
 
 	arm_smmu_device_disable(smmu);
-
-	return 0;
-}
-
-static void arm_smmu_device_shutdown(struct platform_device *pdev)
-{
-	arm_smmu_device_remove(pdev);
 }
 
 static const struct of_device_id arm_smmu_of_match[] = {
 	{ .compatible = "arm,smmu-v3", },
 	{ },
 };
-MODULE_DEVICE_TABLE(of, arm_smmu_of_match);
 
 static struct platform_driver arm_smmu_driver = {
 	.driver	= {
 		.name		= "arm-smmu-v3",
 		.of_match_table	= of_match_ptr(arm_smmu_of_match),
+		.suppress_bind_attrs = true,
 	},
 	.probe	= arm_smmu_device_probe,
-	.remove	= arm_smmu_device_remove,
 	.shutdown = arm_smmu_device_shutdown,
 };
-module_platform_driver(arm_smmu_driver);
-
-MODULE_DESCRIPTION("IOMMU API for ARM architected SMMUv3 implementations");
-MODULE_AUTHOR("Will Deacon <will.deacon-5wv7dgnIgG8@public.gmane.org>");
-MODULE_LICENSE("GPL v2");
+builtin_platform_driver(arm_smmu_driver);
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 52+ messages in thread

* [PATCH 9/9] iommu: arm-smmu-v3: make it explicitly non-modular
@ 2018-11-26 22:31   ` Paul Gortmaker
  0 siblings, 0 replies; 52+ messages in thread
From: Paul Gortmaker @ 2018-11-26 22:31 UTC (permalink / raw)
  To: linux-arm-kernel

The Kconfig currently controlling compilation of this code is:

drivers/iommu/Kconfig:config ARM_SMMU_V3
drivers/iommu/Kconfig:  bool "ARM Ltd. System MMU Version 3 (SMMUv3) Support"

...meaning that it currently is not being built as a module by anyone.

Lets remove the modular code that is essentially orphaned, so that
when reading the driver there is no doubt it is builtin-only.

Since module_platform_driver() uses the same init level priority as
builtin_platform_driver() the init ordering remains unchanged with
this commit.

We explicitly disallow a driver unbind, since that doesn't have a
sensible use case anyway, but unlike most drivers, we can't delete the
function tied to the ".remove" field.  This is because as of commit
7aa8619a66ae ("iommu/arm-smmu-v3: Implement shutdown method") the
.remove function was given a one line wrapper and re-used to provide a
.shutdown service.  So we delete the wrapper and re-name the function
from remove to shutdown.

We add a moduleparam.h include since the file does actually declare
some module parameters, and leaving them as such is the easiest way
currently to remain backwards compatible with existing use cases.

Also note that MODULE_DEVICE_TABLE is a no-op for non-modular code.

We also delete the MODULE_LICENSE tag etc. since all that information
is already contained at the top of the file in the comments.

Cc: Will Deacon <will.deacon@arm.com>
Cc: Joerg Roedel <joro@8bytes.org>
Cc: Robin Murphy <robin.murphy@arm.com>
Cc: Nate Watterson <nwatters@codeaurora.org>
Cc: linux-arm-kernel at lists.infradead.org
Cc: iommu at lists.linux-foundation.org
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
 drivers/iommu/arm-smmu-v3.c | 25 +++++++++----------------
 1 file changed, 9 insertions(+), 16 deletions(-)

diff --git a/drivers/iommu/arm-smmu-v3.c b/drivers/iommu/arm-smmu-v3.c
index 6947ccf26512..1189c06079d4 100644
--- a/drivers/iommu/arm-smmu-v3.c
+++ b/drivers/iommu/arm-smmu-v3.c
@@ -20,7 +20,8 @@
 #include <linux/interrupt.h>
 #include <linux/iommu.h>
 #include <linux/iopoll.h>
-#include <linux/module.h>
+#include <linux/init.h>
+#include <linux/moduleparam.h>
 #include <linux/msi.h>
 #include <linux/of.h>
 #include <linux/of_address.h>
@@ -356,6 +357,10 @@
 #define MSI_IOVA_BASE			0x8000000
 #define MSI_IOVA_LENGTH			0x100000
 
+/*
+ * not really modular, but the easiest way to keep compat with existing
+ * bootargs behaviour is to continue using module_param_named here.
+ */
 static bool disable_bypass = 1;
 module_param_named(disable_bypass, disable_bypass, bool, S_IRUGO);
 MODULE_PARM_DESC(disable_bypass,
@@ -2928,37 +2933,25 @@ static int arm_smmu_device_probe(struct platform_device *pdev)
 	return 0;
 }
 
-static int arm_smmu_device_remove(struct platform_device *pdev)
+static void arm_smmu_device_shutdown(struct platform_device *pdev)
 {
 	struct arm_smmu_device *smmu = platform_get_drvdata(pdev);
 
 	arm_smmu_device_disable(smmu);
-
-	return 0;
-}
-
-static void arm_smmu_device_shutdown(struct platform_device *pdev)
-{
-	arm_smmu_device_remove(pdev);
 }
 
 static const struct of_device_id arm_smmu_of_match[] = {
 	{ .compatible = "arm,smmu-v3", },
 	{ },
 };
-MODULE_DEVICE_TABLE(of, arm_smmu_of_match);
 
 static struct platform_driver arm_smmu_driver = {
 	.driver	= {
 		.name		= "arm-smmu-v3",
 		.of_match_table	= of_match_ptr(arm_smmu_of_match),
+		.suppress_bind_attrs = true,
 	},
 	.probe	= arm_smmu_device_probe,
-	.remove	= arm_smmu_device_remove,
 	.shutdown = arm_smmu_device_shutdown,
 };
-module_platform_driver(arm_smmu_driver);
-
-MODULE_DESCRIPTION("IOMMU API for ARM architected SMMUv3 implementations");
-MODULE_AUTHOR("Will Deacon <will.deacon@arm.com>");
-MODULE_LICENSE("GPL v2");
+builtin_platform_driver(arm_smmu_driver);
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 52+ messages in thread

* Re: [PATCH 2/9] iommu: rockchip: make it explicitly non-modular
@ 2018-11-26 23:37     ` Heiko Stuebner
  0 siblings, 0 replies; 52+ messages in thread
From: Heiko Stuebner @ 2018-11-26 23:37 UTC (permalink / raw)
  To: Paul Gortmaker
  Cc: Joerg Roedel, iommu, linux-kernel, Simon Xue, Daniel Kurtz,
	Jeffy Chen, linux-arm-kernel, linux-rockchip

Am Montag, 26. November 2018, 23:31:31 CET schrieb Paul Gortmaker:
> The Kconfig currently controlling compilation of this code is:
> 
> drivers/iommu/Kconfig:config ROCKCHIP_IOMMU
> drivers/iommu/Kconfig:  bool "Rockchip IOMMU Support"
> 
> ...meaning that it currently is not being built as a module by anyone.
> 
> The bind/unbind/remove was already explicitly disabled in commit
> 98b72b94def9 ("iommu/rockchip: Prohibit unbind and remove").
> 
> Lets remove the remaining traces of  modular infrastructure, so that
> when reading the driver there is no doubt it is builtin-only.
> 
> Since module_init was not in use by this code, the init ordering
> remains unchanged with this commit.
> 
> Also note that MODULE_DEVICE_TABLE is a no-op for non-modular code.
> 
> We also delete the MODULE_LICENSE tag etc. since all that information
> was (or is now) contained at the top of the file in the comments.
> 
> Cc: Joerg Roedel <joro@8bytes.org>
> Cc: Heiko Stuebner <heiko@sntech.de>
> Cc: Simon Xue <xxm@rock-chips.com>
> Cc: Daniel Kurtz <djkurtz@chromium.org>
> Cc: Jeffy Chen <jeffy.chen@rock-chips.com>
> Cc: iommu@lists.linux-foundation.org
> Cc: linux-arm-kernel@lists.infradead.org
> Cc: linux-rockchip@lists.infradead.org
> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>

Acked-by: Heiko Stuebner <heiko@sntech.de>



^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: [PATCH 2/9] iommu: rockchip: make it explicitly non-modular
@ 2018-11-26 23:37     ` Heiko Stuebner
  0 siblings, 0 replies; 52+ messages in thread
From: Heiko Stuebner @ 2018-11-26 23:37 UTC (permalink / raw)
  To: Paul Gortmaker
  Cc: Jeffy Chen, linux-kernel-u79uwXL29TY76Z2rM5mHXA, Daniel Kurtz,
	linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

Am Montag, 26. November 2018, 23:31:31 CET schrieb Paul Gortmaker:
> The Kconfig currently controlling compilation of this code is:
> 
> drivers/iommu/Kconfig:config ROCKCHIP_IOMMU
> drivers/iommu/Kconfig:  bool "Rockchip IOMMU Support"
> 
> ...meaning that it currently is not being built as a module by anyone.
> 
> The bind/unbind/remove was already explicitly disabled in commit
> 98b72b94def9 ("iommu/rockchip: Prohibit unbind and remove").
> 
> Lets remove the remaining traces of  modular infrastructure, so that
> when reading the driver there is no doubt it is builtin-only.
> 
> Since module_init was not in use by this code, the init ordering
> remains unchanged with this commit.
> 
> Also note that MODULE_DEVICE_TABLE is a no-op for non-modular code.
> 
> We also delete the MODULE_LICENSE tag etc. since all that information
> was (or is now) contained at the top of the file in the comments.
> 
> Cc: Joerg Roedel <joro-zLv9SwRftAIdnm+yROfE0A@public.gmane.org>
> Cc: Heiko Stuebner <heiko-4mtYJXux2i+zQB+pC5nmwQ@public.gmane.org>
> Cc: Simon Xue <xxm-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
> Cc: Daniel Kurtz <djkurtz-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
> Cc: Jeffy Chen <jeffy.chen-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
> Cc: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org
> Cc: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
> Cc: linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
> Signed-off-by: Paul Gortmaker <paul.gortmaker-CWA4WttNNZF54TAoqtyWWQ@public.gmane.org>

Acked-by: Heiko Stuebner <heiko-4mtYJXux2i+zQB+pC5nmwQ@public.gmane.org>

^ permalink raw reply	[flat|nested] 52+ messages in thread

* [PATCH 2/9] iommu: rockchip: make it explicitly non-modular
@ 2018-11-26 23:37     ` Heiko Stuebner
  0 siblings, 0 replies; 52+ messages in thread
From: Heiko Stuebner @ 2018-11-26 23:37 UTC (permalink / raw)
  To: linux-arm-kernel

Am Montag, 26. November 2018, 23:31:31 CET schrieb Paul Gortmaker:
> The Kconfig currently controlling compilation of this code is:
> 
> drivers/iommu/Kconfig:config ROCKCHIP_IOMMU
> drivers/iommu/Kconfig:  bool "Rockchip IOMMU Support"
> 
> ...meaning that it currently is not being built as a module by anyone.
> 
> The bind/unbind/remove was already explicitly disabled in commit
> 98b72b94def9 ("iommu/rockchip: Prohibit unbind and remove").
> 
> Lets remove the remaining traces of  modular infrastructure, so that
> when reading the driver there is no doubt it is builtin-only.
> 
> Since module_init was not in use by this code, the init ordering
> remains unchanged with this commit.
> 
> Also note that MODULE_DEVICE_TABLE is a no-op for non-modular code.
> 
> We also delete the MODULE_LICENSE tag etc. since all that information
> was (or is now) contained at the top of the file in the comments.
> 
> Cc: Joerg Roedel <joro@8bytes.org>
> Cc: Heiko Stuebner <heiko@sntech.de>
> Cc: Simon Xue <xxm@rock-chips.com>
> Cc: Daniel Kurtz <djkurtz@chromium.org>
> Cc: Jeffy Chen <jeffy.chen@rock-chips.com>
> Cc: iommu at lists.linux-foundation.org
> Cc: linux-arm-kernel at lists.infradead.org
> Cc: linux-rockchip at lists.infradead.org
> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>

Acked-by: Heiko Stuebner <heiko@sntech.de>

^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: [PATCH 4/9] iommu: mtk_iommu: make it explicitly non-modular
  2018-11-26 22:31   ` Paul Gortmaker
@ 2018-11-27  1:25     ` Honghui Zhang
  -1 siblings, 0 replies; 52+ messages in thread
From: Honghui Zhang @ 2018-11-27  1:25 UTC (permalink / raw)
  To: Paul Gortmaker
  Cc: Joerg Roedel, iommu, linux-kernel, Matthias Brugger, linux-mediatek

On Mon, 2018-11-26 at 17:31 -0500, Paul Gortmaker wrote:
> The Kconfig currently controlling compilation of this code is:
> 
> drivers/iommu/Kconfig:config MTK_IOMMU_V1
> drivers/iommu/Kconfig:  bool "MTK IOMMU Version 1 (M4U gen1) Support"
> 
> ...meaning that it currently is not being built as a module by anyone.
> 
> Lets remove the modular code that is essentially orphaned, so that
> when reading the driver there is no doubt it is builtin-only.
> 
> Since module_init was not even used by this driver, the init ordering
> remains unchanged with this commit.
> 
> We also delete the MODULE_LICENSE tag etc. since all that information
> was (or is now) contained at the top of the file in the comments.
> 
> Cc: Joerg Roedel <joro@8bytes.org>
> Cc: Matthias Brugger <matthias.bgg@gmail.com>
> Cc: Honghui Zhang <honghui.zhang@mediatek.com>
> Cc: iommu@lists.linux-foundation.org
> Cc: linux-mediatek@lists.infradead.org
> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
> ---
>  drivers/iommu/mtk_iommu_v1.c | 15 +++------------
>  1 file changed, 3 insertions(+), 12 deletions(-)
> 
> diff --git a/drivers/iommu/mtk_iommu_v1.c b/drivers/iommu/mtk_iommu_v1.c
> index 27867b862d7a..5fbf3cecb87f 100644
> --- a/drivers/iommu/mtk_iommu_v1.c
> +++ b/drivers/iommu/mtk_iommu_v1.c
> @@ -1,4 +1,6 @@
>  /*
> + * IOMMU API for MTK architected m4u v1 implementations
> + *
>   * Copyright (c) 2015-2016 MediaTek Inc.
>   * Author: Honghui Zhang <honghui.zhang@mediatek.com>
>   *
> @@ -35,7 +37,7 @@
>  #include <linux/spinlock.h>
>  #include <asm/barrier.h>
>  #include <asm/dma-iommu.h>
> -#include <linux/module.h>
> +#include <linux/init.h>
>  #include <dt-bindings/memory/mt2701-larb-port.h>
>  #include <soc/mediatek/smi.h>
>  #include "mtk_iommu.h"
> @@ -704,15 +706,4 @@ static int __init m4u_init(void)
>  {
>  	return platform_driver_register(&mtk_iommu_driver);
>  }
> -
> -static void __exit m4u_exit(void)
> -{
> -	return platform_driver_unregister(&mtk_iommu_driver);
> -}
> -
>  subsys_initcall(m4u_init);
> -module_exit(m4u_exit);
> -
> -MODULE_DESCRIPTION("IOMMU API for MTK architected m4u v1 implementations");
> -MODULE_AUTHOR("Honghui Zhang <honghui.zhang@mediatek.com>");
> -MODULE_LICENSE("GPL v2");

Hi, Paul,
Thanks for your patch.

I would like the patch tile be:
iommu/mediatek: make it explicitly non-modular

except that,

Acked-by: Honghui Zhang <honghui.zhang@mediatek.com>



^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: [PATCH 4/9] iommu: mtk_iommu: make it explicitly non-modular
@ 2018-11-27  1:25     ` Honghui Zhang
  0 siblings, 0 replies; 52+ messages in thread
From: Honghui Zhang @ 2018-11-27  1:25 UTC (permalink / raw)
  To: Paul Gortmaker
  Cc: Joerg Roedel, iommu, linux-kernel, Matthias Brugger, linux-mediatek

On Mon, 2018-11-26 at 17:31 -0500, Paul Gortmaker wrote:
> The Kconfig currently controlling compilation of this code is:
> 
> drivers/iommu/Kconfig:config MTK_IOMMU_V1
> drivers/iommu/Kconfig:  bool "MTK IOMMU Version 1 (M4U gen1) Support"
> 
> ...meaning that it currently is not being built as a module by anyone.
> 
> Lets remove the modular code that is essentially orphaned, so that
> when reading the driver there is no doubt it is builtin-only.
> 
> Since module_init was not even used by this driver, the init ordering
> remains unchanged with this commit.
> 
> We also delete the MODULE_LICENSE tag etc. since all that information
> was (or is now) contained at the top of the file in the comments.
> 
> Cc: Joerg Roedel <joro@8bytes.org>
> Cc: Matthias Brugger <matthias.bgg@gmail.com>
> Cc: Honghui Zhang <honghui.zhang@mediatek.com>
> Cc: iommu@lists.linux-foundation.org
> Cc: linux-mediatek@lists.infradead.org
> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
> ---
>  drivers/iommu/mtk_iommu_v1.c | 15 +++------------
>  1 file changed, 3 insertions(+), 12 deletions(-)
> 
> diff --git a/drivers/iommu/mtk_iommu_v1.c b/drivers/iommu/mtk_iommu_v1.c
> index 27867b862d7a..5fbf3cecb87f 100644
> --- a/drivers/iommu/mtk_iommu_v1.c
> +++ b/drivers/iommu/mtk_iommu_v1.c
> @@ -1,4 +1,6 @@
>  /*
> + * IOMMU API for MTK architected m4u v1 implementations
> + *
>   * Copyright (c) 2015-2016 MediaTek Inc.
>   * Author: Honghui Zhang <honghui.zhang@mediatek.com>
>   *
> @@ -35,7 +37,7 @@
>  #include <linux/spinlock.h>
>  #include <asm/barrier.h>
>  #include <asm/dma-iommu.h>
> -#include <linux/module.h>
> +#include <linux/init.h>
>  #include <dt-bindings/memory/mt2701-larb-port.h>
>  #include <soc/mediatek/smi.h>
>  #include "mtk_iommu.h"
> @@ -704,15 +706,4 @@ static int __init m4u_init(void)
>  {
>  	return platform_driver_register(&mtk_iommu_driver);
>  }
> -
> -static void __exit m4u_exit(void)
> -{
> -	return platform_driver_unregister(&mtk_iommu_driver);
> -}
> -
>  subsys_initcall(m4u_init);
> -module_exit(m4u_exit);
> -
> -MODULE_DESCRIPTION("IOMMU API for MTK architected m4u v1 implementations");
> -MODULE_AUTHOR("Honghui Zhang <honghui.zhang@mediatek.com>");
> -MODULE_LICENSE("GPL v2");

Hi, Paul,
Thanks for your patch.

I would like the patch tile be:
iommu/mediatek: make it explicitly non-modular

except that,

Acked-by: Honghui Zhang <honghui.zhang@mediatek.com>

^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: [PATCH 0/9] iommu: clean up/remove modular stuff from non-modules.
  2018-11-26 22:31 ` Paul Gortmaker
  (?)
@ 2018-11-27 10:11   ` Joerg Roedel
  -1 siblings, 0 replies; 52+ messages in thread
From: Joerg Roedel @ 2018-11-27 10:11 UTC (permalink / raw)
  To: Paul Gortmaker
  Cc: iommu, linux-kernel, Alexandre Courbot, Daniel Kurtz,
	Heiko Stuebner, Hiroshi Doyu, Honghui Zhang, Jeffy Chen,
	Laurent Pinchart, Matthias Brugger, Nate Watterson, Rob Clark,
	Robin Murphy, Simon Xue, Stepan Moskovchenko, Stephen Warren,
	Thierry Reding, Will Deacon, linux-arm-kernel, linux-arm-msm

Hi Paul,

thanks for your cleanup!

The iommu-tree uses another rule for the subject line of patches. Can
you please resend with correct subject lines? See below for what is
used.

The general format is:

	iommu/<driver>: _C_apital letter starting subject

Please also collect the Acks you get and add them to the patches before
the resend.

On Mon, Nov 26, 2018 at 05:31:29PM -0500, Paul Gortmaker wrote:
> Paul Gortmaker (9):
>   iommu: audit and remove any unnecessary uses of module.h
Fine.
>   iommu: rockchip: make it explicitly non-modular
	iommu/rockchip: Make it explicitly non-modular
>   iommu: msm_iommu: make it explicitly non-modular
	iommu/msm: Make it explicitly non-modular
>   iommu: mtk_iommu: make it explicitly non-modular
	iommu/mediatek: Make it explicitly non-modular
>   iommu: ipmmu-vmsa: make it explicitly non-modular
	iommu/ipmmu-vmsa: Make it explicitly non-modular
>   iommu: qcom_iommu: make it explicitly non-modular
	iommu/qcom: Make it explicitly non-modular
>   iommu: tegra-gart: make it explicitly non-modular
	iommu/tegra: Make it explicitly non-modular
>   iommu: arm-smmu: make it explicitly non-modular
	iommu/arm-smmu: Make arm-smmu explicitly non-modular
>   iommu: arm-smmu-v3: make it explicitly non-modular
	iommu/arm-smmu: Make arm-smmu-v3 explicitly non-modular

Thanks a lot,

       Joerg

^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: [PATCH 0/9] iommu: clean up/remove modular stuff from non-modules.
@ 2018-11-27 10:11   ` Joerg Roedel
  0 siblings, 0 replies; 52+ messages in thread
From: Joerg Roedel @ 2018-11-27 10:11 UTC (permalink / raw)
  To: Paul Gortmaker
  Cc: iommu, linux-kernel, Alexandre Courbot, Daniel Kurtz,
	Heiko Stuebner, Hiroshi Doyu, Honghui Zhang, Jeffy Chen,
	Laurent Pinchart, Matthias Brugger, Nate Watterson, Rob Clark,
	Robin Murphy, Simon Xue, Stepan Moskovchenko, Stephen Warren,
	Thierry Reding, Will Deacon, linux-arm-kernel, linux-arm-msm,
	linux-mediatek, linux-rockchip, linux-tegra

Hi Paul,

thanks for your cleanup!

The iommu-tree uses another rule for the subject line of patches. Can
you please resend with correct subject lines? See below for what is
used.

The general format is:

	iommu/<driver>: _C_apital letter starting subject

Please also collect the Acks you get and add them to the patches before
the resend.

On Mon, Nov 26, 2018 at 05:31:29PM -0500, Paul Gortmaker wrote:
> Paul Gortmaker (9):
>   iommu: audit and remove any unnecessary uses of module.h
Fine.
>   iommu: rockchip: make it explicitly non-modular
	iommu/rockchip: Make it explicitly non-modular
>   iommu: msm_iommu: make it explicitly non-modular
	iommu/msm: Make it explicitly non-modular
>   iommu: mtk_iommu: make it explicitly non-modular
	iommu/mediatek: Make it explicitly non-modular
>   iommu: ipmmu-vmsa: make it explicitly non-modular
	iommu/ipmmu-vmsa: Make it explicitly non-modular
>   iommu: qcom_iommu: make it explicitly non-modular
	iommu/qcom: Make it explicitly non-modular
>   iommu: tegra-gart: make it explicitly non-modular
	iommu/tegra: Make it explicitly non-modular
>   iommu: arm-smmu: make it explicitly non-modular
	iommu/arm-smmu: Make arm-smmu explicitly non-modular
>   iommu: arm-smmu-v3: make it explicitly non-modular
	iommu/arm-smmu: Make arm-smmu-v3 explicitly non-modular

Thanks a lot,

       Joerg

^ permalink raw reply	[flat|nested] 52+ messages in thread

* [PATCH 0/9] iommu: clean up/remove modular stuff from non-modules.
@ 2018-11-27 10:11   ` Joerg Roedel
  0 siblings, 0 replies; 52+ messages in thread
From: Joerg Roedel @ 2018-11-27 10:11 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Paul,

thanks for your cleanup!

The iommu-tree uses another rule for the subject line of patches. Can
you please resend with correct subject lines? See below for what is
used.

The general format is:

	iommu/<driver>: _C_apital letter starting subject

Please also collect the Acks you get and add them to the patches before
the resend.

On Mon, Nov 26, 2018 at 05:31:29PM -0500, Paul Gortmaker wrote:
> Paul Gortmaker (9):
>   iommu: audit and remove any unnecessary uses of module.h
Fine.
>   iommu: rockchip: make it explicitly non-modular
	iommu/rockchip: Make it explicitly non-modular
>   iommu: msm_iommu: make it explicitly non-modular
	iommu/msm: Make it explicitly non-modular
>   iommu: mtk_iommu: make it explicitly non-modular
	iommu/mediatek: Make it explicitly non-modular
>   iommu: ipmmu-vmsa: make it explicitly non-modular
	iommu/ipmmu-vmsa: Make it explicitly non-modular
>   iommu: qcom_iommu: make it explicitly non-modular
	iommu/qcom: Make it explicitly non-modular
>   iommu: tegra-gart: make it explicitly non-modular
	iommu/tegra: Make it explicitly non-modular
>   iommu: arm-smmu: make it explicitly non-modular
	iommu/arm-smmu: Make arm-smmu explicitly non-modular
>   iommu: arm-smmu-v3: make it explicitly non-modular
	iommu/arm-smmu: Make arm-smmu-v3 explicitly non-modular

Thanks a lot,

       Joerg

^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: [PATCH 7/9] iommu: tegra-gart: make it explicitly non-modular
  2018-11-26 22:31     ` Paul Gortmaker
  (?)
@ 2018-11-27 14:18     ` Thierry Reding
  -1 siblings, 0 replies; 52+ messages in thread
From: Thierry Reding @ 2018-11-27 14:18 UTC (permalink / raw)
  To: Paul Gortmaker
  Cc: Joerg Roedel, iommu, linux-kernel, Hiroshi Doyu, Stephen Warren,
	Alexandre Courbot, linux-tegra

[-- Attachment #1: Type: text/plain, Size: 1719 bytes --]

On Mon, Nov 26, 2018 at 05:31:36PM -0500, Paul Gortmaker wrote:
> The Kconfig currently controlling compilation of this code is:
> 
> drivers/iommu/Kconfig:config TEGRA_IOMMU_GART
> drivers/iommu/Kconfig:  bool "Tegra GART IOMMU Support"
> 
> ...meaning that it currently is not being built as a module by anyone.
> 
> Lets remove the modular code that is essentially orphaned, so that
> when reading the driver there is no doubt it is builtin-only.
> 
> We explicitly disallow a driver unbind, since that doesn't have a
> sensible use case anyway, and it allows us to drop the ".remove"
> code for non-modular drivers.
> 
> Since module_init was not in use by this code, the init ordering
> remains unchanged with this commit.
> 
> We replace module.h with moduleparam.h since the file does actually
> declare some module_param() and the easiest way to keep back
> compatibility with existing use cases is to leave it as-is for now.
> 
> The init function was missing an __init annotation, so it was added.
> 
> We also delete the MODULE_LICENSE tag etc. since all that information
> was (or is now) contained at the top of the file in the comments.
> 
> Cc: Hiroshi Doyu <hdoyu@nvidia.com>
> Cc: Joerg Roedel <joro@8bytes.org>
> Cc: Stephen Warren <swarren@wwwdotorg.org>
> Cc: Thierry Reding <thierry.reding@gmail.com>
> Cc: Alexandre Courbot <gnurou@gmail.com>
> Cc: iommu@lists.linux-foundation.org
> Cc: linux-tegra@vger.kernel.org
> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
> ---
>  drivers/iommu/tegra-gart.c | 37 +++++++------------------------------
>  1 file changed, 7 insertions(+), 30 deletions(-)

Acked-by: Thierry Reding <treding@nvidia.com>

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: [PATCH 0/9] iommu: clean up/remove modular stuff from non-modules.
  2018-11-27 10:11   ` Joerg Roedel
  (?)
@ 2018-11-27 14:39       ` Paul Gortmaker
  -1 siblings, 0 replies; 52+ messages in thread
From: Paul Gortmaker @ 2018-11-27 14:39 UTC (permalink / raw)
  To: Joerg Roedel
  Cc: Heiko Stuebner, Will Deacon, Daniel Kurtz,
	linux-tegra-u79uwXL29TY76Z2rM5mHXA, Thierry Reding,
	Laurent Pinchart, Alexandre Courbot,
	linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, Stephen Warren,
	linux-arm-msm-u79uwXL29TY76Z2rM5mHXA, Jeffy Chen,
	linux-mediatek-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	Stepan Moskovchenko, Matthias Brugger,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA, Robin Murphy,
	Hiroshi Doyu

[Re: [PATCH 0/9] iommu: clean up/remove modular stuff from non-modules.] On 27/11/2018 (Tue 11:11) Joerg Roedel wrote:

> Hi Paul,
> 
> thanks for your cleanup!
> 
> The iommu-tree uses another rule for the subject line of patches. Can
> you please resend with correct subject lines? See below for what is
> used.

Sure - I'll wait another day or two in case anyone on the Cc sends in
some additional Acks.

Thanks,
Paul.
--

> 
> The general format is:
> 
> 	iommu/<driver>: _C_apital letter starting subject
> 
> Please also collect the Acks you get and add them to the patches before
> the resend.
> 
> On Mon, Nov 26, 2018 at 05:31:29PM -0500, Paul Gortmaker wrote:
> > Paul Gortmaker (9):
> >   iommu: audit and remove any unnecessary uses of module.h
> Fine.
> >   iommu: rockchip: make it explicitly non-modular
> 	iommu/rockchip: Make it explicitly non-modular
> >   iommu: msm_iommu: make it explicitly non-modular
> 	iommu/msm: Make it explicitly non-modular
> >   iommu: mtk_iommu: make it explicitly non-modular
> 	iommu/mediatek: Make it explicitly non-modular
> >   iommu: ipmmu-vmsa: make it explicitly non-modular
> 	iommu/ipmmu-vmsa: Make it explicitly non-modular
> >   iommu: qcom_iommu: make it explicitly non-modular
> 	iommu/qcom: Make it explicitly non-modular
> >   iommu: tegra-gart: make it explicitly non-modular
> 	iommu/tegra: Make it explicitly non-modular
> >   iommu: arm-smmu: make it explicitly non-modular
> 	iommu/arm-smmu: Make arm-smmu explicitly non-modular
> >   iommu: arm-smmu-v3: make it explicitly non-modular
> 	iommu/arm-smmu: Make arm-smmu-v3 explicitly non-modular
> 
> Thanks a lot,
> 
>        Joerg

^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: [PATCH 0/9] iommu: clean up/remove modular stuff from non-modules.
@ 2018-11-27 14:39       ` Paul Gortmaker
  0 siblings, 0 replies; 52+ messages in thread
From: Paul Gortmaker @ 2018-11-27 14:39 UTC (permalink / raw)
  To: Joerg Roedel
  Cc: iommu, linux-kernel, Alexandre Courbot, Daniel Kurtz,
	Heiko Stuebner, Hiroshi Doyu, Honghui Zhang, Jeffy Chen,
	Laurent Pinchart, Matthias Brugger, Nate Watterson, Rob Clark,
	Robin Murphy, Simon Xue, Stepan Moskovchenko, Stephen Warren,
	Thierry Reding, Will Deacon, linux-arm-kernel, linux-arm-msm,
	linux-mediatek, linux-rockchip, linux-tegra

[Re: [PATCH 0/9] iommu: clean up/remove modular stuff from non-modules.] On 27/11/2018 (Tue 11:11) Joerg Roedel wrote:

> Hi Paul,
> 
> thanks for your cleanup!
> 
> The iommu-tree uses another rule for the subject line of patches. Can
> you please resend with correct subject lines? See below for what is
> used.

Sure - I'll wait another day or two in case anyone on the Cc sends in
some additional Acks.

Thanks,
Paul.
--

> 
> The general format is:
> 
> 	iommu/<driver>: _C_apital letter starting subject
> 
> Please also collect the Acks you get and add them to the patches before
> the resend.
> 
> On Mon, Nov 26, 2018 at 05:31:29PM -0500, Paul Gortmaker wrote:
> > Paul Gortmaker (9):
> >   iommu: audit and remove any unnecessary uses of module.h
> Fine.
> >   iommu: rockchip: make it explicitly non-modular
> 	iommu/rockchip: Make it explicitly non-modular
> >   iommu: msm_iommu: make it explicitly non-modular
> 	iommu/msm: Make it explicitly non-modular
> >   iommu: mtk_iommu: make it explicitly non-modular
> 	iommu/mediatek: Make it explicitly non-modular
> >   iommu: ipmmu-vmsa: make it explicitly non-modular
> 	iommu/ipmmu-vmsa: Make it explicitly non-modular
> >   iommu: qcom_iommu: make it explicitly non-modular
> 	iommu/qcom: Make it explicitly non-modular
> >   iommu: tegra-gart: make it explicitly non-modular
> 	iommu/tegra: Make it explicitly non-modular
> >   iommu: arm-smmu: make it explicitly non-modular
> 	iommu/arm-smmu: Make arm-smmu explicitly non-modular
> >   iommu: arm-smmu-v3: make it explicitly non-modular
> 	iommu/arm-smmu: Make arm-smmu-v3 explicitly non-modular
> 
> Thanks a lot,
> 
>        Joerg

^ permalink raw reply	[flat|nested] 52+ messages in thread

* [PATCH 0/9] iommu: clean up/remove modular stuff from non-modules.
@ 2018-11-27 14:39       ` Paul Gortmaker
  0 siblings, 0 replies; 52+ messages in thread
From: Paul Gortmaker @ 2018-11-27 14:39 UTC (permalink / raw)
  To: linux-arm-kernel

[Re: [PATCH 0/9] iommu: clean up/remove modular stuff from non-modules.] On 27/11/2018 (Tue 11:11) Joerg Roedel wrote:

> Hi Paul,
> 
> thanks for your cleanup!
> 
> The iommu-tree uses another rule for the subject line of patches. Can
> you please resend with correct subject lines? See below for what is
> used.

Sure - I'll wait another day or two in case anyone on the Cc sends in
some additional Acks.

Thanks,
Paul.
--

> 
> The general format is:
> 
> 	iommu/<driver>: _C_apital letter starting subject
> 
> Please also collect the Acks you get and add them to the patches before
> the resend.
> 
> On Mon, Nov 26, 2018 at 05:31:29PM -0500, Paul Gortmaker wrote:
> > Paul Gortmaker (9):
> >   iommu: audit and remove any unnecessary uses of module.h
> Fine.
> >   iommu: rockchip: make it explicitly non-modular
> 	iommu/rockchip: Make it explicitly non-modular
> >   iommu: msm_iommu: make it explicitly non-modular
> 	iommu/msm: Make it explicitly non-modular
> >   iommu: mtk_iommu: make it explicitly non-modular
> 	iommu/mediatek: Make it explicitly non-modular
> >   iommu: ipmmu-vmsa: make it explicitly non-modular
> 	iommu/ipmmu-vmsa: Make it explicitly non-modular
> >   iommu: qcom_iommu: make it explicitly non-modular
> 	iommu/qcom: Make it explicitly non-modular
> >   iommu: tegra-gart: make it explicitly non-modular
> 	iommu/tegra: Make it explicitly non-modular
> >   iommu: arm-smmu: make it explicitly non-modular
> 	iommu/arm-smmu: Make arm-smmu explicitly non-modular
> >   iommu: arm-smmu-v3: make it explicitly non-modular
> 	iommu/arm-smmu: Make arm-smmu-v3 explicitly non-modular
> 
> Thanks a lot,
> 
>        Joerg

^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: [PATCH 8/9] iommu: arm-smmu: make it explicitly non-modular
  2018-11-26 22:31   ` Paul Gortmaker
@ 2018-11-28 12:42     ` Robin Murphy
  -1 siblings, 0 replies; 52+ messages in thread
From: Robin Murphy @ 2018-11-28 12:42 UTC (permalink / raw)
  To: Paul Gortmaker, Joerg Roedel
  Cc: iommu, linux-kernel, Will Deacon, Nate Watterson, linux-arm-kernel

Hi Paul,

On 26/11/2018 22:31, Paul Gortmaker wrote:
> The Kconfig currently controlling compilation of this code is:
> 
> drivers/iommu/Kconfig:config ARM_SMMU
> drivers/iommu/Kconfig:  bool "ARM Ltd. System MMU (SMMU) Support"
> 
> ...meaning that it currently is not being built as a module by anyone.
> 
> Lets remove the modular code that is essentially orphaned, so that
> when reading the driver there is no doubt it is builtin-only.
> 
> Since module_platform_driver() uses the same init level priority as
> builtin_platform_driver() the init ordering remains unchanged with
> this commit.
> 
> We explicitly disallow a driver unbind, since that doesn't have a
> sensible use case anyway, but unlike most drivers, we can't delete the
> function tied to the ".remove" field.  This is because as of commit
> 7aa8619a66ae ("iommu/arm-smmu-v3: Implement shutdown method") the
> .remove function was given a one line wrapper and re-used to provide a
> .shutdown service.  So we delete the wrapper and re-name the function
> from remove to shutdown.
> 
> We add a moduleparam.h include since the file does actually declare
> some module parameters, and leaving them as such is the easiest way
> currently to remain backwards compatible with existing use cases.
> 
> We also delete the MODULE_LICENSE tag etc. since all that information
> is already contained at the top of the file in the comments.
> 
> Cc: Will Deacon <will.deacon@arm.com>
> Cc: Joerg Roedel <joro@8bytes.org>
> Cc: Robin Murphy <robin.murphy@arm.com>
> Cc: Nate Watterson <nwatters@codeaurora.org>
> Cc: linux-arm-kernel@lists.infradead.org
> Cc: iommu@lists.linux-foundation.org
> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
> ---
>   drivers/iommu/arm-smmu.c | 32 +++++++++++++-------------------
>   1 file changed, 13 insertions(+), 19 deletions(-)
> 
> diff --git a/drivers/iommu/arm-smmu.c b/drivers/iommu/arm-smmu.c
> index 5a28ae892504..4a2e143fdf52 100644
> --- a/drivers/iommu/arm-smmu.c
> +++ b/drivers/iommu/arm-smmu.c
> @@ -41,7 +41,8 @@
>   #include <linux/io-64-nonatomic-hi-lo.h>
>   #include <linux/iommu.h>
>   #include <linux/iopoll.h>
> -#include <linux/module.h>
> +#include <linux/init.h>
> +#include <linux/moduleparam.h>
>   #include <linux/of.h>
>   #include <linux/of_address.h>
>   #include <linux/of_device.h>
> @@ -101,6 +102,10 @@
>   #define MSI_IOVA_LENGTH			0x100000
>   
>   static int force_stage;
> +/*
> + * not really modular, but the easiest way to keep compat with existing
> + * bootargs behaviour is to continue using module_param() here.
> + */

Is it worth introducing builtin_param() and friends for this sort of 
thing, to echo the *_platform_driver() helpers? It seems like that could 
be justifiable under the motivation described in the cover letter.

Otherwise, the changes look reasonable. I still hold out hope that one 
day we'll be able to make IOMMU drivers modular (it can work with 
minimal hacks today, but it's far from robust in general), but for now I 
agree this makes sense (and it'll be easy enough to revert for playing 
with further hacks). With the title fixed up as Joerg asked,

Acked-by: Robin Murphy <robin.murphy@arm.com>

>   module_param(force_stage, int, S_IRUGO);
>   MODULE_PARM_DESC(force_stage,
>   	"Force SMMU mappings to be installed at a particular stage of translation. A value of '1' or '2' forces the corresponding stage. All other values are ignored (i.e. no stage is forced). Note that selecting a specific stage will disable support for nested translation.");
> @@ -1964,7 +1969,6 @@ static const struct of_device_id arm_smmu_of_match[] = {
>   	{ .compatible = "cavium,smmu-v2", .data = &cavium_smmuv2 },
>   	{ },
>   };
> -MODULE_DEVICE_TABLE(of, arm_smmu_of_match);
>   
>   #ifdef CONFIG_ACPI
>   static int acpi_smmu_get_data(u32 model, struct arm_smmu_device *smmu)
> @@ -2224,24 +2228,18 @@ static int arm_smmu_legacy_bus_init(void)
>   }
>   device_initcall_sync(arm_smmu_legacy_bus_init);
>   
> -static int arm_smmu_device_remove(struct platform_device *pdev)
> +static void arm_smmu_device_shutdown(struct platform_device *pdev)
>   {
>   	struct arm_smmu_device *smmu = platform_get_drvdata(pdev);
>   
>   	if (!smmu)
> -		return -ENODEV;
> +		return;
>   
>   	if (!bitmap_empty(smmu->context_map, ARM_SMMU_MAX_CBS))
>   		dev_err(&pdev->dev, "removing device with active domains!\n");
>   
>   	/* Turn the thing off */
>   	writel(sCR0_CLIENTPD, ARM_SMMU_GR0_NS(smmu) + ARM_SMMU_GR0_sCR0);
> -	return 0;
> -}
> -
> -static void arm_smmu_device_shutdown(struct platform_device *pdev)
> -{
> -	arm_smmu_device_remove(pdev);
>   }
>   
>   static int __maybe_unused arm_smmu_pm_resume(struct device *dev)
> @@ -2256,16 +2254,12 @@ static SIMPLE_DEV_PM_OPS(arm_smmu_pm_ops, NULL, arm_smmu_pm_resume);
>   
>   static struct platform_driver arm_smmu_driver = {
>   	.driver	= {
> -		.name		= "arm-smmu",
> -		.of_match_table	= of_match_ptr(arm_smmu_of_match),
> -		.pm		= &arm_smmu_pm_ops,
> +		.name			= "arm-smmu",
> +		.of_match_table		= of_match_ptr(arm_smmu_of_match),
> +		.pm			= &arm_smmu_pm_ops,
> +		.suppress_bind_attrs	= true,
>   	},
>   	.probe	= arm_smmu_device_probe,
> -	.remove	= arm_smmu_device_remove,
>   	.shutdown = arm_smmu_device_shutdown,
>   };
> -module_platform_driver(arm_smmu_driver);
> -
> -MODULE_DESCRIPTION("IOMMU API for ARM architected SMMU implementations");
> -MODULE_AUTHOR("Will Deacon <will.deacon@arm.com>");
> -MODULE_LICENSE("GPL v2");
> +builtin_platform_driver(arm_smmu_driver);
> 

^ permalink raw reply	[flat|nested] 52+ messages in thread

* [PATCH 8/9] iommu: arm-smmu: make it explicitly non-modular
@ 2018-11-28 12:42     ` Robin Murphy
  0 siblings, 0 replies; 52+ messages in thread
From: Robin Murphy @ 2018-11-28 12:42 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Paul,

On 26/11/2018 22:31, Paul Gortmaker wrote:
> The Kconfig currently controlling compilation of this code is:
> 
> drivers/iommu/Kconfig:config ARM_SMMU
> drivers/iommu/Kconfig:  bool "ARM Ltd. System MMU (SMMU) Support"
> 
> ...meaning that it currently is not being built as a module by anyone.
> 
> Lets remove the modular code that is essentially orphaned, so that
> when reading the driver there is no doubt it is builtin-only.
> 
> Since module_platform_driver() uses the same init level priority as
> builtin_platform_driver() the init ordering remains unchanged with
> this commit.
> 
> We explicitly disallow a driver unbind, since that doesn't have a
> sensible use case anyway, but unlike most drivers, we can't delete the
> function tied to the ".remove" field.  This is because as of commit
> 7aa8619a66ae ("iommu/arm-smmu-v3: Implement shutdown method") the
> .remove function was given a one line wrapper and re-used to provide a
> .shutdown service.  So we delete the wrapper and re-name the function
> from remove to shutdown.
> 
> We add a moduleparam.h include since the file does actually declare
> some module parameters, and leaving them as such is the easiest way
> currently to remain backwards compatible with existing use cases.
> 
> We also delete the MODULE_LICENSE tag etc. since all that information
> is already contained at the top of the file in the comments.
> 
> Cc: Will Deacon <will.deacon@arm.com>
> Cc: Joerg Roedel <joro@8bytes.org>
> Cc: Robin Murphy <robin.murphy@arm.com>
> Cc: Nate Watterson <nwatters@codeaurora.org>
> Cc: linux-arm-kernel at lists.infradead.org
> Cc: iommu at lists.linux-foundation.org
> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
> ---
>   drivers/iommu/arm-smmu.c | 32 +++++++++++++-------------------
>   1 file changed, 13 insertions(+), 19 deletions(-)
> 
> diff --git a/drivers/iommu/arm-smmu.c b/drivers/iommu/arm-smmu.c
> index 5a28ae892504..4a2e143fdf52 100644
> --- a/drivers/iommu/arm-smmu.c
> +++ b/drivers/iommu/arm-smmu.c
> @@ -41,7 +41,8 @@
>   #include <linux/io-64-nonatomic-hi-lo.h>
>   #include <linux/iommu.h>
>   #include <linux/iopoll.h>
> -#include <linux/module.h>
> +#include <linux/init.h>
> +#include <linux/moduleparam.h>
>   #include <linux/of.h>
>   #include <linux/of_address.h>
>   #include <linux/of_device.h>
> @@ -101,6 +102,10 @@
>   #define MSI_IOVA_LENGTH			0x100000
>   
>   static int force_stage;
> +/*
> + * not really modular, but the easiest way to keep compat with existing
> + * bootargs behaviour is to continue using module_param() here.
> + */

Is it worth introducing builtin_param() and friends for this sort of 
thing, to echo the *_platform_driver() helpers? It seems like that could 
be justifiable under the motivation described in the cover letter.

Otherwise, the changes look reasonable. I still hold out hope that one 
day we'll be able to make IOMMU drivers modular (it can work with 
minimal hacks today, but it's far from robust in general), but for now I 
agree this makes sense (and it'll be easy enough to revert for playing 
with further hacks). With the title fixed up as Joerg asked,

Acked-by: Robin Murphy <robin.murphy@arm.com>

>   module_param(force_stage, int, S_IRUGO);
>   MODULE_PARM_DESC(force_stage,
>   	"Force SMMU mappings to be installed at a particular stage of translation. A value of '1' or '2' forces the corresponding stage. All other values are ignored (i.e. no stage is forced). Note that selecting a specific stage will disable support for nested translation.");
> @@ -1964,7 +1969,6 @@ static const struct of_device_id arm_smmu_of_match[] = {
>   	{ .compatible = "cavium,smmu-v2", .data = &cavium_smmuv2 },
>   	{ },
>   };
> -MODULE_DEVICE_TABLE(of, arm_smmu_of_match);
>   
>   #ifdef CONFIG_ACPI
>   static int acpi_smmu_get_data(u32 model, struct arm_smmu_device *smmu)
> @@ -2224,24 +2228,18 @@ static int arm_smmu_legacy_bus_init(void)
>   }
>   device_initcall_sync(arm_smmu_legacy_bus_init);
>   
> -static int arm_smmu_device_remove(struct platform_device *pdev)
> +static void arm_smmu_device_shutdown(struct platform_device *pdev)
>   {
>   	struct arm_smmu_device *smmu = platform_get_drvdata(pdev);
>   
>   	if (!smmu)
> -		return -ENODEV;
> +		return;
>   
>   	if (!bitmap_empty(smmu->context_map, ARM_SMMU_MAX_CBS))
>   		dev_err(&pdev->dev, "removing device with active domains!\n");
>   
>   	/* Turn the thing off */
>   	writel(sCR0_CLIENTPD, ARM_SMMU_GR0_NS(smmu) + ARM_SMMU_GR0_sCR0);
> -	return 0;
> -}
> -
> -static void arm_smmu_device_shutdown(struct platform_device *pdev)
> -{
> -	arm_smmu_device_remove(pdev);
>   }
>   
>   static int __maybe_unused arm_smmu_pm_resume(struct device *dev)
> @@ -2256,16 +2254,12 @@ static SIMPLE_DEV_PM_OPS(arm_smmu_pm_ops, NULL, arm_smmu_pm_resume);
>   
>   static struct platform_driver arm_smmu_driver = {
>   	.driver	= {
> -		.name		= "arm-smmu",
> -		.of_match_table	= of_match_ptr(arm_smmu_of_match),
> -		.pm		= &arm_smmu_pm_ops,
> +		.name			= "arm-smmu",
> +		.of_match_table		= of_match_ptr(arm_smmu_of_match),
> +		.pm			= &arm_smmu_pm_ops,
> +		.suppress_bind_attrs	= true,
>   	},
>   	.probe	= arm_smmu_device_probe,
> -	.remove	= arm_smmu_device_remove,
>   	.shutdown = arm_smmu_device_shutdown,
>   };
> -module_platform_driver(arm_smmu_driver);
> -
> -MODULE_DESCRIPTION("IOMMU API for ARM architected SMMU implementations");
> -MODULE_AUTHOR("Will Deacon <will.deacon@arm.com>");
> -MODULE_LICENSE("GPL v2");
> +builtin_platform_driver(arm_smmu_driver);
> 

^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: [PATCH 9/9] iommu: arm-smmu-v3: make it explicitly non-modular
@ 2018-11-28 12:44     ` Robin Murphy
  0 siblings, 0 replies; 52+ messages in thread
From: Robin Murphy @ 2018-11-28 12:44 UTC (permalink / raw)
  To: Paul Gortmaker, Joerg Roedel
  Cc: iommu, linux-kernel, Will Deacon, Nate Watterson, linux-arm-kernel

On 26/11/2018 22:31, Paul Gortmaker wrote:
> The Kconfig currently controlling compilation of this code is:
> 
> drivers/iommu/Kconfig:config ARM_SMMU_V3
> drivers/iommu/Kconfig:  bool "ARM Ltd. System MMU Version 3 (SMMUv3) Support"
> 
> ...meaning that it currently is not being built as a module by anyone.
> 
> Lets remove the modular code that is essentially orphaned, so that
> when reading the driver there is no doubt it is builtin-only.
> 
> Since module_platform_driver() uses the same init level priority as
> builtin_platform_driver() the init ordering remains unchanged with
> this commit.
> 
> We explicitly disallow a driver unbind, since that doesn't have a
> sensible use case anyway, but unlike most drivers, we can't delete the
> function tied to the ".remove" field.  This is because as of commit
> 7aa8619a66ae ("iommu/arm-smmu-v3: Implement shutdown method") the
> .remove function was given a one line wrapper and re-used to provide a
> .shutdown service.  So we delete the wrapper and re-name the function
> from remove to shutdown.
> 
> We add a moduleparam.h include since the file does actually declare
> some module parameters, and leaving them as such is the easiest way
> currently to remain backwards compatible with existing use cases.
> 
> Also note that MODULE_DEVICE_TABLE is a no-op for non-modular code.
> 
> We also delete the MODULE_LICENSE tag etc. since all that information
> is already contained at the top of the file in the comments.

With the title fixed up,

Acked-by: Robin Murphy <robin.murphy@arm.com>

> Cc: Will Deacon <will.deacon@arm.com>
> Cc: Joerg Roedel <joro@8bytes.org>
> Cc: Robin Murphy <robin.murphy@arm.com>
> Cc: Nate Watterson <nwatters@codeaurora.org>
> Cc: linux-arm-kernel@lists.infradead.org
> Cc: iommu@lists.linux-foundation.org
> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
> ---
>   drivers/iommu/arm-smmu-v3.c | 25 +++++++++----------------
>   1 file changed, 9 insertions(+), 16 deletions(-)
> 
> diff --git a/drivers/iommu/arm-smmu-v3.c b/drivers/iommu/arm-smmu-v3.c
> index 6947ccf26512..1189c06079d4 100644
> --- a/drivers/iommu/arm-smmu-v3.c
> +++ b/drivers/iommu/arm-smmu-v3.c
> @@ -20,7 +20,8 @@
>   #include <linux/interrupt.h>
>   #include <linux/iommu.h>
>   #include <linux/iopoll.h>
> -#include <linux/module.h>
> +#include <linux/init.h>
> +#include <linux/moduleparam.h>
>   #include <linux/msi.h>
>   #include <linux/of.h>
>   #include <linux/of_address.h>
> @@ -356,6 +357,10 @@
>   #define MSI_IOVA_BASE			0x8000000
>   #define MSI_IOVA_LENGTH			0x100000
>   
> +/*
> + * not really modular, but the easiest way to keep compat with existing
> + * bootargs behaviour is to continue using module_param_named here.
> + */
>   static bool disable_bypass = 1;
>   module_param_named(disable_bypass, disable_bypass, bool, S_IRUGO);
>   MODULE_PARM_DESC(disable_bypass,
> @@ -2928,37 +2933,25 @@ static int arm_smmu_device_probe(struct platform_device *pdev)
>   	return 0;
>   }
>   
> -static int arm_smmu_device_remove(struct platform_device *pdev)
> +static void arm_smmu_device_shutdown(struct platform_device *pdev)
>   {
>   	struct arm_smmu_device *smmu = platform_get_drvdata(pdev);
>   
>   	arm_smmu_device_disable(smmu);
> -
> -	return 0;
> -}
> -
> -static void arm_smmu_device_shutdown(struct platform_device *pdev)
> -{
> -	arm_smmu_device_remove(pdev);
>   }
>   
>   static const struct of_device_id arm_smmu_of_match[] = {
>   	{ .compatible = "arm,smmu-v3", },
>   	{ },
>   };
> -MODULE_DEVICE_TABLE(of, arm_smmu_of_match);
>   
>   static struct platform_driver arm_smmu_driver = {
>   	.driver	= {
>   		.name		= "arm-smmu-v3",
>   		.of_match_table	= of_match_ptr(arm_smmu_of_match),
> +		.suppress_bind_attrs = true,
>   	},
>   	.probe	= arm_smmu_device_probe,
> -	.remove	= arm_smmu_device_remove,
>   	.shutdown = arm_smmu_device_shutdown,
>   };
> -module_platform_driver(arm_smmu_driver);
> -
> -MODULE_DESCRIPTION("IOMMU API for ARM architected SMMUv3 implementations");
> -MODULE_AUTHOR("Will Deacon <will.deacon@arm.com>");
> -MODULE_LICENSE("GPL v2");
> +builtin_platform_driver(arm_smmu_driver);
> 

^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: [PATCH 9/9] iommu: arm-smmu-v3: make it explicitly non-modular
@ 2018-11-28 12:44     ` Robin Murphy
  0 siblings, 0 replies; 52+ messages in thread
From: Robin Murphy @ 2018-11-28 12:44 UTC (permalink / raw)
  To: Paul Gortmaker, Joerg Roedel
  Cc: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA, Will Deacon,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA

On 26/11/2018 22:31, Paul Gortmaker wrote:
> The Kconfig currently controlling compilation of this code is:
> 
> drivers/iommu/Kconfig:config ARM_SMMU_V3
> drivers/iommu/Kconfig:  bool "ARM Ltd. System MMU Version 3 (SMMUv3) Support"
> 
> ...meaning that it currently is not being built as a module by anyone.
> 
> Lets remove the modular code that is essentially orphaned, so that
> when reading the driver there is no doubt it is builtin-only.
> 
> Since module_platform_driver() uses the same init level priority as
> builtin_platform_driver() the init ordering remains unchanged with
> this commit.
> 
> We explicitly disallow a driver unbind, since that doesn't have a
> sensible use case anyway, but unlike most drivers, we can't delete the
> function tied to the ".remove" field.  This is because as of commit
> 7aa8619a66ae ("iommu/arm-smmu-v3: Implement shutdown method") the
> .remove function was given a one line wrapper and re-used to provide a
> .shutdown service.  So we delete the wrapper and re-name the function
> from remove to shutdown.
> 
> We add a moduleparam.h include since the file does actually declare
> some module parameters, and leaving them as such is the easiest way
> currently to remain backwards compatible with existing use cases.
> 
> Also note that MODULE_DEVICE_TABLE is a no-op for non-modular code.
> 
> We also delete the MODULE_LICENSE tag etc. since all that information
> is already contained at the top of the file in the comments.

With the title fixed up,

Acked-by: Robin Murphy <robin.murphy-5wv7dgnIgG8@public.gmane.org>

> Cc: Will Deacon <will.deacon-5wv7dgnIgG8@public.gmane.org>
> Cc: Joerg Roedel <joro-zLv9SwRftAIdnm+yROfE0A@public.gmane.org>
> Cc: Robin Murphy <robin.murphy-5wv7dgnIgG8@public.gmane.org>
> Cc: Nate Watterson <nwatters-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
> Cc: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
> Cc: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org
> Signed-off-by: Paul Gortmaker <paul.gortmaker-CWA4WttNNZF54TAoqtyWWQ@public.gmane.org>
> ---
>   drivers/iommu/arm-smmu-v3.c | 25 +++++++++----------------
>   1 file changed, 9 insertions(+), 16 deletions(-)
> 
> diff --git a/drivers/iommu/arm-smmu-v3.c b/drivers/iommu/arm-smmu-v3.c
> index 6947ccf26512..1189c06079d4 100644
> --- a/drivers/iommu/arm-smmu-v3.c
> +++ b/drivers/iommu/arm-smmu-v3.c
> @@ -20,7 +20,8 @@
>   #include <linux/interrupt.h>
>   #include <linux/iommu.h>
>   #include <linux/iopoll.h>
> -#include <linux/module.h>
> +#include <linux/init.h>
> +#include <linux/moduleparam.h>
>   #include <linux/msi.h>
>   #include <linux/of.h>
>   #include <linux/of_address.h>
> @@ -356,6 +357,10 @@
>   #define MSI_IOVA_BASE			0x8000000
>   #define MSI_IOVA_LENGTH			0x100000
>   
> +/*
> + * not really modular, but the easiest way to keep compat with existing
> + * bootargs behaviour is to continue using module_param_named here.
> + */
>   static bool disable_bypass = 1;
>   module_param_named(disable_bypass, disable_bypass, bool, S_IRUGO);
>   MODULE_PARM_DESC(disable_bypass,
> @@ -2928,37 +2933,25 @@ static int arm_smmu_device_probe(struct platform_device *pdev)
>   	return 0;
>   }
>   
> -static int arm_smmu_device_remove(struct platform_device *pdev)
> +static void arm_smmu_device_shutdown(struct platform_device *pdev)
>   {
>   	struct arm_smmu_device *smmu = platform_get_drvdata(pdev);
>   
>   	arm_smmu_device_disable(smmu);
> -
> -	return 0;
> -}
> -
> -static void arm_smmu_device_shutdown(struct platform_device *pdev)
> -{
> -	arm_smmu_device_remove(pdev);
>   }
>   
>   static const struct of_device_id arm_smmu_of_match[] = {
>   	{ .compatible = "arm,smmu-v3", },
>   	{ },
>   };
> -MODULE_DEVICE_TABLE(of, arm_smmu_of_match);
>   
>   static struct platform_driver arm_smmu_driver = {
>   	.driver	= {
>   		.name		= "arm-smmu-v3",
>   		.of_match_table	= of_match_ptr(arm_smmu_of_match),
> +		.suppress_bind_attrs = true,
>   	},
>   	.probe	= arm_smmu_device_probe,
> -	.remove	= arm_smmu_device_remove,
>   	.shutdown = arm_smmu_device_shutdown,
>   };
> -module_platform_driver(arm_smmu_driver);
> -
> -MODULE_DESCRIPTION("IOMMU API for ARM architected SMMUv3 implementations");
> -MODULE_AUTHOR("Will Deacon <will.deacon-5wv7dgnIgG8@public.gmane.org>");
> -MODULE_LICENSE("GPL v2");
> +builtin_platform_driver(arm_smmu_driver);
> 

^ permalink raw reply	[flat|nested] 52+ messages in thread

* [PATCH 9/9] iommu: arm-smmu-v3: make it explicitly non-modular
@ 2018-11-28 12:44     ` Robin Murphy
  0 siblings, 0 replies; 52+ messages in thread
From: Robin Murphy @ 2018-11-28 12:44 UTC (permalink / raw)
  To: linux-arm-kernel

On 26/11/2018 22:31, Paul Gortmaker wrote:
> The Kconfig currently controlling compilation of this code is:
> 
> drivers/iommu/Kconfig:config ARM_SMMU_V3
> drivers/iommu/Kconfig:  bool "ARM Ltd. System MMU Version 3 (SMMUv3) Support"
> 
> ...meaning that it currently is not being built as a module by anyone.
> 
> Lets remove the modular code that is essentially orphaned, so that
> when reading the driver there is no doubt it is builtin-only.
> 
> Since module_platform_driver() uses the same init level priority as
> builtin_platform_driver() the init ordering remains unchanged with
> this commit.
> 
> We explicitly disallow a driver unbind, since that doesn't have a
> sensible use case anyway, but unlike most drivers, we can't delete the
> function tied to the ".remove" field.  This is because as of commit
> 7aa8619a66ae ("iommu/arm-smmu-v3: Implement shutdown method") the
> .remove function was given a one line wrapper and re-used to provide a
> .shutdown service.  So we delete the wrapper and re-name the function
> from remove to shutdown.
> 
> We add a moduleparam.h include since the file does actually declare
> some module parameters, and leaving them as such is the easiest way
> currently to remain backwards compatible with existing use cases.
> 
> Also note that MODULE_DEVICE_TABLE is a no-op for non-modular code.
> 
> We also delete the MODULE_LICENSE tag etc. since all that information
> is already contained at the top of the file in the comments.

With the title fixed up,

Acked-by: Robin Murphy <robin.murphy@arm.com>

> Cc: Will Deacon <will.deacon@arm.com>
> Cc: Joerg Roedel <joro@8bytes.org>
> Cc: Robin Murphy <robin.murphy@arm.com>
> Cc: Nate Watterson <nwatters@codeaurora.org>
> Cc: linux-arm-kernel at lists.infradead.org
> Cc: iommu at lists.linux-foundation.org
> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
> ---
>   drivers/iommu/arm-smmu-v3.c | 25 +++++++++----------------
>   1 file changed, 9 insertions(+), 16 deletions(-)
> 
> diff --git a/drivers/iommu/arm-smmu-v3.c b/drivers/iommu/arm-smmu-v3.c
> index 6947ccf26512..1189c06079d4 100644
> --- a/drivers/iommu/arm-smmu-v3.c
> +++ b/drivers/iommu/arm-smmu-v3.c
> @@ -20,7 +20,8 @@
>   #include <linux/interrupt.h>
>   #include <linux/iommu.h>
>   #include <linux/iopoll.h>
> -#include <linux/module.h>
> +#include <linux/init.h>
> +#include <linux/moduleparam.h>
>   #include <linux/msi.h>
>   #include <linux/of.h>
>   #include <linux/of_address.h>
> @@ -356,6 +357,10 @@
>   #define MSI_IOVA_BASE			0x8000000
>   #define MSI_IOVA_LENGTH			0x100000
>   
> +/*
> + * not really modular, but the easiest way to keep compat with existing
> + * bootargs behaviour is to continue using module_param_named here.
> + */
>   static bool disable_bypass = 1;
>   module_param_named(disable_bypass, disable_bypass, bool, S_IRUGO);
>   MODULE_PARM_DESC(disable_bypass,
> @@ -2928,37 +2933,25 @@ static int arm_smmu_device_probe(struct platform_device *pdev)
>   	return 0;
>   }
>   
> -static int arm_smmu_device_remove(struct platform_device *pdev)
> +static void arm_smmu_device_shutdown(struct platform_device *pdev)
>   {
>   	struct arm_smmu_device *smmu = platform_get_drvdata(pdev);
>   
>   	arm_smmu_device_disable(smmu);
> -
> -	return 0;
> -}
> -
> -static void arm_smmu_device_shutdown(struct platform_device *pdev)
> -{
> -	arm_smmu_device_remove(pdev);
>   }
>   
>   static const struct of_device_id arm_smmu_of_match[] = {
>   	{ .compatible = "arm,smmu-v3", },
>   	{ },
>   };
> -MODULE_DEVICE_TABLE(of, arm_smmu_of_match);
>   
>   static struct platform_driver arm_smmu_driver = {
>   	.driver	= {
>   		.name		= "arm-smmu-v3",
>   		.of_match_table	= of_match_ptr(arm_smmu_of_match),
> +		.suppress_bind_attrs = true,
>   	},
>   	.probe	= arm_smmu_device_probe,
> -	.remove	= arm_smmu_device_remove,
>   	.shutdown = arm_smmu_device_shutdown,
>   };
> -module_platform_driver(arm_smmu_driver);
> -
> -MODULE_DESCRIPTION("IOMMU API for ARM architected SMMUv3 implementations");
> -MODULE_AUTHOR("Will Deacon <will.deacon@arm.com>");
> -MODULE_LICENSE("GPL v2");
> +builtin_platform_driver(arm_smmu_driver);
> 

^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: [PATCH 5/9] iommu: ipmmu-vmsa: make it explicitly non-modular
  2018-11-26 22:31   ` Paul Gortmaker
  (?)
@ 2018-11-28 12:50   ` Robin Murphy
  2018-11-28 15:32       ` Paul Gortmaker
  -1 siblings, 1 reply; 52+ messages in thread
From: Robin Murphy @ 2018-11-28 12:50 UTC (permalink / raw)
  To: Paul Gortmaker, Joerg Roedel; +Cc: iommu, linux-kernel, Laurent Pinchart

On 26/11/2018 22:31, Paul Gortmaker wrote:
> The Kconfig currently controlling compilation of this code is:
> 
> drivers/iommu/Kconfig:config IPMMU_VMSA
> drivers/iommu/Kconfig:        bool "Renesas VMSA-compatible IPMMU"
> 
> ...meaning that it currently is not being built as a module by anyone.
> 
> Lets remove the modular code that is essentially orphaned, so that
> when reading the driver there is no doubt it is builtin-only.
> 
> Since module_init was not even used by this driver, the init ordering
> remains unchanged with this commit.
> 
> We also delete the MODULE_LICENSE tag etc. since all that information
> was (or is now) contained at the top of the file in the comments.
> 
> Also note that MODULE_DEVICE_TABLE is a no-op for non-modular code.
> 
> Cc: Joerg Roedel <joro@8bytes.org>
> Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> Cc: iommu@lists.linux-foundation.org
> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
> ---
>   drivers/iommu/ipmmu-vmsa.c | 16 +++-------------
>   1 file changed, 3 insertions(+), 13 deletions(-)
> 
> diff --git a/drivers/iommu/ipmmu-vmsa.c b/drivers/iommu/ipmmu-vmsa.c
> index 9e2655f1c1bf..de39ef992d8a 100644
> --- a/drivers/iommu/ipmmu-vmsa.c
> +++ b/drivers/iommu/ipmmu-vmsa.c
> @@ -1,6 +1,8 @@
>   // SPDX-License-Identifier: GPL-2.0
>   /*
>    * IPMMU VMSA

Nit: this line doesn't convey any information that the module 
description below doesn't also say far more clearly, so you may as well 
just replace it entirely.

Robin.

> + * IOMMU API for Renesas VMSA-compatible IPMMU
> + * Author: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
>    *
>    * Copyright (C) 2014 Renesas Electronics Corporation
>    */
> @@ -14,7 +16,7 @@
>   #include <linux/interrupt.h>
>   #include <linux/io.h>
>   #include <linux/iommu.h>
> -#include <linux/module.h>
> +#include <linux/init.h>
>   #include <linux/of.h>
>   #include <linux/of_device.h>
>   #include <linux/of_iommu.h>
> @@ -968,7 +970,6 @@ static const struct of_device_id ipmmu_of_ids[] = {
>   	},
>   };
>   
> -MODULE_DEVICE_TABLE(of, ipmmu_of_ids);
>   
>   static int ipmmu_probe(struct platform_device *pdev)
>   {
> @@ -1140,15 +1141,4 @@ static int __init ipmmu_init(void)
>   	setup_done = true;
>   	return 0;
>   }
> -
> -static void __exit ipmmu_exit(void)
> -{
> -	return platform_driver_unregister(&ipmmu_driver);
> -}
> -
>   subsys_initcall(ipmmu_init);
> -module_exit(ipmmu_exit);
> -
> -MODULE_DESCRIPTION("IOMMU API for Renesas VMSA-compatible IPMMU");
> -MODULE_AUTHOR("Laurent Pinchart <laurent.pinchart@ideasonboard.com>");
> -MODULE_LICENSE("GPL v2");
> 

^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: [PATCH 8/9] iommu: arm-smmu: make it explicitly non-modular
  2018-11-28 12:42     ` Robin Murphy
  (?)
@ 2018-11-28 15:24       ` Paul Gortmaker
  -1 siblings, 0 replies; 52+ messages in thread
From: Paul Gortmaker @ 2018-11-28 15:24 UTC (permalink / raw)
  To: Robin Murphy
  Cc: Joerg Roedel, iommu, linux-kernel, Will Deacon, Nate Watterson,
	linux-arm-kernel

[Re: [PATCH 8/9] iommu: arm-smmu: make it explicitly non-modular] On 28/11/2018 (Wed 12:42) Robin Murphy wrote:

> Hi Paul,
> 
> On 26/11/2018 22:31, Paul Gortmaker wrote:

[...]

> >We add a moduleparam.h include since the file does actually declare
> >some module parameters, and leaving them as such is the easiest way
> >currently to remain backwards compatible with existing use cases.

[...]


> Is it worth introducing builtin_param() and friends for this sort of thing,
> to echo the *_platform_driver() helpers? It seems like that could be
> justifiable under the motivation described in the cover letter.

I've definitely gone back and looked at this a few times when coming
across the few corner cases like these, to remind myself why I didn't do
it already.

We'd not want to replicate all the module_param stuff as an instance of
builtin_param() because we already have setup() and setup_param() in
init.h -- however they don't do the file name in the param - hence the
reason it isn't a direct swap in replacement.

So, it would become some more complex refactoring of moduleparam.h into
say bootparam.h - to reduce code/macro duplication, while at the same
time being aware of existing setup_param stuff and making something like
a new setup_param_named() that is consistent with existing setup fcns.

And based on past experience, there will be reviewers who don't see the
value in the distinction and simply reply with two words "why bother?".

Not impossible, but not as simple as the builtin_platform_driver and
similar wrappers that I've already added to mainline.  You've made we
want to go have another look at it again, but in the meantime we can do
what I've done here, and circle around later to update the few instances
of moduleparam in non-modules once/if the refactoring I describe above
works out and is accepted in mainline.

> 
> Otherwise, the changes look reasonable. I still hold out hope that one day
> we'll be able to make IOMMU drivers modular (it can work with minimal hacks
> today, but it's far from robust in general), but for now I agree this makes
> sense (and it'll be easy enough to revert for playing with further hacks).

I totally agree - I've had similar discussions with the DMA maintainers,
and if being modular can be made to work and has a use case - great!

But it should be a conscious decision, since nobody writes a new driver
from scratch; they copy one that is "close" as a template and then go
from there.  Which leads to a good percentage of drivers having hints
of modular stuff when there is no intent of them ever being modular.

> With the title fixed up as Joerg asked,
> 
> Acked-by: Robin Murphy <robin.murphy@arm.com>

Thanks for the feedback/review.  Will re-send with updated titles before
the week is finished and a good chance for additional feedback has elapsed.

Paul.
--

> 
> >  module_param(force_stage, int, S_IRUGO);
> >  MODULE_PARM_DESC(force_stage,
> >  	"Force SMMU mappings to be installed at a particular stage of translation. A value of '1' or '2' forces the corresponding stage. All other values are ignored (i.e. no stage is forced). Note that selecting a specific stage will disable support for nested translation.");

^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: [PATCH 8/9] iommu: arm-smmu: make it explicitly non-modular
@ 2018-11-28 15:24       ` Paul Gortmaker
  0 siblings, 0 replies; 52+ messages in thread
From: Paul Gortmaker @ 2018-11-28 15:24 UTC (permalink / raw)
  To: Robin Murphy
  Cc: Joerg Roedel, Will Deacon, linux-kernel, iommu, Nate Watterson,
	linux-arm-kernel

[Re: [PATCH 8/9] iommu: arm-smmu: make it explicitly non-modular] On 28/11/2018 (Wed 12:42) Robin Murphy wrote:

> Hi Paul,
> 
> On 26/11/2018 22:31, Paul Gortmaker wrote:

[...]

> >We add a moduleparam.h include since the file does actually declare
> >some module parameters, and leaving them as such is the easiest way
> >currently to remain backwards compatible with existing use cases.

[...]


> Is it worth introducing builtin_param() and friends for this sort of thing,
> to echo the *_platform_driver() helpers? It seems like that could be
> justifiable under the motivation described in the cover letter.

I've definitely gone back and looked at this a few times when coming
across the few corner cases like these, to remind myself why I didn't do
it already.

We'd not want to replicate all the module_param stuff as an instance of
builtin_param() because we already have setup() and setup_param() in
init.h -- however they don't do the file name in the param - hence the
reason it isn't a direct swap in replacement.

So, it would become some more complex refactoring of moduleparam.h into
say bootparam.h - to reduce code/macro duplication, while at the same
time being aware of existing setup_param stuff and making something like
a new setup_param_named() that is consistent with existing setup fcns.

And based on past experience, there will be reviewers who don't see the
value in the distinction and simply reply with two words "why bother?".

Not impossible, but not as simple as the builtin_platform_driver and
similar wrappers that I've already added to mainline.  You've made we
want to go have another look at it again, but in the meantime we can do
what I've done here, and circle around later to update the few instances
of moduleparam in non-modules once/if the refactoring I describe above
works out and is accepted in mainline.

> 
> Otherwise, the changes look reasonable. I still hold out hope that one day
> we'll be able to make IOMMU drivers modular (it can work with minimal hacks
> today, but it's far from robust in general), but for now I agree this makes
> sense (and it'll be easy enough to revert for playing with further hacks).

I totally agree - I've had similar discussions with the DMA maintainers,
and if being modular can be made to work and has a use case - great!

But it should be a conscious decision, since nobody writes a new driver
from scratch; they copy one that is "close" as a template and then go
from there.  Which leads to a good percentage of drivers having hints
of modular stuff when there is no intent of them ever being modular.

> With the title fixed up as Joerg asked,
> 
> Acked-by: Robin Murphy <robin.murphy@arm.com>

Thanks for the feedback/review.  Will re-send with updated titles before
the week is finished and a good chance for additional feedback has elapsed.

Paul.
--

> 
> >  module_param(force_stage, int, S_IRUGO);
> >  MODULE_PARM_DESC(force_stage,
> >  	"Force SMMU mappings to be installed at a particular stage of translation. A value of '1' or '2' forces the corresponding stage. All other values are ignored (i.e. no stage is forced). Note that selecting a specific stage will disable support for nested translation.");

^ permalink raw reply	[flat|nested] 52+ messages in thread

* [PATCH 8/9] iommu: arm-smmu: make it explicitly non-modular
@ 2018-11-28 15:24       ` Paul Gortmaker
  0 siblings, 0 replies; 52+ messages in thread
From: Paul Gortmaker @ 2018-11-28 15:24 UTC (permalink / raw)
  To: linux-arm-kernel

[Re: [PATCH 8/9] iommu: arm-smmu: make it explicitly non-modular] On 28/11/2018 (Wed 12:42) Robin Murphy wrote:

> Hi Paul,
> 
> On 26/11/2018 22:31, Paul Gortmaker wrote:

[...]

> >We add a moduleparam.h include since the file does actually declare
> >some module parameters, and leaving them as such is the easiest way
> >currently to remain backwards compatible with existing use cases.

[...]


> Is it worth introducing builtin_param() and friends for this sort of thing,
> to echo the *_platform_driver() helpers? It seems like that could be
> justifiable under the motivation described in the cover letter.

I've definitely gone back and looked at this a few times when coming
across the few corner cases like these, to remind myself why I didn't do
it already.

We'd not want to replicate all the module_param stuff as an instance of
builtin_param() because we already have setup() and setup_param() in
init.h -- however they don't do the file name in the param - hence the
reason it isn't a direct swap in replacement.

So, it would become some more complex refactoring of moduleparam.h into
say bootparam.h - to reduce code/macro duplication, while at the same
time being aware of existing setup_param stuff and making something like
a new setup_param_named() that is consistent with existing setup fcns.

And based on past experience, there will be reviewers who don't see the
value in the distinction and simply reply with two words "why bother?".

Not impossible, but not as simple as the builtin_platform_driver and
similar wrappers that I've already added to mainline.  You've made we
want to go have another look at it again, but in the meantime we can do
what I've done here, and circle around later to update the few instances
of moduleparam in non-modules once/if the refactoring I describe above
works out and is accepted in mainline.

> 
> Otherwise, the changes look reasonable. I still hold out hope that one day
> we'll be able to make IOMMU drivers modular (it can work with minimal hacks
> today, but it's far from robust in general), but for now I agree this makes
> sense (and it'll be easy enough to revert for playing with further hacks).

I totally agree - I've had similar discussions with the DMA maintainers,
and if being modular can be made to work and has a use case - great!

But it should be a conscious decision, since nobody writes a new driver
from scratch; they copy one that is "close" as a template and then go
from there.  Which leads to a good percentage of drivers having hints
of modular stuff when there is no intent of them ever being modular.

> With the title fixed up as Joerg asked,
> 
> Acked-by: Robin Murphy <robin.murphy@arm.com>

Thanks for the feedback/review.  Will re-send with updated titles before
the week is finished and a good chance for additional feedback has elapsed.

Paul.
--

> 
> >  module_param(force_stage, int, S_IRUGO);
> >  MODULE_PARM_DESC(force_stage,
> >  	"Force SMMU mappings to be installed at a particular stage of translation. A value of '1' or '2' forces the corresponding stage. All other values are ignored (i.e. no stage is forced). Note that selecting a specific stage will disable support for nested translation.");

^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: [PATCH 5/9] iommu: ipmmu-vmsa: make it explicitly non-modular
@ 2018-11-28 15:32       ` Paul Gortmaker
  0 siblings, 0 replies; 52+ messages in thread
From: Paul Gortmaker @ 2018-11-28 15:32 UTC (permalink / raw)
  To: Robin Murphy; +Cc: Joerg Roedel, iommu, linux-kernel, Laurent Pinchart

[Re: [PATCH 5/9] iommu: ipmmu-vmsa: make it explicitly non-modular] On 28/11/2018 (Wed 12:50) Robin Murphy wrote:

> On 26/11/2018 22:31, Paul Gortmaker wrote:

[...]

> >diff --git a/drivers/iommu/ipmmu-vmsa.c b/drivers/iommu/ipmmu-vmsa.c
> >index 9e2655f1c1bf..de39ef992d8a 100644
> >--- a/drivers/iommu/ipmmu-vmsa.c
> >+++ b/drivers/iommu/ipmmu-vmsa.c
> >@@ -1,6 +1,8 @@
> >  // SPDX-License-Identifier: GPL-2.0
> >  /*
> >   * IPMMU VMSA
> 
> Nit: this line doesn't convey any information that the module description
> below doesn't also say far more clearly, so you may as well just replace it
> entirely.

No problem. Will do in v2.

P.
--

> 
> Robin.
> 
> >+ * IOMMU API for Renesas VMSA-compatible IPMMU
> >+ * Author: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

[...]

^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: [PATCH 5/9] iommu: ipmmu-vmsa: make it explicitly non-modular
@ 2018-11-28 15:32       ` Paul Gortmaker
  0 siblings, 0 replies; 52+ messages in thread
From: Paul Gortmaker @ 2018-11-28 15:32 UTC (permalink / raw)
  To: Robin Murphy
  Cc: Laurent Pinchart,
	iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA

[Re: [PATCH 5/9] iommu: ipmmu-vmsa: make it explicitly non-modular] On 28/11/2018 (Wed 12:50) Robin Murphy wrote:

> On 26/11/2018 22:31, Paul Gortmaker wrote:

[...]

> >diff --git a/drivers/iommu/ipmmu-vmsa.c b/drivers/iommu/ipmmu-vmsa.c
> >index 9e2655f1c1bf..de39ef992d8a 100644
> >--- a/drivers/iommu/ipmmu-vmsa.c
> >+++ b/drivers/iommu/ipmmu-vmsa.c
> >@@ -1,6 +1,8 @@
> >  // SPDX-License-Identifier: GPL-2.0
> >  /*
> >   * IPMMU VMSA
> 
> Nit: this line doesn't convey any information that the module description
> below doesn't also say far more clearly, so you may as well just replace it
> entirely.

No problem. Will do in v2.

P.
--

> 
> Robin.
> 
> >+ * IOMMU API for Renesas VMSA-compatible IPMMU
> >+ * Author: Laurent Pinchart <laurent.pinchart-ryLnwIuWjnjg/C1BVhZhaw@public.gmane.org>

[...]

^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: [PATCH 5/9] iommu: ipmmu-vmsa: make it explicitly non-modular
  2018-11-28 15:32       ` Paul Gortmaker
  (?)
@ 2018-11-28 17:22       ` Laurent Pinchart
  2018-11-28 22:10           ` Paul Gortmaker
  -1 siblings, 1 reply; 52+ messages in thread
From: Laurent Pinchart @ 2018-11-28 17:22 UTC (permalink / raw)
  To: Paul Gortmaker; +Cc: Robin Murphy, Joerg Roedel, iommu, linux-kernel

Hi Paul,

On Wednesday, 28 November 2018 17:32:05 EET Paul Gortmaker wrote:
> [Re: [PATCH 5/9] iommu: ipmmu-vmsa: make it explicitly non-modular] On 
28/11/2018 (Wed 12:50) Robin Murphy wrote:
> > On 26/11/2018 22:31, Paul Gortmaker wrote:
> [...]
> 
> >> diff --git a/drivers/iommu/ipmmu-vmsa.c b/drivers/iommu/ipmmu-vmsa.c
> >> index 9e2655f1c1bf..de39ef992d8a 100644
> >> --- a/drivers/iommu/ipmmu-vmsa.c
> >> +++ b/drivers/iommu/ipmmu-vmsa.c
> >> @@ -1,6 +1,8 @@
> >>
> >>  // SPDX-License-Identifier: GPL-2.0
> >>  /*
> >>   * IPMMU VMSA
> > 
> > Nit: this line doesn't convey any information that the module description
> > below doesn't also say far more clearly, so you may as well just replace
> > it entirely.
> 
> No problem. Will do in v2.

With that change, the blank line after MODULE_DEVICE_TABLE() removed, and 
<linux/init.h> moved to keep alphabetical order sorting of the includes, 
please add

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

to v2. Thank you for the patch.

> > >+ * IOMMU API for Renesas VMSA-compatible IPMMU
> > >+ * Author: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> 
> [...]

-- 
Regards,

Laurent Pinchart




^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: [PATCH 8/9] iommu: arm-smmu: make it explicitly non-modular
  2018-11-28 15:24       ` Paul Gortmaker
@ 2018-11-28 17:28         ` Robin Murphy
  -1 siblings, 0 replies; 52+ messages in thread
From: Robin Murphy @ 2018-11-28 17:28 UTC (permalink / raw)
  To: Paul Gortmaker
  Cc: Joerg Roedel, iommu, linux-kernel, Will Deacon, Nate Watterson,
	linux-arm-kernel

On 28/11/2018 15:24, Paul Gortmaker wrote:
> [Re: [PATCH 8/9] iommu: arm-smmu: make it explicitly non-modular] On 28/11/2018 (Wed 12:42) Robin Murphy wrote:
> 
>> Hi Paul,
>>
>> On 26/11/2018 22:31, Paul Gortmaker wrote:
> 
> [...]
> 
>>> We add a moduleparam.h include since the file does actually declare
>>> some module parameters, and leaving them as such is the easiest way
>>> currently to remain backwards compatible with existing use cases.
> 
> [...]
> 
> 
>> Is it worth introducing builtin_param() and friends for this sort of thing,
>> to echo the *_platform_driver() helpers? It seems like that could be
>> justifiable under the motivation described in the cover letter.
> 
> I've definitely gone back and looked at this a few times when coming
> across the few corner cases like these, to remind myself why I didn't do
> it already.
> 
> We'd not want to replicate all the module_param stuff as an instance of
> builtin_param() because we already have setup() and setup_param() in
> init.h -- however they don't do the file name in the param - hence the
> reason it isn't a direct swap in replacement.
> 
> So, it would become some more complex refactoring of moduleparam.h into
> say bootparam.h - to reduce code/macro duplication, while at the same
> time being aware of existing setup_param stuff and making something like
> a new setup_param_named() that is consistent with existing setup fcns.
> 
> And based on past experience, there will be reviewers who don't see the
> value in the distinction and simply reply with two words "why bother?".
> 
> Not impossible, but not as simple as the builtin_platform_driver and
> similar wrappers that I've already added to mainline.  You've made we
> want to go have another look at it again, but in the meantime we can do
> what I've done here, and circle around later to update the few instances
> of moduleparam in non-modules once/if the refactoring I describe above
> works out and is accepted in mainline.

Sure, I definitely agree with doing a first pass like this to sweep up 
all the cruft and audit the module_param users at the same time, then 
considering a robust refactoring once we've got a clear idea of how many 
users actually need it.

TBH, at this point I was thinking along the lines of a simple:

#ifndef MODULE
#define builtin_param(name, type, perm)			\
	module_param(name, type, perm)
#define builtin_param_named(name, name, type, perrm)	\
	module_param_named(name, name, type, perm)
#endif

still in moduleparam.h, purely so that the intent can be made really 
clear in driver code and it's more searchable than just comments. But 
yeah, even that would probably be objectionable to many.

>> Otherwise, the changes look reasonable. I still hold out hope that one day
>> we'll be able to make IOMMU drivers modular (it can work with minimal hacks
>> today, but it's far from robust in general), but for now I agree this makes
>> sense (and it'll be easy enough to revert for playing with further hacks).
> 
> I totally agree - I've had similar discussions with the DMA maintainers,
> and if being modular can be made to work and has a use case - great!
> 
> But it should be a conscious decision, since nobody writes a new driver
> from scratch; they copy one that is "close" as a template and then go
> from there.  Which leads to a good percentage of drivers having hints
> of modular stuff when there is no intent of them ever being modular.
> 
>> With the title fixed up as Joerg asked,
>>
>> Acked-by: Robin Murphy <robin.murphy@arm.com>
> 
> Thanks for the feedback/review.  Will re-send with updated titles before
> the week is finished and a good chance for additional feedback has elapsed.

Great! There's probably some more subtleties that could be tidied up 
when the driver is truly non-removable, but I can take a look at that 
myself once this patch has gone in.

Cheers,
Robin.

^ permalink raw reply	[flat|nested] 52+ messages in thread

* [PATCH 8/9] iommu: arm-smmu: make it explicitly non-modular
@ 2018-11-28 17:28         ` Robin Murphy
  0 siblings, 0 replies; 52+ messages in thread
From: Robin Murphy @ 2018-11-28 17:28 UTC (permalink / raw)
  To: linux-arm-kernel

On 28/11/2018 15:24, Paul Gortmaker wrote:
> [Re: [PATCH 8/9] iommu: arm-smmu: make it explicitly non-modular] On 28/11/2018 (Wed 12:42) Robin Murphy wrote:
> 
>> Hi Paul,
>>
>> On 26/11/2018 22:31, Paul Gortmaker wrote:
> 
> [...]
> 
>>> We add a moduleparam.h include since the file does actually declare
>>> some module parameters, and leaving them as such is the easiest way
>>> currently to remain backwards compatible with existing use cases.
> 
> [...]
> 
> 
>> Is it worth introducing builtin_param() and friends for this sort of thing,
>> to echo the *_platform_driver() helpers? It seems like that could be
>> justifiable under the motivation described in the cover letter.
> 
> I've definitely gone back and looked at this a few times when coming
> across the few corner cases like these, to remind myself why I didn't do
> it already.
> 
> We'd not want to replicate all the module_param stuff as an instance of
> builtin_param() because we already have setup() and setup_param() in
> init.h -- however they don't do the file name in the param - hence the
> reason it isn't a direct swap in replacement.
> 
> So, it would become some more complex refactoring of moduleparam.h into
> say bootparam.h - to reduce code/macro duplication, while at the same
> time being aware of existing setup_param stuff and making something like
> a new setup_param_named() that is consistent with existing setup fcns.
> 
> And based on past experience, there will be reviewers who don't see the
> value in the distinction and simply reply with two words "why bother?".
> 
> Not impossible, but not as simple as the builtin_platform_driver and
> similar wrappers that I've already added to mainline.  You've made we
> want to go have another look at it again, but in the meantime we can do
> what I've done here, and circle around later to update the few instances
> of moduleparam in non-modules once/if the refactoring I describe above
> works out and is accepted in mainline.

Sure, I definitely agree with doing a first pass like this to sweep up 
all the cruft and audit the module_param users at the same time, then 
considering a robust refactoring once we've got a clear idea of how many 
users actually need it.

TBH, at this point I was thinking along the lines of a simple:

#ifndef MODULE
#define builtin_param(name, type, perm)			\
	module_param(name, type, perm)
#define builtin_param_named(name, name, type, perrm)	\
	module_param_named(name, name, type, perm)
#endif

still in moduleparam.h, purely so that the intent can be made really 
clear in driver code and it's more searchable than just comments. But 
yeah, even that would probably be objectionable to many.

>> Otherwise, the changes look reasonable. I still hold out hope that one day
>> we'll be able to make IOMMU drivers modular (it can work with minimal hacks
>> today, but it's far from robust in general), but for now I agree this makes
>> sense (and it'll be easy enough to revert for playing with further hacks).
> 
> I totally agree - I've had similar discussions with the DMA maintainers,
> and if being modular can be made to work and has a use case - great!
> 
> But it should be a conscious decision, since nobody writes a new driver
> from scratch; they copy one that is "close" as a template and then go
> from there.  Which leads to a good percentage of drivers having hints
> of modular stuff when there is no intent of them ever being modular.
> 
>> With the title fixed up as Joerg asked,
>>
>> Acked-by: Robin Murphy <robin.murphy@arm.com>
> 
> Thanks for the feedback/review.  Will re-send with updated titles before
> the week is finished and a good chance for additional feedback has elapsed.

Great! There's probably some more subtleties that could be tidied up 
when the driver is truly non-removable, but I can take a look at that 
myself once this patch has gone in.

Cheers,
Robin.

^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: [PATCH 5/9] iommu: ipmmu-vmsa: make it explicitly non-modular
  2018-11-28 17:22       ` Laurent Pinchart
@ 2018-11-28 22:10           ` Paul Gortmaker
  0 siblings, 0 replies; 52+ messages in thread
From: Paul Gortmaker @ 2018-11-28 22:10 UTC (permalink / raw)
  To: Laurent Pinchart; +Cc: Robin Murphy, Joerg Roedel, iommu, linux-kernel

[Re: [PATCH 5/9] iommu: ipmmu-vmsa: make it explicitly non-modular] On 28/11/2018 (Wed 19:22) Laurent Pinchart wrote:

> Hi Paul,
> 
> On Wednesday, 28 November 2018 17:32:05 EET Paul Gortmaker wrote:
> > [Re: [PATCH 5/9] iommu: ipmmu-vmsa: make it explicitly non-modular] On 
> 28/11/2018 (Wed 12:50) Robin Murphy wrote:
> > > On 26/11/2018 22:31, Paul Gortmaker wrote:
> > [...]
> > 
> > >> diff --git a/drivers/iommu/ipmmu-vmsa.c b/drivers/iommu/ipmmu-vmsa.c
> > >> index 9e2655f1c1bf..de39ef992d8a 100644
> > >> --- a/drivers/iommu/ipmmu-vmsa.c
> > >> +++ b/drivers/iommu/ipmmu-vmsa.c
> > >> @@ -1,6 +1,8 @@
> > >>
> > >>  // SPDX-License-Identifier: GPL-2.0
> > >>  /*
> > >>   * IPMMU VMSA
> > > 
> > > Nit: this line doesn't convey any information that the module description
> > > below doesn't also say far more clearly, so you may as well just replace
> > > it entirely.
> > 
> > No problem. Will do in v2.
> 
> With that change, the blank line after MODULE_DEVICE_TABLE() removed, and 
> <linux/init.h> moved to keep alphabetical order sorting of the includes, 
> please add
> 
> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

Updated and review tag added for v2.

Paul.
--

> 
> to v2. Thank you for the patch.
> 
> > > >+ * IOMMU API for Renesas VMSA-compatible IPMMU
> > > >+ * Author: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> > 
> > [...]
> 
> -- 
> Regards,
> 
> Laurent Pinchart
> 
> 
> 

^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: [PATCH 5/9] iommu: ipmmu-vmsa: make it explicitly non-modular
@ 2018-11-28 22:10           ` Paul Gortmaker
  0 siblings, 0 replies; 52+ messages in thread
From: Paul Gortmaker @ 2018-11-28 22:10 UTC (permalink / raw)
  To: Laurent Pinchart
  Cc: Robin Murphy, iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA

[Re: [PATCH 5/9] iommu: ipmmu-vmsa: make it explicitly non-modular] On 28/11/2018 (Wed 19:22) Laurent Pinchart wrote:

> Hi Paul,
> 
> On Wednesday, 28 November 2018 17:32:05 EET Paul Gortmaker wrote:
> > [Re: [PATCH 5/9] iommu: ipmmu-vmsa: make it explicitly non-modular] On 
> 28/11/2018 (Wed 12:50) Robin Murphy wrote:
> > > On 26/11/2018 22:31, Paul Gortmaker wrote:
> > [...]
> > 
> > >> diff --git a/drivers/iommu/ipmmu-vmsa.c b/drivers/iommu/ipmmu-vmsa.c
> > >> index 9e2655f1c1bf..de39ef992d8a 100644
> > >> --- a/drivers/iommu/ipmmu-vmsa.c
> > >> +++ b/drivers/iommu/ipmmu-vmsa.c
> > >> @@ -1,6 +1,8 @@
> > >>
> > >>  // SPDX-License-Identifier: GPL-2.0
> > >>  /*
> > >>   * IPMMU VMSA
> > > 
> > > Nit: this line doesn't convey any information that the module description
> > > below doesn't also say far more clearly, so you may as well just replace
> > > it entirely.
> > 
> > No problem. Will do in v2.
> 
> With that change, the blank line after MODULE_DEVICE_TABLE() removed, and 
> <linux/init.h> moved to keep alphabetical order sorting of the includes, 
> please add
> 
> Reviewed-by: Laurent Pinchart <laurent.pinchart-ryLnwIuWjnjg/C1BVhZhaw@public.gmane.org>

Updated and review tag added for v2.

Paul.
--

> 
> to v2. Thank you for the patch.
> 
> > > >+ * IOMMU API for Renesas VMSA-compatible IPMMU
> > > >+ * Author: Laurent Pinchart <laurent.pinchart-ryLnwIuWjnjg/C1BVhZhaw@public.gmane.org>
> > 
> > [...]
> 
> -- 
> Regards,
> 
> Laurent Pinchart
> 
> 
> 

^ permalink raw reply	[flat|nested] 52+ messages in thread

end of thread, other threads:[~2018-11-28 22:13 UTC | newest]

Thread overview: 52+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-26 22:31 [PATCH 0/9] iommu: clean up/remove modular stuff from non-modules Paul Gortmaker
2018-11-26 22:31 ` Paul Gortmaker
2018-11-26 22:31 ` Paul Gortmaker
2018-11-26 22:31 ` [PATCH 1/9] iommu: audit and remove any unnecessary uses of module.h Paul Gortmaker
2018-11-26 22:31   ` Paul Gortmaker
2018-11-26 22:31 ` [PATCH 2/9] iommu: rockchip: make it explicitly non-modular Paul Gortmaker
2018-11-26 22:31   ` Paul Gortmaker
2018-11-26 22:31   ` Paul Gortmaker
2018-11-26 23:37   ` Heiko Stuebner
2018-11-26 23:37     ` Heiko Stuebner
2018-11-26 23:37     ` Heiko Stuebner
2018-11-26 22:31 ` [PATCH 3/9] iommu: msm_iommu: " Paul Gortmaker
2018-11-26 22:31   ` Paul Gortmaker
2018-11-26 22:31 ` [PATCH 4/9] iommu: mtk_iommu: " Paul Gortmaker
2018-11-26 22:31   ` Paul Gortmaker
2018-11-27  1:25   ` Honghui Zhang
2018-11-27  1:25     ` Honghui Zhang
2018-11-26 22:31 ` [PATCH 5/9] iommu: ipmmu-vmsa: " Paul Gortmaker
2018-11-26 22:31   ` Paul Gortmaker
2018-11-28 12:50   ` Robin Murphy
2018-11-28 15:32     ` Paul Gortmaker
2018-11-28 15:32       ` Paul Gortmaker
2018-11-28 17:22       ` Laurent Pinchart
2018-11-28 22:10         ` Paul Gortmaker
2018-11-28 22:10           ` Paul Gortmaker
     [not found] ` <1543271498-28966-1-git-send-email-paul.gortmaker-CWA4WttNNZF54TAoqtyWWQ@public.gmane.org>
2018-11-26 22:31   ` [PATCH 6/9] iommu: qcom_iommu: " Paul Gortmaker
2018-11-26 22:31     ` Paul Gortmaker
2018-11-26 22:31   ` [PATCH 7/9] iommu: tegra-gart: " Paul Gortmaker
2018-11-26 22:31     ` Paul Gortmaker
2018-11-27 14:18     ` Thierry Reding
2018-11-26 22:31 ` [PATCH 8/9] iommu: arm-smmu: " Paul Gortmaker
2018-11-26 22:31   ` Paul Gortmaker
2018-11-26 22:31   ` Paul Gortmaker
2018-11-28 12:42   ` Robin Murphy
2018-11-28 12:42     ` Robin Murphy
2018-11-28 15:24     ` Paul Gortmaker
2018-11-28 15:24       ` Paul Gortmaker
2018-11-28 15:24       ` Paul Gortmaker
2018-11-28 17:28       ` Robin Murphy
2018-11-28 17:28         ` Robin Murphy
2018-11-26 22:31 ` [PATCH 9/9] iommu: arm-smmu-v3: " Paul Gortmaker
2018-11-26 22:31   ` Paul Gortmaker
2018-11-26 22:31   ` Paul Gortmaker
2018-11-28 12:44   ` Robin Murphy
2018-11-28 12:44     ` Robin Murphy
2018-11-28 12:44     ` Robin Murphy
2018-11-27 10:11 ` [PATCH 0/9] iommu: clean up/remove modular stuff from non-modules Joerg Roedel
2018-11-27 10:11   ` Joerg Roedel
2018-11-27 10:11   ` Joerg Roedel
     [not found]   ` <20181127101156.GA12298-zLv9SwRftAIdnm+yROfE0A@public.gmane.org>
2018-11-27 14:39     ` Paul Gortmaker
2018-11-27 14:39       ` Paul Gortmaker
2018-11-27 14:39       ` Paul Gortmaker

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.