All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/7] Introduce builtin_driver and use it for non-modular code
@ 2015-05-10 19:49 ` Paul Gortmaker
  0 siblings, 0 replies; 49+ messages in thread
From: Paul Gortmaker @ 2015-05-10 19:49 UTC (permalink / raw)
  To: linux-kernel-u79uwXL29TY76Z2rM5mHXA
  Cc: Paul Gortmaker, Alexandre Courbot, Arnd Bergmann, Axel Lin,
	Daniel Lezcano, David Woodhouse, Dmitry Eremin-Solenikov,
	Greg Kroah-Hartman, Kukjin Kim, Linus Walleij, Michal Simek,
	Rafael J. Wysocki, Sebastian Reichel, Stephen Warren,
	Thierry Reding, Viresh Kumar,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	linux-pm-u79uwXL29TY76Z2rM5mHXA,
	linux-tegra-u79uwXL29TY76Z2rM5mHXA

We see an increasing number of non-modular drivers using the
modular_driver() type register functions.  There are several
downsides to this (as listed in the 1st commit log), so here
we introduce similar non-modular macros for builtin drivers.

Then we convert builtin drivers (controlled by a bool Kconfig)
by making the following type of changes:

  module_platform_driver()       --->  builtin_platform_driver()
  module_platform_driver_probe() --->  builtin_platform_driver_probe().

The set of drivers that are converted here are just the ones that
showed up as relying on an implicit include of <module.h> during
a pending header cleanup.  So we convert them here vs. adding
an include of <module.h> to non-modular code to avoid compile fails.
Additonal conversions can be done asynchronously at any time.

These changes, and the pending header cleanup are a refactoring of
a larger series[1] into smaller, more easily reviewed chunks that
share a common theme.

Note to maintainers:  None of the conversion patches here can be
taken into subtrees individually, since they all rely on the 1st
patch to add the builtin macros.  But I'll add Acks as requested.

Thanks,
Paul.

[1] https://marc.info/?l=linux-kernel&m=139033951228828
---

Cc: Alexandre Courbot <gnurou-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: Arnd Bergmann <arnd-r2nGTMty4D4@public.gmane.org>
Cc: Axel Lin <axel.lin-8E1dMatC8ynQT0dZR+AlfA@public.gmane.org>
Cc: Daniel Lezcano <daniel.lezcano-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
Cc: David Woodhouse <dwmw2-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>
Cc: Dmitry Eremin-Solenikov <dbaryshkov-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: Greg Kroah-Hartman <gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org>
Cc: Kukjin Kim <kgene-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
Cc: Linus Walleij <linus.walleij-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
Cc: Michal Simek <michal.simek-gjFFaj9aHVfQT0dZR+AlfA@public.gmane.org>
Cc: "Rafael J. Wysocki" <rjw-LthD3rsA81gm4RdzfppkhA@public.gmane.org>
Cc: Sebastian Reichel <sre-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
Cc: Stephen Warren <swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
Cc: Thierry Reding <thierry.reding-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: Viresh Kumar <viresh.kumar-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
Cc: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
Cc: linux-pm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Cc: linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org

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

* [PATCH 0/7] Introduce builtin_driver and use it for non-modular code
@ 2015-05-10 19:49 ` Paul Gortmaker
  0 siblings, 0 replies; 49+ messages in thread
From: Paul Gortmaker @ 2015-05-10 19:49 UTC (permalink / raw)
  To: linux-kernel
  Cc: Paul Gortmaker, Alexandre Courbot, Arnd Bergmann, Axel Lin,
	Daniel Lezcano, David Woodhouse, Dmitry Eremin-Solenikov,
	Greg Kroah-Hartman, Kukjin Kim, Linus Walleij, Michal Simek,
	Rafael J. Wysocki, Sebastian Reichel, Stephen Warren,
	Thierry Reding, Viresh Kumar, linux-arm-kernel, linux-pm,
	linux-tegra

We see an increasing number of non-modular drivers using the
modular_driver() type register functions.  There are several
downsides to this (as listed in the 1st commit log), so here
we introduce similar non-modular macros for builtin drivers.

Then we convert builtin drivers (controlled by a bool Kconfig)
by making the following type of changes:

  module_platform_driver()       --->  builtin_platform_driver()
  module_platform_driver_probe() --->  builtin_platform_driver_probe().

The set of drivers that are converted here are just the ones that
showed up as relying on an implicit include of <module.h> during
a pending header cleanup.  So we convert them here vs. adding
an include of <module.h> to non-modular code to avoid compile fails.
Additonal conversions can be done asynchronously at any time.

These changes, and the pending header cleanup are a refactoring of
a larger series[1] into smaller, more easily reviewed chunks that
share a common theme.

Note to maintainers:  None of the conversion patches here can be
taken into subtrees individually, since they all rely on the 1st
patch to add the builtin macros.  But I'll add Acks as requested.

Thanks,
Paul.

[1] https://marc.info/?l=linux-kernel&m=139033951228828
---

Cc: Alexandre Courbot <gnurou@gmail.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Axel Lin <axel.lin@ingics.com>
Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
Cc: David Woodhouse <dwmw2@infradead.org>
Cc: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Kukjin Kim <kgene@kernel.org>
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Michal Simek <michal.simek@xilinx.com>
Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
Cc: Sebastian Reichel <sre@kernel.org>
Cc: Stephen Warren <swarren@wwwdotorg.org>
Cc: Thierry Reding <thierry.reding@gmail.com>
Cc: Viresh Kumar <viresh.kumar@linaro.org>
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-pm@vger.kernel.org
Cc: linux-tegra@vger.kernel.org

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

* [PATCH 0/7] Introduce builtin_driver and use it for non-modular code
@ 2015-05-10 19:49 ` Paul Gortmaker
  0 siblings, 0 replies; 49+ messages in thread
From: Paul Gortmaker @ 2015-05-10 19:49 UTC (permalink / raw)
  To: linux-arm-kernel

We see an increasing number of non-modular drivers using the
modular_driver() type register functions.  There are several
downsides to this (as listed in the 1st commit log), so here
we introduce similar non-modular macros for builtin drivers.

Then we convert builtin drivers (controlled by a bool Kconfig)
by making the following type of changes:

  module_platform_driver()       --->  builtin_platform_driver()
  module_platform_driver_probe() --->  builtin_platform_driver_probe().

The set of drivers that are converted here are just the ones that
showed up as relying on an implicit include of <module.h> during
a pending header cleanup.  So we convert them here vs. adding
an include of <module.h> to non-modular code to avoid compile fails.
Additonal conversions can be done asynchronously at any time.

These changes, and the pending header cleanup are a refactoring of
a larger series[1] into smaller, more easily reviewed chunks that
share a common theme.

Note to maintainers:  None of the conversion patches here can be
taken into subtrees individually, since they all rely on the 1st
patch to add the builtin macros.  But I'll add Acks as requested.

Thanks,
Paul.

[1] https://marc.info/?l=linux-kernel&m=139033951228828
---

Cc: Alexandre Courbot <gnurou@gmail.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Axel Lin <axel.lin@ingics.com>
Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
Cc: David Woodhouse <dwmw2@infradead.org>
Cc: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Kukjin Kim <kgene@kernel.org>
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Michal Simek <michal.simek@xilinx.com>
Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
Cc: Sebastian Reichel <sre@kernel.org>
Cc: Stephen Warren <swarren@wwwdotorg.org>
Cc: Thierry Reding <thierry.reding@gmail.com>
Cc: Viresh Kumar <viresh.kumar@linaro.org>
Cc: linux-arm-kernel at lists.infradead.org
Cc: linux-pm at vger.kernel.org
Cc: linux-tegra at vger.kernel.org

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

* [PATCH 1/7] platform_device: better support builtin boilerplate avoidance
  2015-05-10 19:49 ` Paul Gortmaker
  (?)
  (?)
@ 2015-05-10 19:49 ` Paul Gortmaker
  2015-05-12 11:46   ` Linus Walleij
  -1 siblings, 1 reply; 49+ messages in thread
From: Paul Gortmaker @ 2015-05-10 19:49 UTC (permalink / raw)
  To: linux-kernel; +Cc: Paul Gortmaker, Greg Kroah-Hartman

We have macros that help reduce the boilerplate for modules
that register with no extra init/exit complexity other than the
most standard use case.  However we see an increasing number of
non-modular drivers using these modular_driver() type register
functions.

There are several downsides to this:
1) The code can appear modular to a reader of the code, and they
   won't know if the code really is modular without checking the
   Makefile and Kconfig to see if compilation is governed by a
   bool or tristate.
2) Coders of drivers may be tempted to code up an __exit function
   that is never used, just in order to satisfy the required three
   args of the modular registration function.
3) Non-modular code ends up including the <module.h> which increases
   CPP overhead that they don't need.
4) It hinders us from performing better separation of the module
   init code and the generic init code.

Here we introduce similar macros, with the mapping from module_driver
to builtin_driver and similar, so that simple changes of:

  module_platform_driver()       --->  builtin_platform_driver()
  module_platform_driver_probe() --->  builtin_platform_driver_probe().

can help us avoid #3 above, without having to code up the same
__init functions and device_initcall() boilerplate.

For non modular code, module_init becomes __initcall.  But direct use
of __initcall is discouraged, vs. one of the priority categorized
subgroups.  As __initcall gets mapped onto device_initcall, our
use of device_initcall directly in this change means that the
runtime impact is zero -- drivers will remain at level 6 in the
initcall ordering.

Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---

[checkpatch complains about this patch, but I choose to ignore that
 and keep the added code 100% consistent with the existing code.]

 include/linux/device.h          | 22 ++++++++++++++++++++++
 include/linux/platform_device.h | 23 +++++++++++++++++++++++
 2 files changed, 45 insertions(+)

