linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH v6 2/8] PM / devfreq: tegra: Update to v5 of the submitted patches
@ 2015-03-30 10:22 MyungJoo Ham
  2015-03-30 12:54 ` [PATCH] PM / devfreq: tegra: Register governor on module init Tomeu Vizoso
  0 siblings, 1 reply; 4+ messages in thread
From: MyungJoo Ham @ 2015-03-30 10:22 UTC (permalink / raw)
  To: Tomeu Vizoso, linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
  Cc: Mikko Perttunen, Alex Frid, 박경민,
	Stephen Warren, Thierry Reding, Alexandre Courbot,
	linux-pm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org

> Sender : Tomeu Vizoso<tomeu.vizoso@collabora.com>
> Date : 2015-03-17 18:36 (GMT+09:00)
> Title : [PATCH v6 2/8] PM / devfreq: tegra: Update to v5 of the submitted patches
> 
> There seemed to be some miscommunication and an old version of the
> submitted patches was merged.
> 
> This commit updates the driver to v5, which had this changelog:
> 
> * Clarify the units of avg_dependency_threshold
> * Remove unused references to platform_device
> * Enable and disable interrupts on governor events
> * Make sure we handle all interrupts for any of the devices we are sampling
> * Move locking to be per-actmon-device
> 
> Signed-off-by: Tomeu Vizoso 
> CC: Alex Frid 
> CC: Mikko Perttunen 
> ---
> drivers/devfreq/tegra-devfreq.c | 455 ++++++++++++++++++++++------------------
> 1 file changed, 252 insertions(+), 203 deletions(-)
> 
> diff --git a/drivers/devfreq/tegra-devfreq.c b/drivers/devfreq/tegra-devfreq.c
> index 3479096..c71635a 100644
> --- a/drivers/devfreq/tegra-devfreq.c
> +++ b/drivers/devfreq/tegra-devfreq.c
[]
> -static struct devfreq_dev_profile tegra_devfreq_profile = {
> - .polling_ms = 0,
> - .target = tegra_devfreq_target,
> - .get_dev_status = tegra_devfreq_get_dev_status,
> -};
> +static int __init tegra_governor_init(void)
> +{
> + return devfreq_add_governor(&tegra_devfreq_governor);
> +}
> +subsys_initcall(tegra_governor_init);
> 
[]

It looks like you need to disable "module" in the corresponding Kconfig.

Do you want to add another patch to make it compilable as a module? or
do you want to make it "tristate" --> "bool"?

If you want the latter, I can do it for you before I send a pull request.

Please refer to the following:



mzx@kohaku:/home/kernel.org/devfreq$ make ARCH=arm modules
  CHK     include/config/kernel.release
  CHK     include/generated/uapi/linux/version.h
  CHK     include/generated/utsrelease.h
make[1]: `include/generated/mach-types.h' is up to date.
  CALL    scripts/checksyscalls.sh
  CC [M]  drivers/devfreq/tegra-devfreq.o
drivers/devfreq/tegra-devfreq.c:758:1: error: redefinition of ‘__inittest’
drivers/devfreq/tegra-devfreq.c:613:1: note: previous definition of ‘__inittest’ was here
drivers/devfreq/tegra-devfreq.c:758:1: error: redefinition of ‘init_module’
drivers/devfreq/tegra-devfreq.c:613:1: note: previous definition of ‘init_module’ was here
make[2]: *** [drivers/devfreq/tegra-devfreq.o] Error 1
make[1]: *** [drivers/devfreq] Error 2
make: *** [drivers] Error 2
mzx@kohaku:/home/kernel.org/devfreq$ 



Cheers,
MyungJoo


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

* [PATCH] PM / devfreq: tegra: Register governor on module init
  2015-03-30 10:22 [PATCH v6 2/8] PM / devfreq: tegra: Update to v5 of the submitted patches MyungJoo Ham