diff --git a/include/linux/device.h b/include/linux/device.h
index 6558af90c8fe..c2d6167cb4a3 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -1269,4 +1269,26 @@ static void __exit __driver##_exit(void) \
 } \
 module_exit(__driver##_exit);
 
+/**
+ * builtin_driver() - Helper macro for drivers that don't do anything
+ * special in init and have no exit. This eliminates some boilerplate.
+ * Each driver may only use this macro once, and calling it replaces
+ * device_initcall (or in some cases, the legacy __initcall).  This is
+ * meant to be a direct parallel of module_driver() above but without
+ * the __exit stuff that is not used for builtin cases.
+ *
+ * @__driver: driver name
+ * @__register: register function for this driver type
+ * @...: Additional arguments to be passed to __register
+ *
+ * Use this macro to construct bus specific macros for registering
+ * drivers, and do not use it on its own.
+ */
+#define builtin_driver(__driver, __register, ...) \
+static int __init __driver##_init(void) \
+{ \
+	return __register(&(__driver) , ##__VA_ARGS__); \
+} \
+device_initcall(__driver##_init);
+
 #endif /* _DEVICE_H_ */
diff --git a/include/linux/platform_device.h b/include/linux/platform_device.h
index 58f1e75ba105..bba08f44cc97 100644
--- a/include/linux/platform_device.h
+++ b/include/linux/platform_device.h
@@ -222,6 +222,15 @@ static inline void platform_set_drvdata(struct platform_device *pdev,
 	module_driver(__platform_driver, platform_driver_register, \
 			platform_driver_unregister)
 
+/* builtin_platform_driver() - Helper macro for builtin drivers that
+ * don't do anything special in driver init.  This eliminates some
+ * boilerplate.  Each driver may only use this macro once, and
+ * calling it replaces device_initcall().  Note this is meant to be
+ * a parallel of module_platform_driver() above, but w/o _exit stuff.
+ */
+#define builtin_platform_driver(__platform_driver) \
+	builtin_driver(__platform_driver, platform_driver_register)
+
 /* module_platform_driver_probe() - Helper macro for drivers that don't do
  * anything special in module init/exit.  This eliminates a lot of
  * boilerplate.  Each module may only use this macro once, and
@@ -240,6 +249,20 @@ static void __exit __platform_driver##_exit(void) \
 } \
 module_exit(__platform_driver##_exit);
 
+/* builtin_platform_driver_probe() - Helper macro for drivers that don't do
+ * anything special in device init.  This eliminates some boilerplate.  Each
+ * driver may only use this macro once, and using it replaces device_initcall.
+ * This is meant to be a parallel of module_platform_driver_probe above, but
+ * without the __exit parts.
+ */
+#define builtin_platform_driver_probe(__platform_driver, __platform_probe) \
+static int __init __platform_driver##_init(void) \
+{ \
+	return platform_driver_probe(&(__platform_driver), \
+				     __platform_probe);    \
+} \
+device_initcall(__platform_driver##_init); \
+
 #define platform_create_bundle(driver, probe, res, n_res, data, size) \
 	__platform_create_bundle(driver, probe, res, n_res, data, size, THIS_MODULE)
 extern struct platform_device *__platform_create_bundle(
-- 
2.2.1


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

* [PATCH 2/7] drivers/platform: Convert non-modular pdev_bus to use builtin_driver_register
  2015-05-10 19:49 ` Paul Gortmaker
                   ` (2 preceding siblings ...)
  (?)
@ 2015-05-10 19:49 ` Paul Gortmaker
  -1 siblings, 0 replies; 49+ messages in thread
From: Paul Gortmaker @ 2015-05-10 19:49 UTC (permalink / raw)
  To: linux-kernel; +Cc: Paul Gortmaker

This driver is configured with a Kconfig option that is
declared as a bool.  Hence it is not possible for the code
to be built as modular.  However the code is currently using
the module_platform_driver() macro for driver registration.

While this currently works, we really don't want to be including
the module.h header in non-modular code, which we'll be forced
to do, pending some upcoming code relocation from init.h into
module.h.  So we fix it now by using the non-modular equivalent.
And since we've already established that the code is non-modular,
we can completely drop any code relating to module_exit.

Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
 drivers/platform/goldfish/pdev_bus.c | 12 +-----------
 1 file changed, 1 insertion(+), 11 deletions(-)

diff --git a/drivers/platform/goldfish/pdev_bus.c b/drivers/platform/goldfish/pdev_bus.c
index 8c43589c3edb..1f52462f4cdd 100644
--- a/drivers/platform/goldfish/pdev_bus.c
+++ b/drivers/platform/goldfish/pdev_bus.c
@@ -220,20 +220,10 @@ free_resources:
 	return ret;
 }
 
-static int goldfish_pdev_bus_remove(struct platform_device *pdev)
-{
-	iounmap(pdev_bus_base);
-	free_irq(pdev_bus_irq, pdev);
-	release_mem_region(pdev_bus_addr, pdev_bus_len);
-	return 0;
-}
-
 static struct platform_driver goldfish_pdev_bus_driver = {
 	.probe = goldfish_pdev_bus_probe,
-	.remove = goldfish_pdev_bus_remove,
 	.driver = {
 		.name = "goldfish_pdev_bus"
 	}
 };
-
-module_platform_driver(goldfish_pdev_bus_driver);
+builtin_platform_driver(goldfish_pdev_bus_driver);
-- 
2.2.1


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

* [PATCH 3/7] drivers/cpuidle: Convert non-modular drivers to use builtin_driver_register
  2015-05-10 19:49 ` Paul Gortmaker
  (?)
@ 2015-05-10 19:49   ` Paul Gortmaker
  -1 siblings, 0 replies; 49+ messages in thread
From: Paul Gortmaker @ 2015-05-10 19:49 UTC (permalink / raw)
  To: linux-kernel
  Cc: Paul Gortmaker, Rafael J. Wysocki, Daniel Lezcano, Michal Simek,
	linux-pm, linux-arm-kernel

All these drivers are configured with Kconfig options that are
declared as bool.  Hence it is not possible for the code
to be built as modular.  However the code is currently using the
module_platform_driver() macro for driver registration.

While this currently works, we really don't want to be including
the module.h header in non-modular code, which we'll be forced
to do, pending some upcoming code relocation from init.h into
module.h.  So we fix it now by using the non-modular equivalent.

Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
Cc: Michal Simek <michal.simek@xilinx.com>
Cc: linux-pm@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
 drivers/cpuidle/cpuidle-at91.c    | 3 +--
 drivers/cpuidle/cpuidle-calxeda.c | 3 +--
 drivers/cpuidle/cpuidle-zynq.c    | 3 +--
 3 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/cpuidle/cpuidle-at91.c b/drivers/cpuidle/cpuidle-at91.c
index f2446c78d87c..9c5853b6ca4a 100644
--- a/drivers/cpuidle/cpuidle-at91.c
+++ b/drivers/cpuidle/cpuidle-at91.c
@@ -62,5 +62,4 @@ static struct platform_driver at91_cpuidle_driver = {
 	},
 	.probe = at91_cpuidle_probe,
 };
-
-module_platform_driver(at91_cpuidle_driver);
+builtin_platform_driver(at91_cpuidle_driver);
diff --git a/drivers/cpuidle/cpuidle-calxeda.c b/drivers/cpuidle/cpuidle-calxeda.c
index 9445e6cc02be..c13feec89ea1 100644
--- a/drivers/cpuidle/cpuidle-calxeda.c
+++ b/drivers/cpuidle/cpuidle-calxeda.c
@@ -75,5 +75,4 @@ static struct platform_driver calxeda_cpuidle_plat_driver = {
         },
         .probe = calxeda_cpuidle_probe,
 };
-
-module_platform_driver(calxeda_cpuidle_plat_driver);
+builtin_platform_driver(calxeda_cpuidle_plat_driver);
diff --git a/drivers/cpuidle/cpuidle-zynq.c b/drivers/cpuidle/cpuidle-zynq.c
index 543292b1d38e..6f4257fc56e5 100644
--- a/drivers/cpuidle/cpuidle-zynq.c
+++ b/drivers/cpuidle/cpuidle-zynq.c
@@ -73,5 +73,4 @@ static struct platform_driver zynq_cpuidle_driver = {
 	},
 	.probe = zynq_cpuidle_probe,
 };
-
-module_platform_driver(zynq_cpuidle_driver);
+builtin_platform_driver(zynq_cpuidle_driver);
-- 
2.2.1


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

* [PATCH 3/7] drivers/cpuidle: Convert non-modular drivers to use builtin_driver_register
@ 2015-05-10 19:49   ` Paul Gortmaker
  0 siblings, 0 replies; 49+ messages in thread
From: Paul Gortmaker @ 2015-05-10 19:49 UTC (permalink / raw)
  To: linux-kernel
  Cc: Paul Gortmaker, Rafael J. Wysocki, Daniel Lezcano, Michal Simek,
	linux-pm, linux-arm-kernel

All these drivers are configured with Kconfig options that are
declared as bool.  Hence it is not possible for the code
to be built as modular.  However the code is currently using the
module_platform_driver() macro for driver registration.

While this currently works, we really don't want to be including
the module.h header in non-modular code, which we'll be forced
to do, pending some upcoming code relocation from init.h into
module.h.  So we fix it now by using the non-modular equivalent.

Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
Cc: Michal Simek <michal.simek@xilinx.com>
Cc: linux-pm@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
 drivers/cpuidle/cpuidle-at91.c    | 3 +--
 drivers/cpuidle/cpuidle-calxeda.c | 3 +--
 drivers/cpuidle/cpuidle-zynq.c    | 3 +--
 3 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/cpuidle/cpuidle-at91.c b/drivers/cpuidle/cpuidle-at91.c
index f2446c78d87c..9c5853b6ca4a 100644
--- a/drivers/cpuidle/cpuidle-at91.c
+++ b/drivers/cpuidle/cpuidle-at91.c
@@ -62,5 +62,4 @@ static struct platform_driver at91_cpuidle_driver = {
 	},
 	.probe = at91_cpuidle_probe,
 };
-
-module_platform_driver(at91_cpuidle_driver);
+builtin_platform_driver(at91_cpuidle_driver);
diff --git a/drivers/cpuidle/cpuidle-calxeda.c b/drivers/cpuidle/cpuidle-calxeda.c
index 9445e6cc02be..c13feec89ea1 100644
--- a/drivers/cpuidle/cpuidle-calxeda.c
+++ b/drivers/cpuidle/cpuidle-calxeda.c
@@ -75,5 +75,4 @@ static struct platform_driver calxeda_cpuidle_plat_driver = {
         },
         .probe = calxeda_cpuidle_probe,
 };
-
-module_platform_driver(calxeda_cpuidle_plat_driver);
+builtin_platform_driver(calxeda_cpuidle_plat_driver);
diff --git a/drivers/cpuidle/cpuidle-zynq.c b/drivers/cpuidle/cpuidle-zynq.c
index 543292b1d38e..6f4257fc56e5 100644
--- a/drivers/cpuidle/cpuidle-zynq.c
+++ b/drivers/cpuidle/cpuidle-zynq.c
@@ -73,5 +73,4 @@ static struct platform_driver zynq_cpuidle_driver = {
 	},
 	.probe = zynq_cpuidle_probe,
 };
-
-module_platform_driver(zynq_cpuidle_driver);
+builtin_platform_driver(zynq_cpuidle_driver);
-- 
2.2.1

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

* [PATCH 3/7] drivers/cpuidle: Convert non-modular drivers to use builtin_driver_register
@ 2015-05-10 19:49   ` Paul Gortmaker
  0 siblings, 0 replies; 49+ messages in thread
From: Paul Gortmaker @ 2015-05-10 19:49 UTC (permalink / raw)
  To: linux-arm-kernel

All these drivers are configured with Kconfig options that are
declared as bool.  Hence it is not possible for the code
to be built as modular.  However the code is currently using the
module_platform_driver() macro for driver registration.

While this currently works, we really don't want to be including
the module.h header in non-modular code, which we'll be forced
to do, pending some upcoming code relocation from init.h into
module.h.  So we fix it now by using the non-modular equivalent.

Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
Cc: Michal Simek <michal.simek@xilinx.com>
Cc: linux-pm at vger.kernel.org
Cc: linux-arm-kernel at lists.infradead.org
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
 drivers/cpuidle/cpuidle-at91.c    | 3 +--
 drivers/cpuidle/cpuidle-calxeda.c | 3 +--
 drivers/cpuidle/cpuidle-zynq.c    | 3 +--
 3 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/cpuidle/cpuidle-at91.c b/drivers/cpuidle/cpuidle-at91.c
index f2446c78d87c..9c5853b6ca4a 100644
--- a/drivers/cpuidle/cpuidle-at91.c
+++ b/drivers/cpuidle/cpuidle-at91.c
@@ -62,5 +62,4 @@ static struct platform_driver at91_cpuidle_driver = {
 	},
 	.probe = at91_cpuidle_probe,
 };
-
-module_platform_driver(at91_cpuidle_driver);
+builtin_platform_driver(at91_cpuidle_driver);
diff --git a/drivers/cpuidle/cpuidle-calxeda.c b/drivers/cpuidle/cpuidle-calxeda.c
index 9445e6cc02be..c13feec89ea1 100644
--- a/drivers/cpuidle/cpuidle-calxeda.c
+++ b/drivers/cpuidle/cpuidle-calxeda.c
@@ -75,5 +75,4 @@ static struct platform_driver calxeda_cpuidle_plat_driver = {
         },
         .probe = calxeda_cpuidle_probe,
 };
-
-module_platform_driver(calxeda_cpuidle_plat_driver);
+builtin_platform_driver(calxeda_cpuidle_plat_driver);
diff --git a/drivers/cpuidle/cpuidle-zynq.c b/drivers/cpuidle/cpuidle-zynq.c
index 543292b1d38e..6f4257fc56e5 100644
--- a/drivers/cpuidle/cpuidle-zynq.c
+++ b/drivers/cpuidle/cpuidle-zynq.c
@@ -73,5 +73,4 @@ static struct platform_driver zynq_cpuidle_driver = {
 	},
 	.probe = zynq_cpuidle_probe,
 };
-
-module_platform_driver(zynq_cpuidle_driver);
+builtin_platform_driver(zynq_cpuidle_driver);
-- 
2.2.1

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

* [PATCH 4/7] drivers/cpufreq: Convert non-modular drivers to use builtin_driver_register
  2015-05-10 19:49 ` Paul Gortmaker
  (?)
@ 2015-05-10 19:49   ` Paul Gortmaker
  -1 siblings, 0 replies; 49+ messages in thread
From: Paul Gortmaker @ 2015-05-10 19:49 UTC (permalink / raw)
  To: linux-kernel
  Cc: Paul Gortmaker, Rafael J. Wysocki, Viresh Kumar, Kukjin Kim,
	linux-pm, linux-arm-kernel

These files depend on Kconfig options all of which are a bool, so
we use the appropriate registration function, which avoids us
relying on an implicit inclusion of <module.h> which we are
doing currently.

While this currently works, we really don't want to be including
the module.h header in non-modular code, which we'd be forced
to do, pending some upcoming code relocation from init.h into
module.h.  So we fix it now by using the non-modular equivalent.

Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
Cc: Viresh Kumar <viresh.kumar@linaro.org>
Cc: Kukjin Kim <kgene@kernel.org>
Cc: linux-pm@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
 drivers/cpufreq/exynos-cpufreq.c  | 2 +-
 drivers/cpufreq/s5pv210-cpufreq.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/cpufreq/exynos-cpufreq.c b/drivers/cpufreq/exynos-cpufreq.c
index 82d2fbb20f7e..2c2a19f035ee 100644
--- a/drivers/cpufreq/exynos-cpufreq.c
+++ b/drivers/cpufreq/exynos-cpufreq.c
@@ -236,4 +236,4 @@ static struct platform_driver exynos_cpufreq_platdrv = {
 	},
 	.probe = exynos_cpufreq_probe,
 };
-module_platform_driver(exynos_cpufreq_platdrv);
+builtin_platform_driver(exynos_cpufreq_platdrv);
diff --git a/drivers/cpufreq/s5pv210-cpufreq.c b/drivers/cpufreq/s5pv210-cpufreq.c
index b0dac7d6ba31..9e231f52150c 100644
--- a/drivers/cpufreq/s5pv210-cpufreq.c
+++ b/drivers/cpufreq/s5pv210-cpufreq.c
@@ -659,4 +659,4 @@ static struct platform_driver s5pv210_cpufreq_platdrv = {
 	},
 	.probe = s5pv210_cpufreq_probe,
 };
-module_platform_driver(s5pv210_cpufreq_platdrv);
+builtin_platform_driver(s5pv210_cpufreq_platdrv);
-- 
2.2.1


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

* [PATCH 4/7] drivers/cpufreq: Convert non-modular drivers to use builtin_driver_register
@ 2015-05-10 19:49   ` Paul Gortmaker
  0 siblings, 0 replies; 49+ messages in thread
From: Paul Gortmaker @ 2015-05-10 19:49 UTC (permalink / raw)
  To: linux-kernel
  Cc: Paul Gortmaker, Rafael J. Wysocki, Viresh Kumar, Kukjin Kim,
	linux-pm, linux-arm-kernel

These files depend on Kconfig options all of which are a bool, so
we use the appropriate registration function, which avoids us
relying on an implicit inclusion of <module.h> which we are
doing currently.

While this currently works, we really don't want to be including
the module.h header in non-modular code, which we'd be forced
to do, pending some upcoming code relocation from init.h into
module.h.  So we fix it now by using the non-modular equivalent.

Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
Cc: Viresh Kumar <viresh.kumar@linaro.org>
Cc: Kukjin Kim <kgene@kernel.org>
Cc: linux-pm@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
 drivers/cpufreq/exynos-cpufreq.c  | 2 +-
 drivers/cpufreq/s5pv210-cpufreq.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/cpufreq/exynos-cpufreq.c b/drivers/cpufreq/exynos-cpufreq.c
index 82d2fbb20f7e..2c2a19f035ee 100644
--- a/drivers/cpufreq/exynos-cpufreq.c
+++ b/drivers/cpufreq/exynos-cpufreq.c
@@ -236,4 +236,4 @@ static struct platform_driver exynos_cpufreq_platdrv = {
 	},
 	.probe = exynos_cpufreq_probe,
 };
-module_platform_driver(exynos_cpufreq_platdrv);
+builtin_platform_driver(exynos_cpufreq_platdrv);
diff --git a/drivers/cpufreq/s5pv210-cpufreq.c b/drivers/cpufreq/s5pv210-cpufreq.c
index b0dac7d6ba31..9e231f52150c 100644
--- a/drivers/cpufreq/s5pv210-cpufreq.c
+++ b/drivers/cpufreq/s5pv210-cpufreq.c
@@ -659,4 +659,4 @@ static struct platform_driver s5pv210_cpufreq_platdrv = {
 	},
 	.probe = s5pv210_cpufreq_probe,
 };
-module_platform_driver(s5pv210_cpufreq_platdrv);
+builtin_platform_driver(s5pv210_cpufreq_platdrv);
-- 
2.2.1


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

* [PATCH 4/7] drivers/cpufreq: Convert non-modular drivers to use builtin_driver_register
@ 2015-05-10 19:49   ` Paul Gortmaker
  0 siblings, 0 replies; 49+ messages in thread
From: Paul Gortmaker @ 2015-05-10 19:49 UTC (permalink / raw)
  To: linux-arm-kernel

These files depend on Kconfig options all of which are a bool, so
we use the appropriate registration function, which avoids us
relying on an implicit inclusion of <module.h> which we are
doing currently.

While this currently works, we really don't want to be including
the module.h header in non-modular code, which we'd be forced
to do, pending some upcoming code relocation from init.h into
module.h.  So we fix it now by using the non-modular equivalent.

Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
Cc: Viresh Kumar <viresh.kumar@linaro.org>
Cc: Kukjin Kim <kgene@kernel.org>
Cc: linux-pm at vger.kernel.org
Cc: linux-arm-kernel at lists.infradead.org
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
 drivers/cpufreq/exynos-cpufreq.c  | 2 +-
 drivers/cpufreq/s5pv210-cpufreq.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/cpufreq/exynos-cpufreq.c b/drivers/cpufreq/exynos-cpufreq.c
index 82d2fbb20f7e..2c2a19f035ee 100644
--- a/drivers/cpufreq/exynos-cpufreq.c
+++ b/drivers/cpufreq/exynos-cpufreq.c
@@ -236,4 +236,4 @@ static struct platform_driver exynos_cpufreq_platdrv = {
 	},
 	.probe = exynos_cpufreq_probe,
 };
-module_platform_driver(exynos_cpufreq_platdrv);
+builtin_platform_driver(exynos_cpufreq_platdrv);
diff --git a/drivers/cpufreq/s5pv210-cpufreq.c b/drivers/cpufreq/s5pv210-cpufreq.c
index b0dac7d6ba31..9e231f52150c 100644
--- a/drivers/cpufreq/s5pv210-cpufreq.c
+++ b/drivers/cpufreq/s5pv210-cpufreq.c
@@ -659,4 +659,4 @@ static struct platform_driver s5pv210_cpufreq_platdrv = {
 	},
 	.probe = s5pv210_cpufreq_probe,
 };
-module_platform_driver(s5pv210_cpufreq_platdrv);
+builtin_platform_driver(s5pv210_cpufreq_platdrv);
-- 
2.2.1

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

* [PATCH 5/7] drivers/soc: Convert non-modular tegra/pmc to use builtin_driver_register
  2015-05-10 19:49 ` Paul Gortmaker
@ 2015-05-10 19:49   ` Paul Gortmaker
  -1 siblings, 0 replies; 49+ messages in thread
From: Paul Gortmaker @ 2015-05-10 19:49 UTC (permalink / raw)
  To: linux-kernel
  Cc: Paul Gortmaker, Stephen Warren, Thierry Reding,
	Alexandre Courbot, linux-tegra

This file depends on Kconfig ARCH_TEGRA which is a bool, so
we use the appropriate registration function, which avoids us
relying on an implicit inclusion of <module.h> which we are
doing currently.

While this currently works, we really don't want to be including
the module.h header in non-modular code, which we'd be forced
to do, pending some upcoming code relocation from init.h into
module.h.  So we fix it now by using the non-modular equivalent.

Cc: Stephen Warren <swarren@wwwdotorg.org>
Cc: Thierry Reding <thierry.reding@gmail.com>
Cc: Alexandre Courbot <gnurou@gmail.com>
Cc: linux-tegra@vger.kernel.org
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
 drivers/soc/tegra/pmc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/soc/tegra/pmc.c b/drivers/soc/tegra/pmc.c
index c956395cf46f..e3bca1368058 100644
--- a/drivers/soc/tegra/pmc.c
+++ b/drivers/soc/tegra/pmc.c
@@ -1010,7 +1010,7 @@ static struct platform_driver tegra_pmc_driver = {
 	},
 	.probe = tegra_pmc_probe,
 };
-module_platform_driver(tegra_pmc_driver);
+builtin_platform_driver(tegra_pmc_driver);
 
 /*
  * Early initialization to allow access to registers in the very early boot
-- 
2.2.1

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

* [PATCH 5/7] drivers/soc: Convert non-modular tegra/pmc to use builtin_driver_register
@ 2015-05-10 19:49   ` Paul Gortmaker
  0 siblings, 0 replies; 49+ messages in thread
From: Paul Gortmaker @ 2015-05-10 19:49 UTC (permalink / raw)
  To: linux-kernel
  Cc: Paul Gortmaker, Stephen Warren, Thierry Reding,
	Alexandre Courbot, linux-tegra

This file depends on Kconfig ARCH_TEGRA which is a bool, so
we use the appropriate registration function, which avoids us
relying on an implicit inclusion of <module.h> which we are
doing currently.

While this currently works, we really don't want to be including
the module.h header in non-modular code, which we'd be forced
to do, pending some upcoming code relocation from init.h into
module.h.  So we fix it now by using the non-modular equivalent.

Cc: Stephen Warren <swarren@wwwdotorg.org>
Cc: Thierry Reding <thierry.reding@gmail.com>
Cc: Alexandre Courbot <gnurou@gmail.com>
Cc: linux-tegra@vger.kernel.org
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
 drivers/soc/tegra/pmc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/soc/tegra/pmc.c b/drivers/soc/tegra/pmc.c
index c956395cf46f..e3bca1368058 100644
--- a/drivers/soc/tegra/pmc.c
+++ b/drivers/soc/tegra/pmc.c
@@ -1010,7 +1010,7 @@ static struct platform_driver tegra_pmc_driver = {
 	},
 	.probe = tegra_pmc_probe,
 };
-module_platform_driver(tegra_pmc_driver);
+builtin_platform_driver(tegra_pmc_driver);
 
 /*
  * Early initialization to allow access to registers in the very early boot
-- 
2.2.1


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

* [PATCH 6/7] drivers/soc: Convert non-modular soc-realview to use builtin_driver_register
  2015-05-10 19:49 ` Paul Gortmaker
                   ` (6 preceding siblings ...)
  (?)
@ 2015-05-10 19:49 ` Paul Gortmaker
  2015-05-12 11:39   ` Linus Walleij
  -1 siblings, 1 reply; 49+ messages in thread
From: Paul Gortmaker @ 2015-05-10 19:49 UTC (permalink / raw)
  To: linux-kernel; +Cc: Paul Gortmaker, Arnd Bergmann, Linus Walleij, Axel Lin

This file depends on Kconfig SOC_REALVIEW which is a bool, so
we use the appropriate registration function, which avoids us
relying on an implicit inclusion of <module.h> which we are
doing currently.

While this currently works, we really don't want to be including
the module.h header in non-modular code, which we'd be forced
to do, pending some upcoming code relocation from init.h into
module.h.  So we fix it now by using the non-modular equivalent.

Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
 drivers/soc/versatile/soc-realview.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/soc/versatile/soc-realview.c b/drivers/soc/versatile/soc-realview.c
index 1a07bf540fec..e642c4540dda 100644
--- a/drivers/soc/versatile/soc-realview.c
+++ b/drivers/soc/versatile/soc-realview.c
@@ -142,4 +142,4 @@ static struct platform_driver realview_soc_driver = {
 		.of_match_table = realview_soc_of_match,
 	},
 };
-module_platform_driver(realview_soc_driver);
+builtin_platform_driver(realview_soc_driver);
-- 
2.2.1


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

* [PATCH 7/7] drivers/power: Convert non-modular syscon-reboot to use builtin_driver_register
  2015-05-10 19:49 ` Paul Gortmaker
@ 2015-05-10 19:49   ` Paul Gortmaker
  -1 siblings, 0 replies; 49+ messages in thread
From: Paul Gortmaker @ 2015-05-10 19:49 UTC (permalink / raw)
  To: linux-kernel
  Cc: Paul Gortmaker, Sebastian Reichel, Dmitry Eremin-Solenikov,
	David Woodhouse, linux-pm

This file depends on Kconfig options all of which are a bool, so
we use the appropriate registration function, which avoids us
relying on an implicit inclusion of <module.h> which we are
doing currently.

While this currently works, we really don't want to be including
the module.h header in non-modular code, which we'd be forced
to do, pending some upcoming code relocation from init.h into
module.h.  So we fix it now by using the non-modular equivalent.

Cc: Sebastian Reichel <sre@kernel.org>
Cc: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Cc: David Woodhouse <dwmw2@infradead.org>
Cc: linux-pm@vger.kernel.org
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
 drivers/power/reset/syscon-reboot.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/power/reset/syscon-reboot.c b/drivers/power/reset/syscon-reboot.c
index d3c7d245ae63..7d0d269a0837 100644
--- a/drivers/power/reset/syscon-reboot.c
+++ b/drivers/power/reset/syscon-reboot.c
@@ -88,4 +88,4 @@ static struct platform_driver syscon_reboot_driver = {
 		.of_match_table = syscon_reboot_of_match,
 	},
 };
-module_platform_driver(syscon_reboot_driver);
+builtin_platform_driver(syscon_reboot_driver);
-- 
2.2.1


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

* [PATCH 7/7] drivers/power: Convert non-modular syscon-reboot to use builtin_driver_register
@ 2015-05-10 19:49   ` Paul Gortmaker
  0 siblings, 0 replies; 49+ messages in thread
From: Paul Gortmaker @ 2015-05-10 19:49 UTC (permalink / raw)
  To: linux-kernel
  Cc: Paul Gortmaker, Sebastian Reichel, Dmitry Eremin-Solenikov,
	David Woodhouse, linux-pm

This file depends on Kconfig options all of which are a bool, so
we use the appropriate registration function, which avoids us
relying on an implicit inclusion of <module.h> which we are
doing currently.

While this currently works, we really don't want to be including
the module.h header in non-modular code, which we'd be forced
to do, pending some upcoming code relocation from init.h into
module.h.  So we fix it now by using the non-modular equivalent.

Cc: Sebastian Reichel <sre@kernel.org>
Cc: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Cc: David Woodhouse <dwmw2@infradead.org>
Cc: linux-pm@vger.kernel.org
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
 drivers/power/reset/syscon-reboot.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/power/reset/syscon-reboot.c b/drivers/power/reset/syscon-reboot.c
index d3c7d245ae63..7d0d269a0837 100644
--- a/drivers/power/reset/syscon-reboot.c
+++ b/drivers/power/reset/syscon-reboot.c
@@ -88,4 +88,4 @@ static struct platform_driver syscon_reboot_driver = {
 		.of_match_table = syscon_reboot_of_match,
 	},
 };
-module_platform_driver(syscon_reboot_driver);
+builtin_platform_driver(syscon_reboot_driver);
-- 
2.2.1


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

* Re: [PATCH 3/7] drivers/cpuidle: Convert non-modular drivers to use builtin_driver_register
  2015-05-10 19:49   ` Paul Gortmaker
@ 2015-05-11 17:13     ` Daniel Lezcano
  -1 siblings, 0 replies; 49+ messages in thread
From: Daniel Lezcano @ 2015-05-11 17:13 UTC (permalink / raw)
  To: Paul Gortmaker, linux-kernel
  Cc: Rafael J. Wysocki, Michal Simek, linux-pm, linux-arm-kernel

On 05/10/2015 09:49 PM, Paul Gortmaker wrote:
> All these drivers are configured with Kconfig options that are
> declared as bool.  Hence it is not possible for the code
> to be built as modular.  However the code is currently using the
> module_platform_driver() macro for driver registration.
>
> While this currently works, we really don't want to be including
> the module.h header in non-modular code, which we'll be forced
> to do, pending some upcoming code relocation from init.h into
> module.h.  So we fix it now by using the non-modular equivalent.
>
> Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
> Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
> Cc: Michal Simek <michal.simek@xilinx.com>
> Cc: linux-pm@vger.kernel.org
> Cc: linux-arm-kernel@lists.infradead.org
> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>

Sounds reasonable.

   -- Daniel

> ---
>   drivers/cpuidle/cpuidle-at91.c    | 3 +--
>   drivers/cpuidle/cpuidle-calxeda.c | 3 +--
>   drivers/cpuidle/cpuidle-zynq.c    | 3 +--
>   3 files changed, 3 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/cpuidle/cpuidle-at91.c b/drivers/cpuidle/cpuidle-at91.c
> index f2446c78d87c..9c5853b6ca4a 100644
> --- a/drivers/cpuidle/cpuidle-at91.c
> +++ b/drivers/cpuidle/cpuidle-at91.c
> @@ -62,5 +62,4 @@ static struct platform_driver at91_cpuidle_driver = {
>   	},
>   	.probe = at91_cpuidle_probe,
>   };
> -
> -module_platform_driver(at91_cpuidle_driver);
> +builtin_platform_driver(at91_cpuidle_driver);
> diff --git a/drivers/cpuidle/cpuidle-calxeda.c b/drivers/cpuidle/cpuidle-calxeda.c
> index 9445e6cc02be..c13feec89ea1 100644
> --- a/drivers/cpuidle/cpuidle-calxeda.c
> +++ b/drivers/cpuidle/cpuidle-calxeda.c
> @@ -75,5 +75,4 @@ static struct platform_driver calxeda_cpuidle_plat_driver = {
>           },
>           .probe = calxeda_cpuidle_probe,
>   };
> -
> -module_platform_driver(calxeda_cpuidle_plat_driver);
> +builtin_platform_driver(calxeda_cpuidle_plat_driver);
> diff --git a/drivers/cpuidle/cpuidle-zynq.c b/drivers/cpuidle/cpuidle-zynq.c
> index 543292b1d38e..6f4257fc56e5 100644
> --- a/drivers/cpuidle/cpuidle-zynq.c
> +++ b/drivers/cpuidle/cpuidle-zynq.c
> @@ -73,5 +73,4 @@ static struct platform_driver zynq_cpuidle_driver = {
>   	},
>   	.probe = zynq_cpuidle_probe,
>   };
> -
> -module_platform_driver(zynq_cpuidle_driver);
> +builtin_platform_driver(zynq_cpuidle_driver);
>


-- 
  <http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro:  <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog


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

* [PATCH 3/7] drivers/cpuidle: Convert non-modular drivers to use builtin_driver_register
@ 2015-05-11 17:13     ` Daniel Lezcano
  0 siblings, 0 replies; 49+ messages in thread
From: Daniel Lezcano @ 2015-05-11 17:13 UTC (permalink / raw)
  To: linux-arm-kernel

On 05/10/2015 09:49 PM, Paul Gortmaker wrote:
> All these drivers are configured with Kconfig options that are
> declared as bool.  Hence it is not possible for the code
> to be built as modular.  However the code is currently using the
> module_platform_driver() macro for driver registration.
>
> While this currently works, we really don't want to be including
> the module.h header in non-modular code, which we'll be forced
> to do, pending some upcoming code relocation from init.h into
> module.h.  So we fix it now by using the non-modular equivalent.
>
> Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
> Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
> Cc: Michal Simek <michal.simek@xilinx.com>
> Cc: linux-pm at vger.kernel.org
> Cc: linux-arm-kernel at lists.infradead.org
> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>

Sounds reasonable.

   -- Daniel

> ---
>   drivers/cpuidle/cpuidle-at91.c    | 3 +--
>   drivers/cpuidle/cpuidle-calxeda.c | 3 +--
>   drivers/cpuidle/cpuidle-zynq.c    | 3 +--
>   3 files changed, 3 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/cpuidle/cpuidle-at91.c b/drivers/cpuidle/cpuidle-at91.c
> index f2446c78d87c..9c5853b6ca4a 100644
> --- a/drivers/cpuidle/cpuidle-at91.c
> +++ b/drivers/cpuidle/cpuidle-at91.c
> @@ -62,5 +62,4 @@ static struct platform_driver at91_cpuidle_driver = {
>   	},
>   	.probe = at91_cpuidle_probe,
>   };
> -
> -module_platform_driver(at91_cpuidle_driver);
> +builtin_platform_driver(at91_cpuidle_driver);
> diff --git a/drivers/cpuidle/cpuidle-calxeda.c b/drivers/cpuidle/cpuidle-calxeda.c
> index 9445e6cc02be..c13feec89ea1 100644
> --- a/drivers/cpuidle/cpuidle-calxeda.c
> +++ b/drivers/cpuidle/cpuidle-calxeda.c
> @@ -75,5 +75,4 @@ static struct platform_driver calxeda_cpuidle_plat_driver = {
>           },
>           .probe = calxeda_cpuidle_probe,
>   };
> -
> -module_platform_driver(calxeda_cpuidle_plat_driver);
> +builtin_platform_driver(calxeda_cpuidle_plat_driver);
> diff --git a/drivers/cpuidle/cpuidle-zynq.c b/drivers/cpuidle/cpuidle-zynq.c
> index 543292b1d38e..6f4257fc56e5 100644
> --- a/drivers/cpuidle/cpuidle-zynq.c
> +++ b/drivers/cpuidle/cpuidle-zynq.c
> @@ -73,5 +73,4 @@ static struct platform_driver zynq_cpuidle_driver = {
>   	},
>   	.probe = zynq_cpuidle_probe,
>   };
> -
> -module_platform_driver(zynq_cpuidle_driver);
> +builtin_platform_driver(zynq_cpuidle_driver);
>


-- 
  <http://www.linaro.org/> Linaro.org ? Open source software for ARM SoCs

Follow Linaro:  <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog

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

* Re: [PATCH 4/7] drivers/cpufreq: Convert non-modular drivers to use builtin_driver_register
  2015-05-10 19:49   ` Paul Gortmaker
@ 2015-05-12  7:04     ` Viresh Kumar
  -1 siblings, 0 replies; 49+ messages in thread
From: Viresh Kumar @ 2015-05-12  7:04 UTC (permalink / raw)
  To: Paul Gortmaker
  Cc: linux-kernel, Rafael J. Wysocki, Kukjin Kim, linux-pm, linux-arm-kernel

On 10-05-15, 15:49, Paul Gortmaker wrote:
> These files depend on Kconfig options all of which are a bool, so
> we use the appropriate registration function, which avoids us
> relying on an implicit inclusion of <module.h> which we are
> doing currently.
> 
> While this currently works, we really don't want to be including
> the module.h header in non-modular code, which we'd be forced
> to do, pending some upcoming code relocation from init.h into
> module.h.  So we fix it now by using the non-modular equivalent.
> 
> Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
> Cc: Viresh Kumar <viresh.kumar@linaro.org>
> Cc: Kukjin Kim <kgene@kernel.org>
> Cc: linux-pm@vger.kernel.org
> Cc: linux-arm-kernel@lists.infradead.org
> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
> ---
>  drivers/cpufreq/exynos-cpufreq.c  | 2 +-

Exynos can be compiled as a module:

drivers/cpufreq/Kconfig.arm:

config ARM_EXYNOS_CPUFREQ
	tristate "SAMSUNG EXYNOS CPUfreq Driver"
	depends on CPU_EXYNOS4210 || SOC_EXYNOS4212 || SOC_EXYNOS4412 || SOC_EXYNOS5250

--
viresh

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

* [PATCH 4/7] drivers/cpufreq: Convert non-modular drivers to use builtin_driver_register
@ 2015-05-12  7:04     ` Viresh Kumar
  0 siblings, 0 replies; 49+ messages in thread
From: Viresh Kumar @ 2015-05-12  7:04 UTC (permalink / raw)
  To: linux-arm-kernel

On 10-05-15, 15:49, Paul Gortmaker wrote:
> These files depend on Kconfig options all of which are a bool, so
> we use the appropriate registration function, which avoids us
> relying on an implicit inclusion of <module.h> which we are
> doing currently.
> 
> While this currently works, we really don't want to be including
> the module.h header in non-modular code, which we'd be forced
> to do, pending some upcoming code relocation from init.h into
> module.h.  So we fix it now by using the non-modular equivalent.
> 
> Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
> Cc: Viresh Kumar <viresh.kumar@linaro.org>
> Cc: Kukjin Kim <kgene@kernel.org>
> Cc: linux-pm at vger.kernel.org
> Cc: linux-arm-kernel at lists.infradead.org
> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
> ---
>  drivers/cpufreq/exynos-cpufreq.c  | 2 +-

Exynos can be compiled as a module:

drivers/cpufreq/Kconfig.arm:

config ARM_EXYNOS_CPUFREQ
	tristate "SAMSUNG EXYNOS CPUfreq Driver"
	depends on CPU_EXYNOS4210 || SOC_EXYNOS4212 || SOC_EXYNOS4412 || SOC_EXYNOS5250

--
viresh

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

* Re: [PATCH 6/7] drivers/soc: Convert non-modular soc-realview to use builtin_driver_register
  2015-05-10 19:49 ` [PATCH 6/7] drivers/soc: Convert non-modular soc-realview " Paul Gortmaker
@ 2015-05-12 11:39   ` Linus Walleij
  0 siblings, 0 replies; 49+ messages in thread
From: Linus Walleij @ 2015-05-12 11:39 UTC (permalink / raw)
  To: Paul Gortmaker; +Cc: linux-kernel, Arnd Bergmann, Axel Lin

On Sun, May 10, 2015 at 9:49 PM, Paul Gortmaker
<paul.gortmaker@windriver.com> wrote:

> This file depends on Kconfig SOC_REALVIEW which is a bool, so
> we use the appropriate registration function, which avoids us
> relying on an implicit inclusion of <module.h> which we are
> doing currently.
>
> While this currently works, we really don't want to be including
> the module.h header in non-modular code, which we'd be forced
> to do, pending some upcoming code relocation from init.h into
> module.h.  So we fix it now by using the non-modular equivalent.
>
> Cc: Arnd Bergmann <arnd@arndb.de>
> Cc: Linus Walleij <linus.walleij@linaro.org>
> Cc: Axel Lin <axel.lin@ingics.com>
> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>

Acked-by: Linus Walleij <linus.walleij@linaro.org>

Yours,
Linus Walleij

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

* Re: [PATCH 1/7] platform_device: better support builtin boilerplate avoidance
  2015-05-10 19:49 ` [PATCH 1/7] platform_device: better support builtin boilerplate avoidance Paul Gortmaker
@ 2015-05-12 11:46   ` Linus Walleij
  2015-05-28  0:50     ` Paul Gortmaker
  0 siblings, 1 reply; 49+ messages in thread
From: Linus Walleij @ 2015-05-12 11:46 UTC (permalink / raw)
  To: Paul Gortmaker; +Cc: linux-kernel, Greg Kroah-Hartman

On Sun, May 10, 2015 at 9:49 PM, Paul Gortmaker
<paul.gortmaker@windriver.com> wrote:

> We have macros that help reduce the boilerplate for modules
> that register with no extra init/exit complexity other than the
> most standard use case.  However we see an increasing number of
> non-modular drivers using these modular_driver() type register
> functions.
>
> There are several downsides to this:
> 1) The code can appear modular to a reader of the code, and they
>    won't know if the code really is modular without checking the
>    Makefile and Kconfig to see if compilation is governed by a
>    bool or tristate.
> 2) Coders of drivers may be tempted to code up an __exit function
>    that is never used, just in order to satisfy the required three
>    args of the modular registration function.
> 3) Non-modular code ends up including the <module.h> which increases
>    CPP overhead that they don't need.
> 4) It hinders us from performing better separation of the module
>    init code and the generic init code.
>
> Here we introduce similar macros, with the mapping from module_driver
> to builtin_driver and similar, so that simple changes of:
>
>   module_platform_driver()       --->  builtin_platform_driver()
>   module_platform_driver_probe() --->  builtin_platform_driver_probe().
>
> can help us avoid #3 above, without having to code up the same
> __init functions and device_initcall() boilerplate.
>
> For non modular code, module_init becomes __initcall.  But direct use
> of __initcall is discouraged, vs. one of the priority categorized
> subgroups.  As __initcall gets mapped onto device_initcall, our
> use of device_initcall directly in this change means that the
> runtime impact is zero -- drivers will remain at level 6 in the
> initcall ordering.
>
> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>

This does not inhibit probe() and remove() to be
triggered from sysfs does it?

What is needed on builtin drivers is to set
.suppress_bind_attrs = true on the struct device_driver
so that we inhibit the creation of sysfs files to probe
and remove the driver by operator intervention.

I don't know if there is a simple way do address
this though since you don't seem to operate on
the struct device_driver, just pass it on.

Maybe it's possible to inhibit compilation of
builtin_platform_driver's if .suppress_bind_attrs == 0?

Yours,
Linus Walleij

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

* Re: [PATCH 4/7] drivers/cpufreq: Convert non-modular drivers to use builtin_driver_register
  2015-05-12  7:04     ` Viresh Kumar
  (?)
@ 2015-05-13  3:17       ` Paul Gortmaker
  -1 siblings, 0 replies; 49+ messages in thread
From: Paul Gortmaker @ 2015-05-13  3:17 UTC (permalink / raw)
  To: Viresh Kumar
  Cc: LKML, Rafael J. Wysocki, Kukjin Kim, Linux PM list, linux-arm-kernel

On Tue, May 12, 2015 at 3:04 AM, Viresh Kumar <viresh.kumar@linaro.org> wrote:
> On 10-05-15, 15:49, Paul Gortmaker wrote:
>> These files depend on Kconfig options all of which are a bool, so
>> we use the appropriate registration function, which avoids us
>> relying on an implicit inclusion of <module.h> which we are
>> doing currently.
>>
>> While this currently works, we really don't want to be including
>> the module.h header in non-modular code, which we'd be forced
>> to do, pending some upcoming code relocation from init.h into
>> module.h.  So we fix it now by using the non-modular equivalent.
>>
>> Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
>> Cc: Viresh Kumar <viresh.kumar@linaro.org>
>> Cc: Kukjin Kim <kgene@kernel.org>
>> Cc: linux-pm@vger.kernel.org
>> Cc: linux-arm-kernel@lists.infradead.org
>> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
>> ---
>>  drivers/cpufreq/exynos-cpufreq.c  | 2 +-
>
> Exynos can be compiled as a module:
>
> drivers/cpufreq/Kconfig.arm:
>
> config ARM_EXYNOS_CPUFREQ
>         tristate "SAMSUNG EXYNOS CPUfreq Driver"
>         depends on CPU_EXYNOS4210 || SOC_EXYNOS4212 || SOC_EXYNOS4412 || SOC_EXYNOS5250

Sounds like things have changed since I did the original compile
testing ; thanks for the heads-up and I will follow up with the details,
once I can re-test.

Thanks,
Paul.
--

>
> --
> viresh
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/

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

* Re: [PATCH 4/7] drivers/cpufreq: Convert non-modular drivers to use builtin_driver_register
@ 2015-05-13  3:17       ` Paul Gortmaker
  0 siblings, 0 replies; 49+ messages in thread
From: Paul Gortmaker @ 2015-05-13  3:17 UTC (permalink / raw)
  To: Viresh Kumar
  Cc: LKML, Rafael J. Wysocki, Kukjin Kim, Linux PM list, linux-arm-kernel

On Tue, May 12, 2015 at 3:04 AM, Viresh Kumar <viresh.kumar@linaro.org> wrote:
> On 10-05-15, 15:49, Paul Gortmaker wrote:
>> These files depend on Kconfig options all of which are a bool, so
>> we use the appropriate registration function, which avoids us
>> relying on an implicit inclusion of <module.h> which we are
>> doing currently.
>>
>> While this currently works, we really don't want to be including
>> the module.h header in non-modular code, which we'd be forced
>> to do, pending some upcoming code relocation from init.h into
>> module.h.  So we fix it now by using the non-modular equivalent.
>>
>> Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
>> Cc: Viresh Kumar <viresh.kumar@linaro.org>
>> Cc: Kukjin Kim <kgene@kernel.org>
>> Cc: linux-pm@vger.kernel.org
>> Cc: linux-arm-kernel@lists.infradead.org
>> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
>> ---
>>  drivers/cpufreq/exynos-cpufreq.c  | 2 +-
>
> Exynos can be compiled as a module:
>
> drivers/cpufreq/Kconfig.arm:
>
> config ARM_EXYNOS_CPUFREQ
>         tristate "SAMSUNG EXYNOS CPUfreq Driver"
>         depends on CPU_EXYNOS4210 || SOC_EXYNOS4212 || SOC_EXYNOS4412 || SOC_EXYNOS5250

Sounds like things have changed since I did the original compile
testing ; thanks for the heads-up and I will follow up with the details,
once I can re-test.

Thanks,
Paul.
--

>
> --
> viresh
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/

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

* [PATCH 4/7] drivers/cpufreq: Convert non-modular drivers to use builtin_driver_register
@ 2015-05-13  3:17       ` Paul Gortmaker
  0 siblings, 0 replies; 49+ messages in thread
From: Paul Gortmaker @ 2015-05-13  3:17 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, May 12, 2015 at 3:04 AM, Viresh Kumar <viresh.kumar@linaro.org> wrote:
> On 10-05-15, 15:49, Paul Gortmaker wrote:
>> These files depend on Kconfig options all of which are a bool, so
>> we use the appropriate registration function, which avoids us
>> relying on an implicit inclusion of <module.h> which we are
>> doing currently.
>>
>> While this currently works, we really don't want to be including
>> the module.h header in non-modular code, which we'd be forced
>> to do, pending some upcoming code relocation from init.h into
>> module.h.  So we fix it now by using the non-modular equivalent.
>>
>> Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
>> Cc: Viresh Kumar <viresh.kumar@linaro.org>
>> Cc: Kukjin Kim <kgene@kernel.org>
>> Cc: linux-pm at vger.kernel.org
>> Cc: linux-arm-kernel at lists.infradead.org
>> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
>> ---
>>  drivers/cpufreq/exynos-cpufreq.c  | 2 +-
>
> Exynos can be compiled as a module:
>
> drivers/cpufreq/Kconfig.arm:
>
> config ARM_EXYNOS_CPUFREQ
>         tristate "SAMSUNG EXYNOS CPUfreq Driver"
>         depends on CPU_EXYNOS4210 || SOC_EXYNOS4212 || SOC_EXYNOS4412 || SOC_EXYNOS5250

Sounds like things have changed since I did the original compile
testing ; thanks for the heads-up and I will follow up with the details,
once I can re-test.

Thanks,
Paul.
--

>
> --
> viresh
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo at vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/

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

* Re: [PATCH 7/7] drivers/power: Convert non-modular syscon-reboot to use builtin_driver_register
  2015-05-10 19:49   ` Paul Gortmaker
  (?)
@ 2015-05-23 17:55   ` Sebastian Reichel
  -1 siblings, 0 replies; 49+ messages in thread
From: Sebastian Reichel @ 2015-05-23 17:55 UTC (permalink / raw)
  To: Paul Gortmaker
  Cc: linux-kernel, Dmitry Eremin-Solenikov, David Woodhouse, linux-pm

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

Hi,

On Sun, May 10, 2015 at 03:49:45PM -0400, Paul Gortmaker wrote:
> This file depends on Kconfig options all of which are a bool, so
> we use the appropriate registration function, which avoids us
> relying on an implicit inclusion of <module.h> which we are
> doing currently.
> 
> While this currently works, we really don't want to be including
> the module.h header in non-modular code, which we'd be forced
> to do, pending some upcoming code relocation from init.h into
> module.h.  So we fix it now by using the non-modular equivalent.
> 
> Cc: Sebastian Reichel <sre@kernel.org>
> Cc: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
> Cc: David Woodhouse <dwmw2@infradead.org>
> Cc: linux-pm@vger.kernel.org
> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
> ---
>  drivers/power/reset/syscon-reboot.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/power/reset/syscon-reboot.c b/drivers/power/reset/syscon-reboot.c
> index d3c7d245ae63..7d0d269a0837 100644
> --- a/drivers/power/reset/syscon-reboot.c
> +++ b/drivers/power/reset/syscon-reboot.c
> @@ -88,4 +88,4 @@ static struct platform_driver syscon_reboot_driver = {
>  		.of_match_table = syscon_reboot_of_match,
>  	},
>  };
> -module_platform_driver(syscon_reboot_driver);
> +builtin_platform_driver(syscon_reboot_driver);

Acked-By: Sebastian Reichel <sre@kernel.org>

-- Sebastian

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

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

* Re: [PATCH 1/7] platform_device: better support builtin boilerplate avoidance
  2015-05-12 11:46   ` Linus Walleij
@ 2015-05-28  0:50     ` Paul Gortmaker
  2015-06-02  9:19       ` Linus Walleij
  0 siblings, 1 reply; 49+ messages in thread
From: Paul Gortmaker @ 2015-05-28  0:50 UTC (permalink / raw)
  To: Linus Walleij; +Cc: linux-kernel, Greg Kroah-Hartman

[Re: [PATCH 1/7] platform_device: better support builtin boilerplate avoidance] On 12/05/2015 (Tue 13:46) Linus Walleij wrote:

> On Sun, May 10, 2015 at 9:49 PM, Paul Gortmaker
> <paul.gortmaker@windriver.com> wrote:
> 
> > We have macros that help reduce the boilerplate for modules
> > that register with no extra init/exit complexity other than the
> > most standard use case.  However we see an increasing number of
> > non-modular drivers using these modular_driver() type register
> > functions.
> >
> > There are several downsides to this:
> > 1) The code can appear modular to a reader of the code, and they
> >    won't know if the code really is modular without checking the
> >    Makefile and Kconfig to see if compilation is governed by a
> >    bool or tristate.
> > 2) Coders of drivers may be tempted to code up an __exit function
> >    that is never used, just in order to satisfy the required three
> >    args of the modular registration function.
> > 3) Non-modular code ends up including the <module.h> which increases
> >    CPP overhead that they don't need.
> > 4) It hinders us from performing better separation of the module
> >    init code and the generic init code.
> >
> > Here we introduce similar macros, with the mapping from module_driver
> > to builtin_driver and similar, so that simple changes of:
> >
> >   module_platform_driver()       --->  builtin_platform_driver()
> >   module_platform_driver_probe() --->  builtin_platform_driver_probe().
> >
> > can help us avoid #3 above, without having to code up the same
> > __init functions and device_initcall() boilerplate.
> >
> > For non modular code, module_init becomes __initcall.  But direct use
> > of __initcall is discouraged, vs. one of the priority categorized
> > subgroups.  As __initcall gets mapped onto device_initcall, our
> > use of device_initcall directly in this change means that the
> > runtime impact is zero -- drivers will remain at level 6 in the
> > initcall ordering.
> >
> > Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> > Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
> 
> This does not inhibit probe() and remove() to be
> triggered from sysfs does it?
> 
> What is needed on builtin drivers is to set
> .suppress_bind_attrs = true on the struct device_driver
> so that we inhibit the creation of sysfs files to probe
> and remove the driver by operator intervention.

Is this needed?  I think we will break existing use cases if we do this.

For example, I have IGB as built-in, but I can still unbind one of the
four devices and make it available for PCI pass through to KVM with:

echo "0000:0a:00.1" > /sys/bus/pci/drivers/igb/unbind
echo "0000:0a:00.1" > /sys/bus/pci/drivers/pci-stub/bind

> 
> I don't know if there is a simple way do address
> this though since you don't seem to operate on
> the struct device_driver, just pass it on.
> 
> Maybe it's possible to inhibit compilation of
> builtin_platform_driver's if .suppress_bind_attrs == 0?

If we wanted to do this, I think we could simply do something like:

int __platform_driver_register(struct platform_driver *drv,
                                struct module *owner)
{
        drv->driver.owner = owner;
        drv->driver.bus = &platform_bus_type;
+       if (!owner)	/* built in */
+               drv->driver.suppress_bind_attrs = true;
        if (drv->probe)
                drv->driver.probe = platform_drv_probe;
        if (drv->remove)