@ 2015-03-30 12:54 ` Tomeu Vizoso
       [not found]   ` <1427720078-28836-1-git-send-email-tomeu.vizoso-ZGY8ohtN/8qB+jHODAdFcQ@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: Tomeu Vizoso @ 2015-03-30 12:54 UTC (permalink / raw)
  To: linux-kernel
  Cc: linux-tegra, Tomeu Vizoso, MyungJoo Ham, Kyungmin Park,
	Stephen Warren, Thierry Reding, Alexandre Courbot, linux-pm

So this driver builds as a module.

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
---

Hi,

sorry, I hadn't tested building as a module in the latest iterations but it's something that I would like to work.

This patch should fix it.

Thanks,

Tomeu
---
 drivers/devfreq/tegra-devfreq.c | 33 ++++++++++++++++++++++++++-------
 1 file changed, 26 insertions(+), 7 deletions(-)

diff --git a/drivers/devfreq/tegra-devfreq.c b/drivers/devfreq/tegra-devfreq.c
index 8e633a6..ed94a5d 100644
--- a/drivers/devfreq/tegra-devfreq.c
+++ b/drivers/devfreq/tegra-devfreq.c
@@ -606,12 +606,6 @@ static struct devfreq_governor tegra_devfreq_governor = {
 	.event_handler = tegra_governor_event_handler,
 };
 
-static int __init tegra_governor_init(void)
-{
-	return devfreq_add_governor(&tegra_devfreq_governor);
-}
-subsys_initcall(tegra_governor_init);
-
 static int tegra_devfreq_probe(struct platform_device *pdev)
 {
 	struct tegra_devfreq *tegra;
@@ -755,7 +749,32 @@ static struct platform_driver tegra_devfreq_driver = {
 		.of_match_table = tegra_devfreq_of_match,
 	},
 };
-module_platform_driver(tegra_devfreq_driver);
+
+static int __init tegra_devfreq_init(void)
+{
+	int ret = 0;
+
+	ret = devfreq_add_governor(&tegra_devfreq_governor);
+	if (ret) {
+		pr_err("%s: failed to add governor: %d\n", __func__, ret);
+		return ret;
+	}
+
+	return platform_driver_register(&tegra_devfreq_driver);
+}
+module_init(tegra_devfreq_init)
+
+static void __exit tegra_devfreq_exit(void)
+{
+	int ret = 0;
+
+	platform_driver_unregister(&tegra_devfreq_driver);
+
+	ret = devfreq_remove_governor(&tegra_devfreq_governor);
+	if (ret)
+		pr_err("%s: failed to remove governor: %d\n", __func__, ret);
+}
+module_exit(tegra_devfreq_exit)
 
 MODULE_LICENSE("GPL v2");
 MODULE_DESCRIPTION("Tegra devfreq driver");
-- 
2.1.0

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

* Re: [PATCH] PM / devfreq: tegra: Register governor on module init
       [not found]   ` <1427720078-28836-1-git-send-email-tomeu.vizoso-ZGY8ohtN/8qB+jHODAdFcQ@public.gmane.org>
@ 2015-03-30 15:08     ` Thierry Reding
  2015-03-30 15:33       ` [PATCH v2] " Tomeu Vizoso
  0 siblings, 1 reply; 4+ messages in thread
From: Thierry Reding @ 2015-03-30 15:08 UTC (permalink / raw)
  To: Tomeu Vizoso
  Cc: linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	linux-tegra-u79uwXL29TY76Z2rM5mHXA, MyungJoo Ham, Kyungmin Park,
	Stephen Warren, Alexandre Courbot,
	linux-pm-u79uwXL29TY76Z2rM5mHXA

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

On Mon, Mar 30, 2015 at 02:54:38PM +0200, Tomeu Vizoso wrote:
[...]
> +static int __init tegra_devfreq_init(void)
> +{
> +	int ret = 0;
> +
> +	ret = devfreq_add_governor(&tegra_devfreq_governor);
> +	if (ret) {
> +		pr_err("%s: failed to add governor: %d\n", __func__, ret);
> +		return ret;
> +	}
> +
> +	return platform_driver_register(&tegra_devfreq_driver);

Shouldn't you remove the governor on driver registration failure?

Thierry

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

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

* [PATCH v2] PM / devfreq: tegra: Register governor on module init
  2015-03-30 15:08     ` Thierry Reding