...but again, I'm thinking that will break things for people, unless I'm
missing something here.

Paul.
--

> 
> Yours,
> Linus Walleij

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

* Re: [PATCH 1/7] platform_device: better support builtin boilerplate avoidance
  2015-05-28  0:50     ` Paul Gortmaker
@ 2015-06-02  9:19       ` Linus Walleij
  2015-06-03 14:07         ` Paul Gortmaker
  0 siblings, 1 reply; 49+ messages in thread
From: Linus Walleij @ 2015-06-02  9:19 UTC (permalink / raw)
  To: Paul Gortmaker; +Cc: linux-kernel, Greg Kroah-Hartman

On Thu, May 28, 2015 at 2:50 AM, Paul Gortmaker
<paul.gortmaker@windriver.com> wrote:
> [Re: [PATCH 1/7] platform_device: better support builtin boilerplate avoidance] On 12/05/2015 (Tue 13:46) Linus Walleij wrote:
>
>> This does not inhibit probe() and remove() to be
>> triggered from sysfs does it?
>>
>> What is needed on builtin drivers is to set
>> .suppress_bind_attrs = true on the struct device_driver
>> so that we inhibit the creation of sysfs files to probe
>> and remove the driver by operator intervention.
>
> Is this needed?  I think we will break existing use cases if we do this.
>
> For example, I have IGB as built-in, but I can still unbind one of the
> four devices and make it available for PCI pass through to KVM with:
>
> echo "0000:0a:00.1" > /sys/bus/pci/drivers/igb/unbind
> echo "0000:0a:00.1" > /sys/bus/pci/drivers/pci-stub/bind

Aha PCI device which noone else is dependent on, I guess
it's true.

I think we have a problem as to what "builtin" really means.
For example if this is a builtin regulator, clock, GPIO, DMA etc
driver, we want to suppress the binding/unbinding from userspace
too, since these drivers provide resources to others and
if you unbind them, nasty things happen. Unbinding/rebinding
is fine as long as noone else depend on you. However for
a large number of builtins, that is the case :P

Yours,
Linus Walleij

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

* Re: [PATCH 1/7] platform_device: better support builtin boilerplate avoidance
  2015-06-02  9:19       ` Linus Walleij
@ 2015-06-03 14:07         ` Paul Gortmaker
  2015-06-10  7:35           ` Linus Walleij
  0 siblings, 1 reply; 49+ messages in thread
From: Paul Gortmaker @ 2015-06-03 14:07 UTC (permalink / raw)
  To: Linus Walleij; +Cc: linux-kernel, Greg Kroah-Hartman

On 15-06-02 05:19 AM, Linus Walleij wrote:
> On Thu, May 28, 2015 at 2:50 AM, Paul Gortmaker
> <paul.gortmaker@windriver.com> wrote:
>> [Re: [PATCH 1/7] platform_device: better support builtin boilerplate avoidance] On 12/05/2015 (Tue 13:46) Linus Walleij wrote:
>>
>>> This does not inhibit probe() and remove() to be
>>> triggered from sysfs does it?
>>>
>>> What is needed on builtin drivers is to set
>>> .suppress_bind_attrs = true on the struct device_driver
>>> so that we inhibit the creation of sysfs files to probe
>>> and remove the driver by operator intervention.
>>
>> Is this needed?  I think we will break existing use cases if we do this.
>>
>> For example, I have IGB as built-in, but I can still unbind one of the
>> four devices and make it available for PCI pass through to KVM with:
>>
>> echo "0000:0a:00.1" > /sys/bus/pci/drivers/igb/unbind
>> echo "0000:0a:00.1" > /sys/bus/pci/drivers/pci-stub/bind
> 
> Aha PCI device which noone else is dependent on, I guess
> it's true.
> 
> I think we have a problem as to what "builtin" really means.