@ 2015-03-30 15:33       ` Tomeu Vizoso
  0 siblings, 0 replies; 4+ messages in thread
From: Tomeu Vizoso @ 2015-03-30 15:33 UTC (permalink / raw)
  To: linux-kernel
  Cc: linux-tegra, Tomeu Vizoso, MyungJoo Ham, Kyungmin Park,
	Stephen Warren, Thierry Reding, Alexandre Courbot, linux-pm

So this driver builds as a module.

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
---

v2:	* Remove governor if driver registration fails
---
 drivers/devfreq/tegra-devfreq.c | 37 ++++++++++++++++++++++++++++++-------
 1 file changed, 30 insertions(+), 7 deletions(-)

diff --git a/drivers/devfreq/tegra-devfreq.c b/drivers/devfreq/tegra-devfreq.c
index 8e633a6..13a1a6e 100644
--- a/drivers/devfreq/tegra-devfreq.c
+++ b/drivers/devfreq/tegra-devfreq.c
@@ -606,12 +606,6 @@ static struct devfreq_governor tegra_devfreq_governor = {
 	.event_handler = tegra_governor_event_handler,
 };
 
-static int __init tegra_governor_init(void)
-{
-	return devfreq_add_governor(&tegra_devfreq_governor);
-}
-subsys_initcall(tegra_governor_init);
-
 static int tegra_devfreq_probe(struct platform_device *pdev)
 {
 	struct tegra_devfreq *tegra;
@@ -755,7 +749,36 @@ static struct platform_driver tegra_devfreq_driver = {
 		.of_match_table = tegra_devfreq_of_match,
 	},
 };
-module_platform_driver(tegra_devfreq_driver);
+
+static int __init tegra_devfreq_init(void)
+{
+	int ret = 0;
+
+	ret = devfreq_add_governor(&tegra_devfreq_governor);
+	if (ret) {
+		pr_err("%s: failed to add governor: %d\n", __func__, ret);
+		return ret;
+	}
+
+	ret = platform_driver_register(&tegra_devfreq_driver);
+	if (ret)
+		devfreq_remove_governor(&tegra_devfreq_governor);
+
+	return ret;
+}
+module_init(tegra_devfreq_init)
+
+static void __exit tegra_devfreq_exit(void)
+{
+	int ret = 0;
+
+	platform_driver_unregister(&tegra_devfreq_driver);
+
+	ret = devfreq_remove_governor(&tegra_devfreq_governor);
+	if (ret)
+		pr_err("%s: failed to remove governor: %d\n", __func__, ret);
+}
+module_exit(tegra_devfreq_exit)
 
 MODULE_LICENSE("GPL v2");
 MODULE_DESCRIPTION("Tegra devfreq driver");
-- 
2.1.0


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

end of thread, other threads:[~2015-03-30 15:34 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-30 10:22 [PATCH v6 2/8] PM / devfreq: tegra: Update to v5 of the submitted patches MyungJoo Ham
2015-03-30 12:54 ` [PATCH] PM / devfreq: tegra: Register governor on module init Tomeu Vizoso
     [not found]   ` <1427720078-28836-1-git-send-email-tomeu.vizoso-ZGY8ohtN/8qB+jHODAdFcQ@public.gmane.org>
2015-03-30 15:08     ` Thierry Reding
2015-03-30 15:33       ` [PATCH v2] " Tomeu Vizoso

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).