Well, people have had trouble with what "is" means before, so
I guess it is possible.  However, I think here it is pretty clear
that builtin means a Kconfig which is "y" and where "m" is not a
possible selection.

> For example if this is a builtin regulator, clock, GPIO, DMA etc
> driver, we want to suppress the binding/unbinding from userspace
> too, since these drivers provide resources to others and
> if you unbind them, nasty things happen. Unbinding/rebinding
> is fine as long as noone else depend on you. However for
> a large number of builtins, that is the case :P

So, to summarize:

1) Currently drivers can unbind that really should not do so.

2) This is not a new issue, nor is it introduced by this series.

3) We can't set policy based on built in vs modular; the only
   sane thing appears to be to let the driver decide itself.

Paul.
--

> 
> Yours,
> Linus Walleij
> 

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

* [PATCH] drivers/clk: convert sunxi/clk-mod0.c to use builtin_platform_driver
  2015-05-10 19:49 ` Paul Gortmaker
@ 2015-06-03 19:09   ` Paul Gortmaker
  -1 siblings, 0 replies; 49+ messages in thread
From: Paul Gortmaker @ 2015-06-03 19:09 UTC (permalink / raw)
  To: linux-kernel
  Cc: Paul Gortmaker, Emilio López, Mike Turquette, Stephen Boyd,
	Maxime Ripard, linux-clk, linux-arm-kernel

This driver builds based on obj-y and hence will not ever be
modular.  Change it to use the non-modular registration so that it
won't suffer a compile fail once a header move places the modular
registration within the module.h file.

Cc: "Emilio López" <emilio@elopez.com.ar>
Cc: Mike Turquette <mturquette@linaro.org>
Cc: Stephen Boyd <sboyd@codeaurora.org>
Cc: Maxime Ripard <maxime.ripard@free-electrons.com>
Cc: linux-clk@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---

[appending this to the builtin_platform_driver series of commits; see
 https://lkml.kernel.org/r/1431287385-1526-1-git-send-email-paul.gortmaker@windriver.com
 for original series posting.  The final header move can be found at:
 https://lkml.kernel.org/r/1433276168-21550-1-git-send-email-paul.gortmaker@windriver.com ]

 drivers/clk/sunxi/clk-mod0.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/clk/sunxi/clk-mod0.c b/drivers/clk/sunxi/clk-mod0.c
index ec8f5a1fca09..9d028aec58e5 100644
--- a/drivers/clk/sunxi/clk-mod0.c
+++ b/drivers/clk/sunxi/clk-mod0.c
@@ -128,7 +128,7 @@ static struct platform_driver sun4i_a10_mod0_clk_driver = {
 	},
 	.probe = sun4i_a10_mod0_clk_probe,
 };
-module_platform_driver(sun4i_a10_mod0_clk_driver);
+builtin_platform_driver(sun4i_a10_mod0_clk_driver);
 
 static const struct factors_data sun9i_a80_mod0_data __initconst = {
 	.enable = 31,
-- 
2.2.1


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

* [PATCH] drivers/clk: convert sunxi/clk-mod0.c to use builtin_platform_driver
@ 2015-06-03 19:09   ` Paul Gortmaker
  0 siblings, 0 replies; 49+ messages in thread
From: Paul Gortmaker @ 2015-06-03 19:09 UTC (permalink / raw)
  To: linux-arm-kernel

This driver builds based on obj-y and hence will not ever be
modular.  Change it to use the non-modular registration so that it
won't suffer a compile fail once a header move places the modular
registration within the module.h file.

Cc: "Emilio L?pez" <emilio@elopez.com.ar>
Cc: Mike Turquette <mturquette@linaro.org>
Cc: Stephen Boyd <sboyd@codeaurora.org>
Cc: Maxime Ripard <maxime.ripard@free-electrons.com>
Cc: linux-clk at vger.kernel.org
Cc: linux-arm-kernel at lists.infradead.org
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---

[appending this to the builtin_platform_driver series of commits; see
 https://lkml.kernel.org/r/1431287385-1526-1-git-send-email-paul.gortmaker at windriver.com
 for original series posting.  The final header move can be found at:
 https://lkml.kernel.org/r/1433276168-21550-1-git-send-email-paul.gortmaker at windriver.com ]

 drivers/clk/sunxi/clk-mod0.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/clk/sunxi/clk-mod0.c b/drivers/clk/sunxi/clk-mod0.c
index ec8f5a1fca09..9d028aec58e5 100644
--- a/drivers/clk/sunxi/clk-mod0.c
+++ b/drivers/clk/sunxi/clk-mod0.c
@@ -128,7 +128,7 @@ static struct platform_driver sun4i_a10_mod0_clk_driver = {
 	},
 	.probe = sun4i_a10_mod0_clk_probe,
 };
-module_platform_driver(sun4i_a10_mod0_clk_driver);
+builtin_platform_driver(sun4i_a10_mod0_clk_driver);
 
 static const struct factors_data sun9i_a80_mod0_data __initconst = {
 	.enable = 31,
-- 
2.2.1

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

* Re: [PATCH 4/7] drivers/cpufreq: Convert non-modular drivers to use builtin_driver_register
  2015-05-12  7:04     ` Viresh Kumar
  (?)
@ 2015-06-03 20:59       ` Paul Gortmaker
  -1 siblings, 0 replies; 49+ messages in thread
From: Paul Gortmaker @ 2015-06-03 20:59 UTC (permalink / raw)
  To: Viresh Kumar
  Cc: linux-kernel, Rafael J. Wysocki, Kukjin Kim, linux-pm, linux-arm-kernel

[Re: [PATCH 4/7] drivers/cpufreq: Convert non-modular drivers to use builtin_driver_register] On 12/05/2015 (Tue 12:34) Viresh Kumar wrote:

> On 10-05-15, 15:49, Paul Gortmaker wrote:
> > These files depend on Kconfig options all of which are a bool, so
> > we use the appropriate registration function, which avoids us
> > relying on an implicit inclusion of <module.h> which we are
> > doing currently.
> > 
> > While this currently works, we really don't want to be including
> > the module.h header in non-modular code, which we'd be forced
> > to do, pending some upcoming code relocation from init.h into
> > module.h.  So we fix it now by using the non-modular equivalent.
> > 
> > Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
> > Cc: Viresh Kumar <viresh.kumar@linaro.org>
> > Cc: Kukjin Kim <kgene@kernel.org>
> > Cc: linux-pm@vger.kernel.org
> > Cc: linux-arm-kernel@lists.infradead.org
> > Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
> > ---
> >  drivers/cpufreq/exynos-cpufreq.c  | 2 +-
> 
> Exynos can be compiled as a module:
> 
> drivers/cpufreq/Kconfig.arm:
> 
> config ARM_EXYNOS_CPUFREQ
> 	tristate "SAMSUNG EXYNOS CPUfreq Driver"
> 	depends on CPU_EXYNOS4210 || SOC_EXYNOS4212 || SOC_EXYNOS4412 || SOC_EXYNOS5250

Thanks -- I think I managed to confuse myself into thinking it was
builtin always, courtesy of the "-y" in this Makefile line...

arm-exynos-cpufreq-y                    := exynos-cpufreq.o

I'll drop the exynos chunk from this patch and fix the implicit module.h
exynos usage in a new follow on patch, both to be sent shortly.

Paul.
--

> 
> --
> viresh

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

* Re: [PATCH 4/7] drivers/cpufreq: Convert non-modular drivers to use builtin_driver_register
@ 2015-06-03 20:59       ` Paul Gortmaker
  0 siblings, 0 replies; 49+ messages in thread
From: Paul Gortmaker @ 2015-06-03 20:59 UTC (permalink / raw)
  To: Viresh Kumar
  Cc: linux-kernel, Rafael J. Wysocki, Kukjin Kim, linux-pm, linux-arm-kernel

[Re: [PATCH 4/7] drivers/cpufreq: Convert non-modular drivers to use builtin_driver_register] On 12/05/2015 (Tue 12:34) Viresh Kumar wrote:

> On 10-05-15, 15:49, Paul Gortmaker wrote:
> > These files depend on Kconfig options all of which are a bool, so
> > we use the appropriate registration function, which avoids us
> > relying on an implicit inclusion of <module.h> which we are
> > doing currently.
> > 
> > While this currently works, we really don't want to be including
> > the module.h header in non-modular code, which we'd be forced
> > to do, pending some upcoming code relocation from init.h into
> > module.h.  So we fix it now by using the non-modular equivalent.
> > 
> > Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
> > Cc: Viresh Kumar <viresh.kumar@linaro.org>
> > Cc: Kukjin Kim <kgene@kernel.org>
> > Cc: linux-pm@vger.kernel.org
> > Cc: linux-arm-kernel@lists.infradead.org
> > Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
> > ---
> >  drivers/cpufreq/exynos-cpufreq.c  | 2 +-
> 
> Exynos can be compiled as a module:
> 
> drivers/cpufreq/Kconfig.arm:
> 
> config ARM_EXYNOS_CPUFREQ
> 	tristate "SAMSUNG EXYNOS CPUfreq Driver"
> 	depends on CPU_EXYNOS4210 || SOC_EXYNOS4212 || SOC_EXYNOS4412 || SOC_EXYNOS5250

Thanks -- I think I managed to confuse myself into thinking it was
builtin always, courtesy of the "-y" in this Makefile line...

arm-exynos-cpufreq-y                    := exynos-cpufreq.o

I'll drop the exynos chunk from this patch and fix the implicit module.h
exynos usage in a new follow on patch, both to be sent shortly.

Paul.
--

> 
> --
> viresh

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

* [PATCH 4/7] drivers/cpufreq: Convert non-modular drivers to use builtin_driver_register
@ 2015-06-03 20:59       ` Paul Gortmaker
  0 siblings, 0 replies; 49+ messages in thread
From: Paul Gortmaker @ 2015-06-03 20:59 UTC (permalink / raw)
  To: linux-arm-kernel

[Re: [PATCH 4/7] drivers/cpufreq: Convert non-modular drivers to use builtin_driver_register] On 12/05/2015 (Tue 12:34) Viresh Kumar wrote:

> On 10-05-15, 15:49, Paul Gortmaker wrote:
> > These files depend on Kconfig options all of which are a bool, so
> > we use the appropriate registration function, which avoids us
> > relying on an implicit inclusion of <module.h> which we are
> > doing currently.
> > 
> > While this currently works, we really don't want to be including
> > the module.h header in non-modular code, which we'd be forced
> > to do, pending some upcoming code relocation from init.h into
> > module.h.  So we fix it now by using the non-modular equivalent.
> > 
> > Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
> > Cc: Viresh Kumar <viresh.kumar@linaro.org>
> > Cc: Kukjin Kim <kgene@kernel.org>
> > Cc: linux-pm at vger.kernel.org
> > Cc: linux-arm-kernel at lists.infradead.org
> > Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
> > ---
> >  drivers/cpufreq/exynos-cpufreq.c  | 2 +-
> 
> Exynos can be compiled as a module:
> 
> drivers/cpufreq/Kconfig.arm:
> 
> config ARM_EXYNOS_CPUFREQ
> 	tristate "SAMSUNG EXYNOS CPUfreq Driver"
> 	depends on CPU_EXYNOS4210 || SOC_EXYNOS4212 || SOC_EXYNOS4412 || SOC_EXYNOS5250

Thanks -- I think I managed to confuse myself into thinking it was
builtin always, courtesy of the "-y" in this Makefile line...

arm-exynos-cpufreq-y                    := exynos-cpufreq.o

I'll drop the exynos chunk from this patch and fix the implicit module.h
exynos usage in a new follow on patch, both to be sent shortly.

Paul.
--

> 
> --
> viresh

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

* [PATCH v2] drivers/cpufreq: Convert non-modular s5pv210-cpufreq.c to use builtin_platform_driver
  2015-05-12  7:04     ` Viresh Kumar
  (?)
@ 2015-06-03 21:12       ` Paul Gortmaker
  -1 siblings, 0 replies; 49+ messages in thread
From: Paul Gortmaker @ 2015-06-03 21:12 UTC (permalink / raw)
  To: linux-kernel
  Cc: linux-pm, Paul Gortmaker, Rafael J. Wysocki, Viresh Kumar,
	Kukjin Kim, linux-arm-kernel

This file depends on a Kconfig option which is a bool, so
we use the appropriate registration function, which avoids us
relying on an implicit inclusion of <module.h> which we are
doing currently.

While this currently works, we really don't want to be including
the module.h header in non-modular code, which we'd be forced
to do, pending some upcoming code relocation from init.h into
module.h.  So we fix it now by using the non-modular equivalent.

Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
Cc: Viresh Kumar <viresh.kumar@linaro.org>
Cc: Kukjin Kim <kgene@kernel.org>
Cc: linux-pm@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---

[v2: drop exnyos part from patch, since it really was modular and
 instead needs its implicit include fixed.]

 drivers/cpufreq/s5pv210-cpufreq.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/cpufreq/s5pv210-cpufreq.c b/drivers/cpufreq/s5pv210-cpufreq.c
index b0dac7d6ba31..9e231f52150c 100644
--- a/drivers/cpufreq/s5pv210-cpufreq.c
+++ b/drivers/cpufreq/s5pv210-cpufreq.c
@@ -659,4 +659,4 @@ static struct platform_driver s5pv210_cpufreq_platdrv = {
 	},
 	.probe = s5pv210_cpufreq_probe,
 };
-module_platform_driver(s5pv210_cpufreq_platdrv);
+builtin_platform_driver(s5pv210_cpufreq_platdrv);
-- 
2.2.1


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

* [PATCH v2] drivers/cpufreq: Convert non-modular s5pv210-cpufreq.c to use builtin_platform_driver
@ 2015-06-03 21:12       ` Paul Gortmaker
  0 siblings, 0 replies; 49+ messages in thread
From: Paul Gortmaker @ 2015-06-03 21:12 UTC (permalink / raw)
  To: linux-kernel
  Cc: linux-pm, Paul Gortmaker, Rafael J. Wysocki, Viresh Kumar,
	Kukjin Kim, linux-arm-kernel

This file depends on a Kconfig option which is a bool, so
we use the appropriate registration function, which avoids us
relying on an implicit inclusion of <module.h> which we are
doing currently.

While this currently works, we really don't want to be including
the module.h header in non-modular code, which we'd be forced
to do, pending some upcoming code relocation from init.h into
module.h.  So we fix it now by using the non-modular equivalent.

Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
Cc: Viresh Kumar <viresh.kumar@linaro.org>
Cc: Kukjin Kim <kgene@kernel.org>
Cc: linux-pm@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---

[v2: drop exnyos part from patch, since it really was modular and
 instead needs its implicit include fixed.]

 drivers/cpufreq/s5pv210-cpufreq.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/cpufreq/s5pv210-cpufreq.c b/drivers/cpufreq/s5pv210-cpufreq.c
index b0dac7d6ba31..9e231f52150c 100644
--- a/drivers/cpufreq/s5pv210-cpufreq.c
+++ b/drivers/cpufreq/s5pv210-cpufreq.c
@@ -659,4 +659,4 @@ static struct platform_driver s5pv210_cpufreq_platdrv = {
 	},
 	.probe = s5pv210_cpufreq_probe,
 };
-module_platform_driver(s5pv210_cpufreq_platdrv);
+builtin_platform_driver(s5pv210_cpufreq_platdrv);
-- 
2.2.1


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

* [PATCH v2] drivers/cpufreq: Convert non-modular s5pv210-cpufreq.c to use builtin_platform_driver
@ 2015-06-03 21:12       ` Paul Gortmaker
  0 siblings, 0 replies; 49+ messages in thread
From: Paul Gortmaker @ 2015-06-03 21:12 UTC (permalink / raw)
  To: linux-arm-kernel

This file depends on a Kconfig option which is a bool, so
we use the appropriate registration function, which avoids us
relying on an implicit inclusion of <module.h> which we are
doing currently.

While this currently works, we really don't want to be including
the module.h header in non-modular code, which we'd be forced
to do, pending some upcoming code relocation from init.h into
module.h.  So we fix it now by using the non-modular equivalent.

Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
Cc: Viresh Kumar <viresh.kumar@linaro.org>
Cc: Kukjin Kim <kgene@kernel.org>
Cc: linux-pm at vger.kernel.org
Cc: linux-arm-kernel at lists.infradead.org
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---

[v2: drop exnyos part from patch, since it really was modular and
 instead needs its implicit include fixed.]

 drivers/cpufreq/s5pv210-cpufreq.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/cpufreq/s5pv210-cpufreq.c b/drivers/cpufreq/s5pv210-cpufreq.c
index b0dac7d6ba31..9e231f52150c 100644
--- a/drivers/cpufreq/s5pv210-cpufreq.c
+++ b/drivers/cpufreq/s5pv210-cpufreq.c
@@ -659,4 +659,4 @@ static struct platform_driver s5pv210_cpufreq_platdrv = {
 	},
 	.probe = s5pv210_cpufreq_probe,
 };
-module_platform_driver(s5pv210_cpufreq_platdrv);
+builtin_platform_driver(s5pv210_cpufreq_platdrv);
-- 
2.2.1

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

* Re: [PATCH v2] drivers/cpufreq: Convert non-modular s5pv210-cpufreq.c to use builtin_platform_driver
  2015-06-03 21:12       ` Paul Gortmaker
@ 2015-06-04  2:28         ` Viresh Kumar
  -1 siblings, 0 replies; 49+ messages in thread
From: Viresh Kumar @ 2015-06-04  2:28 UTC (permalink / raw)
  To: Paul Gortmaker
  Cc: linux-kernel, linux-pm, Rafael J. Wysocki, Kukjin Kim, linux-arm-kernel

On 03-06-15, 17:12, Paul Gortmaker wrote:
> This file depends on a Kconfig option which is a bool, so
> we use the appropriate registration function, which avoids us
> relying on an implicit inclusion of <module.h> which we are
> doing currently.
> 
> While this currently works, we really don't want to be including
> the module.h header in non-modular code, which we'd be forced
> to do, pending some upcoming code relocation from init.h into
> module.h.  So we fix it now by using the non-modular equivalent.
> 
> Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
> Cc: Viresh Kumar <viresh.kumar@linaro.org>
> Cc: Kukjin Kim <kgene@kernel.org>
> Cc: linux-pm@vger.kernel.org
> Cc: linux-arm-kernel@lists.infradead.org
> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
> ---
> 
> [v2: drop exnyos part from patch, since it really was modular and
>  instead needs its implicit include fixed.]
> 
>  drivers/cpufreq/s5pv210-cpufreq.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/cpufreq/s5pv210-cpufreq.c b/drivers/cpufreq/s5pv210-cpufreq.c
> index b0dac7d6ba31..9e231f52150c 100644
> --- a/drivers/cpufreq/s5pv210-cpufreq.c
> +++ b/drivers/cpufreq/s5pv210-cpufreq.c
> @@ -659,4 +659,4 @@ static struct platform_driver s5pv210_cpufreq_platdrv = {
>  	},
>  	.probe = s5pv210_cpufreq_probe,
>  };
> -module_platform_driver(s5pv210_cpufreq_platdrv);
> +builtin_platform_driver(s5pv210_cpufreq_platdrv);

Acked-by: Viresh Kumar <viresh.kumar@linaro.org>

-- 
viresh

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

* [PATCH v2] drivers/cpufreq: Convert non-modular s5pv210-cpufreq.c to use builtin_platform_driver
@ 2015-06-04  2:28         ` Viresh Kumar
  0 siblings, 0 replies; 49+ messages in thread
From: Viresh Kumar @ 2015-06-04  2:28 UTC (permalink / raw)
  To: linux-arm-kernel

On 03-06-15, 17:12, Paul Gortmaker wrote:
> This file depends on a Kconfig option which is a bool, so
> we use the appropriate registration function, which avoids us
> relying on an implicit inclusion of <module.h> which we are
> doing currently.
> 
> While this currently works, we really don't want to be including
> the module.h header in non-modular code, which we'd be forced
> to do, pending some upcoming code relocation from init.h into
> module.h.  So we fix it now by using the non-modular equivalent.
> 
> Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
> Cc: Viresh Kumar <viresh.kumar@linaro.org>
> Cc: Kukjin Kim <kgene@kernel.org>
> Cc: linux-pm at vger.kernel.org
> Cc: linux-arm-kernel at lists.infradead.org
> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
> ---
> 
> [v2: drop exnyos part from patch, since it really was modular and
>  instead needs its implicit include fixed.]
> 
>  drivers/cpufreq/s5pv210-cpufreq.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/cpufreq/s5pv210-cpufreq.c b/drivers/cpufreq/s5pv210-cpufreq.c
> index b0dac7d6ba31..9e231f52150c 100644
> --- a/drivers/cpufreq/s5pv210-cpufreq.c
> +++ b/drivers/cpufreq/s5pv210-cpufreq.c
> @@ -659,4 +659,4 @@ static struct platform_driver s5pv210_cpufreq_platdrv = {
>  	},
>  	.probe = s5pv210_cpufreq_probe,
>  };
> -module_platform_driver(s5pv210_cpufreq_platdrv);
> +builtin_platform_driver(s5pv210_cpufreq_platdrv);

Acked-by: Viresh Kumar <viresh.kumar@linaro.org>

-- 
viresh

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

* Re: [PATCH] drivers/clk: convert sunxi/clk-mod0.c to use builtin_platform_driver
  2015-06-03 19:09   ` Paul Gortmaker
@ 2015-06-04 16:21     ` Maxime Ripard
  -1 siblings, 0 replies; 49+ messages in thread
From: Maxime Ripard @ 2015-06-04 16:21 UTC (permalink / raw)
  To: Paul Gortmaker
  Cc: linux-kernel, Emilio López, Mike Turquette, Stephen Boyd,
	linux-clk, linux-arm-kernel

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

On Wed, Jun 03, 2015 at 03:09:38PM -0400, Paul Gortmaker wrote:
> This driver builds based on obj-y and hence will not ever be
> modular.  Change it to use the non-modular registration so that it
> won't suffer a compile fail once a header move places the modular
> registration within the module.h file.
> 
> Cc: "Emilio López" <emilio@elopez.com.ar>
> Cc: Mike Turquette <mturquette@linaro.org>
> Cc: Stephen Boyd <sboyd@codeaurora.org>
> Cc: Maxime Ripard <maxime.ripard@free-electrons.com>
> Cc: linux-clk@vger.kernel.org
> Cc: linux-arm-kernel@lists.infradead.org
> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>

Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>

Thanks!
Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

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

* [PATCH] drivers/clk: convert sunxi/clk-mod0.c to use builtin_platform_driver
@ 2015-06-04 16:21     ` Maxime Ripard
  0 siblings, 0 replies; 49+ messages in thread
From: Maxime Ripard @ 2015-06-04 16:21 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Jun 03, 2015 at 03:09:38PM -0400, Paul Gortmaker wrote:
> This driver builds based on obj-y and hence will not ever be
> modular.  Change it to use the non-modular registration so that it
> won't suffer a compile fail once a header move places the modular
> registration within the module.h file.
> 
> Cc: "Emilio L?pez" <emilio@elopez.com.ar>
> Cc: Mike Turquette <mturquette@linaro.org>
> Cc: Stephen Boyd <sboyd@codeaurora.org>
> Cc: Maxime Ripard <maxime.ripard@free-electrons.com>
> Cc: linux-clk at vger.kernel.org
> Cc: linux-arm-kernel at lists.infradead.org
> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>

Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>

Thanks!
Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20150604/0ba0c04a/attachment.sig>

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

* Re: [PATCH] drivers/clk: convert sunxi/clk-mod0.c to use builtin_platform_driver
  2015-06-03 19:09   ` Paul Gortmaker
@ 2015-06-04 22:50     ` Stephen Boyd
  -1 siblings, 0 replies; 49+ messages in thread
From: Stephen Boyd @ 2015-06-04 22:50 UTC (permalink / raw)
  To: Paul Gortmaker
  Cc: linux-kernel, Emilio López, Mike Turquette, Maxime Ripard,
	linux-clk, linux-arm-kernel

On 06/03, Paul Gortmaker wrote:
> This driver builds based on obj-y and hence will not ever be
> modular.  Change it to use the non-modular registration so that it
> won't suffer a compile fail once a header move places the modular
> registration within the module.h file.
> 
> Cc: "Emilio López" <emilio@elopez.com.ar>
> Cc: Mike Turquette <mturquette@linaro.org>
> Cc: Stephen Boyd <sboyd@codeaurora.org>
> Cc: Maxime Ripard <maxime.ripard@free-electrons.com>
> Cc: linux-clk@vger.kernel.org
> Cc: linux-arm-kernel@lists.infradead.org
> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
> ---

Acked-by: Stephen Boyd <sboyd@codeaurora.org>

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project

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

* [PATCH] drivers/clk: convert sunxi/clk-mod0.c to use builtin_platform_driver
@ 2015-06-04 22:50     ` Stephen Boyd
  0 siblings, 0 replies; 49+ messages in thread
From: Stephen Boyd @ 2015-06-04 22:50 UTC (permalink / raw)
  To: linux-arm-kernel

On 06/03, Paul Gortmaker wrote:
> This driver builds based on obj-y and hence will not ever be
> modular.  Change it to use the non-modular registration so that it
> won't suffer a compile fail once a header move places the modular
> registration within the module.h file.
> 
> Cc: "Emilio L?pez" <emilio@elopez.com.ar>
> Cc: Mike Turquette <mturquette@linaro.org>
> Cc: Stephen Boyd <sboyd@codeaurora.org>
> Cc: Maxime Ripard <maxime.ripard@free-electrons.com>
> Cc: linux-clk at vger.kernel.org
> Cc: linux-arm-kernel at lists.infradead.org
> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
> ---

Acked-by: Stephen Boyd <sboyd@codeaurora.org>

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project

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

* Re: [PATCH 1/7] platform_device: better support builtin boilerplate avoidance
  2015-06-03 14:07         ` Paul Gortmaker
@ 2015-06-10  7:35           ` Linus Walleij
  0 siblings, 0 replies; 49+ messages in thread
From: Linus Walleij @ 2015-06-10  7:35 UTC (permalink / raw)
  To: Paul Gortmaker; +Cc: linux-kernel, Greg Kroah-Hartman

On Wed, Jun 3, 2015 at 4:07 PM, Paul Gortmaker
<paul.gortmaker@windriver.com> wrote:
> On 15-06-02 05:19 AM, Linus Walleij wrote:

>> For example if this is a builtin regulator, clock, GPIO, DMA etc
>> driver, we want to suppress the binding/unbinding from userspace
>> too, since these drivers provide resources to others and
>> if you unbind them, nasty things happen. Unbinding/rebinding
>> is fine as long as noone else depend on you. However for
>> a large number of builtins, that is the case :P
>
> So, to summarize:
>
> 1) Currently drivers can unbind that really should not do so.
>
> 2) This is not a new issue, nor is it introduced by this series.
>
> 3) We can't set policy based on built in vs modular; the only
>    sane thing appears to be to let the driver decide itself.

Yeah I think you're right. If I wanted to fix this problem I
should come up with some patches to help driver authors
do it themselves in a simpler way.

Yours,
Linus Walleij

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

* Re: [PATCH v2] drivers/cpufreq: Convert non-modular s5pv210-cpufreq.c to use builtin_platform_driver
  2015-06-03 21:12       ` Paul Gortmaker
@ 2015-06-15 23:50         ` Rafael J. Wysocki
  -1 siblings, 0 replies; 49+ messages in thread
From: Rafael J. Wysocki @ 2015-06-15 23:50 UTC (permalink / raw)
  To: Paul Gortmaker
  Cc: linux-kernel, linux-pm, Viresh Kumar, Kukjin Kim, linux-arm-kernel

On Wednesday, June 03, 2015 05:12:46 PM Paul Gortmaker wrote:
> This file depends on a Kconfig option which is a bool, so
> we use the appropriate registration function, which avoids us
> relying on an implicit inclusion of <module.h> which we are
> doing currently.
> 
> While this currently works, we really don't want to be including
> the module.h header in non-modular code, which we'd be forced
> to do, pending some upcoming code relocation from init.h into
> module.h.  So we fix it now by using the non-modular equivalent.
> 
> Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
> Cc: Viresh Kumar <viresh.kumar@linaro.org>
> Cc: Kukjin Kim <kgene@kernel.org>
> Cc: linux-pm@vger.kernel.org
> Cc: linux-arm-kernel@lists.infradead.org
> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>

I'm assuming that this will go in via the Samsung tree.


-- 
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.

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

* [PATCH v2] drivers/cpufreq: Convert non-modular s5pv210-cpufreq.c to use builtin_platform_driver
@ 2015-06-15 23:50         ` Rafael J. Wysocki
  0 siblings, 0 replies; 49+ messages in thread
From: Rafael J. Wysocki @ 2015-06-15 23:50 UTC (permalink / raw)
  To: linux-arm-kernel

On Wednesday, June 03, 2015 05:12:46 PM Paul Gortmaker wrote:
> This file depends on a Kconfig option which is a bool, so
> we use the appropriate registration function, which avoids us
> relying on an implicit inclusion of <module.h> which we are
> doing currently.
> 
> While this currently works, we really don't want to be including
> the module.h header in non-modular code, which we'd be forced
> to do, pending some upcoming code relocation from init.h into
> module.h.  So we fix it now by using the non-modular equivalent.
> 
> Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
> Cc: Viresh Kumar <viresh.kumar@linaro.org>
> Cc: Kukjin Kim <kgene@kernel.org>
> Cc: linux-pm at vger.kernel.org
> Cc: linux-arm-kernel at lists.infradead.org
> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>

I'm assuming that this will go in via the Samsung tree.


-- 
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.

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

* Re: [PATCH v2] drivers/cpufreq: Convert non-modular s5pv210-cpufreq.c to use builtin_platform_driver
  2015-06-15 23:50         ` Rafael J. Wysocki
  (?)
@ 2015-06-16 15:37           ` Paul Gortmaker
  -1 siblings, 0 replies; 49+ messages in thread
From: Paul Gortmaker @ 2015-06-16 15:37 UTC (permalink / raw)
  To: Rafael J. Wysocki
  Cc: linux-kernel, linux-pm, Viresh Kumar, Kukjin Kim, linux-arm-kernel

On 15-06-15 07:50 PM, Rafael J. Wysocki wrote:
> On Wednesday, June 03, 2015 05:12:46 PM Paul Gortmaker wrote:
>> This file depends on a Kconfig option which is a bool, so
>> we use the appropriate registration function, which avoids us
>> relying on an implicit inclusion of <module.h> which we are
>> doing currently.
>>
>> While this currently works, we really don't want to be including
>> the module.h header in non-modular code, which we'd be forced
>> to do, pending some upcoming code relocation from init.h into
>> module.h.  So we fix it now by using the non-modular equivalent.
>>
>> Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
>> Cc: Viresh Kumar <viresh.kumar@linaro.org>
>> Cc: Kukjin Kim <kgene@kernel.org>
>> Cc: linux-pm@vger.kernel.org
>> Cc: linux-arm-kernel@lists.infradead.org
>> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
> 
> I'm assuming that this will go in via the Samsung tree.

Per other patch, I'll have to keep a copy in my branch to
avoid introducing bisect compile fails into the git history.

Thanks,
Paul.


> 
> 

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

* Re: [PATCH v2] drivers/cpufreq: Convert non-modular s5pv210-cpufreq.c to use builtin_platform_driver
@ 2015-06-16 15:37           ` Paul Gortmaker
  0 siblings, 0 replies; 49+ messages in thread
From: Paul Gortmaker @ 2015-06-16 15:37 UTC (permalink / raw)
  To: Rafael J. Wysocki
  Cc: linux-kernel, linux-pm, Viresh Kumar, Kukjin Kim, linux-arm-kernel

On 15-06-15 07:50 PM, Rafael J. Wysocki wrote:
> On Wednesday, June 03, 2015 05:12:46 PM Paul Gortmaker wrote:
>> This file depends on a Kconfig option which is a bool, so
>> we use the appropriate registration function, which avoids us
>> relying on an implicit inclusion of <module.h> which we are
>> doing currently.
>>
>> While this currently works, we really don't want to be including
>> the module.h header in non-modular code, which we'd be forced
>> to do, pending some upcoming code relocation from init.h into
>> module.h.  So we fix it now by using the non-modular equivalent.
>>
>> Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
>> Cc: Viresh Kumar <viresh.kumar@linaro.org>
>> Cc: Kukjin Kim <kgene@kernel.org>
>> Cc: linux-pm@vger.kernel.org
>> Cc: linux-arm-kernel@lists.infradead.org
>> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
> 
> I'm assuming that this will go in via the Samsung tree.

Per other patch, I'll have to keep a copy in my branch to
avoid introducing bisect compile fails into the git history.

Thanks,
Paul.


> 
> 

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

* [PATCH v2] drivers/cpufreq: Convert non-modular s5pv210-cpufreq.c to use builtin_platform_driver
@ 2015-06-16 15:37           ` Paul Gortmaker
  0 siblings, 0 replies; 49+ messages in thread
From: Paul Gortmaker @ 2015-06-16 15:37 UTC (permalink / raw)
  To: linux-arm-kernel

On 15-06-15 07:50 PM, Rafael J. Wysocki wrote:
> On Wednesday, June 03, 2015 05:12:46 PM Paul Gortmaker wrote:
>> This file depends on a Kconfig option which is a bool, so
>> we use the appropriate registration function, which avoids us
>> relying on an implicit inclusion of <module.h> which we are
>> doing currently.
>>
>> While this currently works, we really don't want to be including
>> the module.h header in non-modular code, which we'd be forced
>> to do, pending some upcoming code relocation from init.h into
>> module.h.  So we fix it now by using the non-modular equivalent.
>>
>> Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
>> Cc: Viresh Kumar <viresh.kumar@linaro.org>
>> Cc: Kukjin Kim <kgene@kernel.org>
>> Cc: linux-pm at vger.kernel.org
>> Cc: linux-arm-kernel at lists.infradead.org
>> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
> 
> I'm assuming that this will go in via the Samsung tree.

Per other patch, I'll have to keep a copy in my branch to
avoid introducing bisect compile fails into the git history.

Thanks,
Paul.


> 
> 

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

end of thread, other threads:[~2015-06-16 15:38 UTC | newest]

Thread overview: 49+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-10 19:49 [PATCH 0/7] Introduce builtin_driver and use it for non-modular code Paul Gortmaker
2015-05-10 19:49 ` Paul Gortmaker
2015-05-10 19:49 ` Paul Gortmaker
2015-05-10 19:49 ` [PATCH 1/7] platform_device: better support builtin boilerplate avoidance Paul Gortmaker
2015-05-12 11:46   ` Linus Walleij
2015-05-28  0:50     ` Paul Gortmaker
2015-06-02  9:19       ` Linus Walleij
2015-06-03 14:07         ` Paul Gortmaker
2015-06-10  7:35           ` Linus Walleij
2015-05-10 19:49 ` [PATCH 2/7] drivers/platform: Convert non-modular pdev_bus to use builtin_driver_register Paul Gortmaker
2015-05-10 19:49 ` [PATCH 3/7] drivers/cpuidle: Convert non-modular drivers " Paul Gortmaker
2015-05-10 19:49   ` Paul Gortmaker
2015-05-10 19:49   ` Paul Gortmaker
2015-05-11 17:13   ` Daniel Lezcano
2015-05-11 17:13     ` Daniel Lezcano
2015-05-10 19:49 ` [PATCH 4/7] drivers/cpufreq: " Paul Gortmaker
2015-05-10 19:49   ` Paul Gortmaker
2015-05-10 19:49   ` Paul Gortmaker
2015-05-12  7:04   ` Viresh Kumar
2015-05-12  7:04     ` Viresh Kumar
2015-05-13  3:17     ` Paul Gortmaker
2015-05-13  3:17       ` Paul Gortmaker
2015-05-13  3:17       ` Paul Gortmaker
2015-06-03 20:59     ` Paul Gortmaker
2015-06-03 20:59       ` Paul Gortmaker
2015-06-03 20:59       ` Paul Gortmaker
2015-06-03 21:12     ` [PATCH v2] drivers/cpufreq: Convert non-modular s5pv210-cpufreq.c to use builtin_platform_driver Paul Gortmaker
2015-06-03 21:12       ` Paul Gortmaker
2015-06-03 21:12       ` Paul Gortmaker
2015-06-04  2:28       ` Viresh Kumar
2015-06-04  2:28         ` Viresh Kumar
2015-06-15 23:50       ` Rafael J. Wysocki
2015-06-15 23:50         ` Rafael J. Wysocki
2015-06-16 15:37         ` Paul Gortmaker
2015-06-16 15:37           ` Paul Gortmaker
2015-06-16 15:37           ` Paul Gortmaker
2015-05-10 19:49 ` [PATCH 5/7] drivers/soc: Convert non-modular tegra/pmc to use builtin_driver_register Paul Gortmaker
2015-05-10 19:49   ` Paul Gortmaker
2015-05-10 19:49 ` [PATCH 6/7] drivers/soc: Convert non-modular soc-realview " Paul Gortmaker
2015-05-12 11:39   ` Linus Walleij
2015-05-10 19:49 ` [PATCH 7/7] drivers/power: Convert non-modular syscon-reboot " Paul Gortmaker
2015-05-10 19:49   ` Paul Gortmaker
2015-05-23 17:55   ` Sebastian Reichel
2015-06-03 19:09 ` [PATCH] drivers/clk: convert sunxi/clk-mod0.c to use builtin_platform_driver Paul Gortmaker
2015-06-03 19:09   ` Paul Gortmaker
2015-06-04 16:21   ` Maxime Ripard
2015-06-04 16:21     ` Maxime Ripard
2015-06-04 22:50   ` Stephen Boyd
2015-06-04 22:50     ` Stephen Boyd

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.