2013-07-31 14:19:41

by Viresh Kumar

[permalink] [raw]
Subject: [PATCH 00/15] cpufreq: initialize drivers .owner field with THIS_MODULE

CPUFreq core does following at multiple places:
module_{get|put}(cpufreq_driver->owner)).

This is done to make sure module doesn't get unloaded if it is currently in use.
This will work only if the .owner field of cpufreq driver is initialized with a
valid pointer.

This field wasn't initialized for many cpufreq driver, lets initialize it with
THIS_MODULE.

Rebased over: v3.11-rc3 and pushed here:

https://git.linaro.org/gitweb?p=people/vireshk/linux.git;a=shortlog;h=refs/heads/cpufreq-fix-owner

Viresh Kumar (15):
cpufreq: arm_big_little: initialize .owner field with THIS_MODULE
cpufreq: cpufreq-cpu0: initialize .owner field with THIS_MODULE
cpufreq: davinci: initialize .owner field with THIS_MODULE
cpufreq: dbx500: initialize .owner field with THIS_MODULE
cpufreq: exynos: initialize .owner field with THIS_MODULE
cpufreq: imx6q: initialize .owner field with THIS_MODULE
cpufreq: integrator: initialize .owner field with THIS_MODULE
cpufreq: omap: initialize .owner field with THIS_MODULE
cpufreq: pxa: initialize .owner field with THIS_MODULE
cpufreq: s3c24xx: initialize .owner field with THIS_MODULE
cpufreq: s5pv210: initialize .owner field with THIS_MODULE
cpufreq: sa11**: initialize .owner field with THIS_MODULE
cpufreq: SPEAr: initialize .owner field with THIS_MODULE
cpufreq: Tegra: initialize .owner field with THIS_MODULE
cpufreq: Unicore: initialize .owner field with THIS_MODULE

drivers/cpufreq/arm_big_little.c | 1 +
drivers/cpufreq/cpufreq-cpu0.c | 1 +
drivers/cpufreq/davinci-cpufreq.c | 1 +
drivers/cpufreq/dbx500-cpufreq.c | 1 +
drivers/cpufreq/exynos-cpufreq.c | 1 +
drivers/cpufreq/exynos5440-cpufreq.c | 1 +
drivers/cpufreq/imx6q-cpufreq.c | 1 +
drivers/cpufreq/integrator-cpufreq.c | 1 +
drivers/cpufreq/omap-cpufreq.c | 1 +
drivers/cpufreq/pxa2xx-cpufreq.c | 1 +
drivers/cpufreq/pxa3xx-cpufreq.c | 1 +
drivers/cpufreq/s3c24xx-cpufreq.c | 1 +
drivers/cpufreq/s5pv210-cpufreq.c | 1 +
drivers/cpufreq/sa1100-cpufreq.c | 1 +
drivers/cpufreq/sa1110-cpufreq.c | 1 +
drivers/cpufreq/spear-cpufreq.c | 1 +
drivers/cpufreq/tegra-cpufreq.c | 1 +
drivers/cpufreq/unicore2-cpufreq.c | 1 +
18 files changed, 18 insertions(+)

--
1.7.12.rc2.18.g61b472e


2013-07-31 14:19:49

by Viresh Kumar

[permalink] [raw]
Subject: [PATCH 01/15] cpufreq: arm_big_little: initialize .owner field with THIS_MODULE

CPUFreq core does following at multiple places:
module_{get|put}(cpufreq_driver->owner)).

This is done to make sure module doesn't get unloaded if it is currently in use.
This will work only if the .owner field of cpufreq driver is initialized with a
valid pointer.

This field wasn't initialized for this driver, lets initialize it with
THIS_MODULE.

Signed-off-by: Viresh Kumar <[email protected]>
---
drivers/cpufreq/arm_big_little.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/cpufreq/arm_big_little.c b/drivers/cpufreq/arm_big_little.c
index 3549f07..ba4d3b9 100644
--- a/drivers/cpufreq/arm_big_little.c
+++ b/drivers/cpufreq/arm_big_little.c
@@ -221,6 +221,7 @@ static struct cpufreq_driver bL_cpufreq_driver = {
.init = bL_cpufreq_init,
.exit = bL_cpufreq_exit,
.have_governor_per_policy = true,
+ .owner = THIS_MODULE,
.attr = bL_cpufreq_attr,
};

--
1.7.12.rc2.18.g61b472e

2013-07-31 14:19:57

by Viresh Kumar

[permalink] [raw]
Subject: [PATCH 02/15] cpufreq: cpufreq-cpu0: initialize .owner field with THIS_MODULE

CPUFreq core does following at multiple places:
module_{get|put}(cpufreq_driver->owner)).

This is done to make sure module doesn't get unloaded if it is currently in use.
This will work only if the .owner field of cpufreq driver is initialized with a
valid pointer.

This field wasn't initialized for this driver, lets initialize it with
THIS_MODULE.

Cc: Shawn Guo <[email protected]>
Signed-off-by: Viresh Kumar <[email protected]>
---
drivers/cpufreq/cpufreq-cpu0.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/cpufreq/cpufreq-cpu0.c b/drivers/cpufreq/cpufreq-cpu0.c
index ad1fde2..a087bf1 100644
--- a/drivers/cpufreq/cpufreq-cpu0.c
+++ b/drivers/cpufreq/cpufreq-cpu0.c
@@ -169,6 +169,7 @@ static struct cpufreq_driver cpu0_cpufreq_driver = {
.init = cpu0_cpufreq_init,
.exit = cpu0_cpufreq_exit,
.name = "generic_cpu0",
+ .owner = THIS_MODULE,
.attr = cpu0_cpufreq_attr,
};

--
1.7.12.rc2.18.g61b472e

2013-07-31 14:20:05

by Viresh Kumar

[permalink] [raw]
Subject: [PATCH 03/15] cpufreq: davinci: initialize .owner field with THIS_MODULE

CPUFreq core does following at multiple places:
module_{get|put}(cpufreq_driver->owner)).

This is done to make sure module doesn't get unloaded if it is currently in use.
This will work only if the .owner field of cpufreq driver is initialized with a
valid pointer.

This field wasn't initialized for this driver, lets initialize it with
THIS_MODULE.

Cc: Sekhar Nori <[email protected]>
Signed-off-by: Viresh Kumar <[email protected]>
---
drivers/cpufreq/davinci-cpufreq.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/cpufreq/davinci-cpufreq.c b/drivers/cpufreq/davinci-cpufreq.c
index 551dd65..db30e54 100644
--- a/drivers/cpufreq/davinci-cpufreq.c
+++ b/drivers/cpufreq/davinci-cpufreq.c
@@ -178,6 +178,7 @@ static struct cpufreq_driver davinci_driver = {
.init = davinci_cpu_init,
.exit = davinci_cpu_exit,
.name = "davinci",
+ .owner = THIS_MODULE,
.attr = davinci_cpufreq_attr,
};

--
1.7.12.rc2.18.g61b472e

2013-07-31 14:20:21

by Viresh Kumar

[permalink] [raw]
Subject: [PATCH 05/15] cpufreq: exynos: initialize .owner field with THIS_MODULE

CPUFreq core does following at multiple places:
module_{get|put}(cpufreq_driver->owner)).

This is done to make sure module doesn't get unloaded if it is currently in use.
This will work only if the .owner field of cpufreq driver is initialized with a
valid pointer.

This field wasn't initialized for this driver, lets initialize it with
THIS_MODULE.

Cc: Kukjin Kim <[email protected]>
Signed-off-by: Viresh Kumar <[email protected]>
---
drivers/cpufreq/exynos-cpufreq.c | 1 +
drivers/cpufreq/exynos5440-cpufreq.c | 1 +
2 files changed, 2 insertions(+)

diff --git a/drivers/cpufreq/exynos-cpufreq.c b/drivers/cpufreq/exynos-cpufreq.c
index 0d32f02..fe0bbce 100644
--- a/drivers/cpufreq/exynos-cpufreq.c
+++ b/drivers/cpufreq/exynos-cpufreq.c
@@ -278,6 +278,7 @@ static struct cpufreq_driver exynos_driver = {
.init = exynos_cpufreq_cpu_init,
.exit = exynos_cpufreq_cpu_exit,
.name = "exynos_cpufreq",
+ .owner = THIS_MODULE,
.attr = exynos_cpufreq_attr,
#ifdef CONFIG_PM
.suspend = exynos_cpufreq_suspend,
diff --git a/drivers/cpufreq/exynos5440-cpufreq.c b/drivers/cpufreq/exynos5440-cpufreq.c
index 0c74018..d0d353c 100644
--- a/drivers/cpufreq/exynos5440-cpufreq.c
+++ b/drivers/cpufreq/exynos5440-cpufreq.c
@@ -344,6 +344,7 @@ static struct cpufreq_driver exynos_driver = {
.target = exynos_target,
.get = exynos_getspeed,
.init = exynos_cpufreq_cpu_init,
+ .owner = THIS_MODULE,
.name = CPUFREQ_NAME,
};

--
1.7.12.rc2.18.g61b472e

2013-07-31 14:20:26

by Viresh Kumar

[permalink] [raw]
Subject: [PATCH 06/15] cpufreq: imx6q: initialize .owner field with THIS_MODULE

CPUFreq core does following at multiple places:
module_{get|put}(cpufreq_driver->owner)).

This is done to make sure module doesn't get unloaded if it is currently in use.
This will work only if the .owner field of cpufreq driver is initialized with a
valid pointer.

This field wasn't initialized for this driver, lets initialize it with
THIS_MODULE.

Cc: Shawn Guo <[email protected]>
Signed-off-by: Viresh Kumar <[email protected]>
---
drivers/cpufreq/imx6q-cpufreq.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/cpufreq/imx6q-cpufreq.c b/drivers/cpufreq/imx6q-cpufreq.c
index e37cdae..adbda1a 100644
--- a/drivers/cpufreq/imx6q-cpufreq.c
+++ b/drivers/cpufreq/imx6q-cpufreq.c
@@ -209,6 +209,7 @@ static struct cpufreq_driver imx6q_cpufreq_driver = {
.init = imx6q_cpufreq_init,
.exit = imx6q_cpufreq_exit,
.name = "imx6q-cpufreq",
+ .owner = THIS_MODULE,
.attr = imx6q_cpufreq_attr,
};

--
1.7.12.rc2.18.g61b472e

2013-07-31 14:20:34

by Viresh Kumar

[permalink] [raw]
Subject: [PATCH 07/15] cpufreq: integrator: initialize .owner field with THIS_MODULE

CPUFreq core does following at multiple places:
module_{get|put}(cpufreq_driver->owner)).

This is done to make sure module doesn't get unloaded if it is currently in use.
This will work only if the .owner field of cpufreq driver is initialized with a
valid pointer.

This field wasn't initialized for this driver, lets initialize it with
THIS_MODULE.

Signed-off-by: Viresh Kumar <[email protected]>
---
drivers/cpufreq/integrator-cpufreq.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/cpufreq/integrator-cpufreq.c b/drivers/cpufreq/integrator-cpufreq.c
index f7c99df..7205ea3 100644
--- a/drivers/cpufreq/integrator-cpufreq.c
+++ b/drivers/cpufreq/integrator-cpufreq.c
@@ -199,6 +199,7 @@ static struct cpufreq_driver integrator_driver = {
.target = integrator_set_target,
.get = integrator_get,
.init = integrator_cpufreq_init,
+ .owner = THIS_MODULE,
.name = "integrator",
};

--
1.7.12.rc2.18.g61b472e

2013-07-31 14:20:42

by Viresh Kumar

[permalink] [raw]
Subject: [PATCH 08/15] cpufreq: omap: initialize .owner field with THIS_MODULE

CPUFreq core does following at multiple places:
module_{get|put}(cpufreq_driver->owner)).

This is done to make sure module doesn't get unloaded if it is currently in use.
This will work only if the .owner field of cpufreq driver is initialized with a
valid pointer.

This field wasn't initialized for this driver, lets initialize it with
THIS_MODULE.

Cc: Santosh Shilimkar <[email protected]>
Signed-off-by: Viresh Kumar <[email protected]>
---
drivers/cpufreq/omap-cpufreq.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/cpufreq/omap-cpufreq.c b/drivers/cpufreq/omap-cpufreq.c
index f31fcfc..5b18385 100644
--- a/drivers/cpufreq/omap-cpufreq.c
+++ b/drivers/cpufreq/omap-cpufreq.c
@@ -241,6 +241,7 @@ static struct cpufreq_driver omap_driver = {
.init = omap_cpu_init,
.exit = omap_cpu_exit,
.name = "omap",
+ .owner = THIS_MODULE,
.attr = omap_cpufreq_attr,
};

--
1.7.12.rc2.18.g61b472e

2013-07-31 14:21:07

by Viresh Kumar

[permalink] [raw]
Subject: [PATCH 11/15] cpufreq: s5pv210: initialize .owner field with THIS_MODULE

CPUFreq core does following at multiple places:
module_{get|put}(cpufreq_driver->owner)).

This is done to make sure module doesn't get unloaded if it is currently in use.
This will work only if the .owner field of cpufreq driver is initialized with a
valid pointer.

This field wasn't initialized for this driver, lets initialize it with
THIS_MODULE.

Cc: Kukjin Kim <[email protected]>
Signed-off-by: Viresh Kumar <[email protected]>
---
drivers/cpufreq/s5pv210-cpufreq.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/cpufreq/s5pv210-cpufreq.c b/drivers/cpufreq/s5pv210-cpufreq.c
index 5c77570..9ebad24 100644
--- a/drivers/cpufreq/s5pv210-cpufreq.c
+++ b/drivers/cpufreq/s5pv210-cpufreq.c
@@ -609,6 +609,7 @@ static struct cpufreq_driver s5pv210_driver = {
.target = s5pv210_target,
.get = s5pv210_getspeed,
.init = s5pv210_cpu_init,
+ .owner = THIS_MODULE,
.name = "s5pv210",
#ifdef CONFIG_PM
.suspend = s5pv210_cpufreq_suspend,
--
1.7.12.rc2.18.g61b472e

2013-07-31 14:21:15

by Viresh Kumar

[permalink] [raw]
Subject: [PATCH 12/15] cpufreq: sa11**: initialize .owner field with THIS_MODULE

CPUFreq core does following at multiple places:
module_{get|put}(cpufreq_driver->owner)).

This is done to make sure module doesn't get unloaded if it is currently in use.
This will work only if the .owner field of cpufreq driver is initialized with a
valid pointer.

This field wasn't initialized for this driver, lets initialize it with
THIS_MODULE.

Signed-off-by: Viresh Kumar <[email protected]>
---
drivers/cpufreq/sa1100-cpufreq.c | 1 +
drivers/cpufreq/sa1110-cpufreq.c | 1 +
2 files changed, 2 insertions(+)

diff --git a/drivers/cpufreq/sa1100-cpufreq.c b/drivers/cpufreq/sa1100-cpufreq.c
index cff18e8..f41dbd7 100644
--- a/drivers/cpufreq/sa1100-cpufreq.c
+++ b/drivers/cpufreq/sa1100-cpufreq.c
@@ -233,6 +233,7 @@ static struct cpufreq_driver sa1100_driver __refdata = {
.target = sa1100_target,
.get = sa11x0_getspeed,
.init = sa1100_cpu_init,
+ .owner = THIS_MODULE,
.name = "sa1100",
};

diff --git a/drivers/cpufreq/sa1110-cpufreq.c b/drivers/cpufreq/sa1110-cpufreq.c
index 39c90b6..61627fb 100644
--- a/drivers/cpufreq/sa1110-cpufreq.c
+++ b/drivers/cpufreq/sa1110-cpufreq.c
@@ -349,6 +349,7 @@ static struct cpufreq_driver sa1110_driver __refdata = {
.target = sa1110_target,
.get = sa11x0_getspeed,
.init = sa1110_cpu_init,
+ .owner = THIS_MODULE,
.name = "sa1110",
};

--
1.7.12.rc2.18.g61b472e

2013-07-31 14:21:05

by Viresh Kumar

[permalink] [raw]
Subject: [PATCH 10/15] cpufreq: s3c24xx: initialize .owner field with THIS_MODULE

CPUFreq core does following at multiple places:
module_{get|put}(cpufreq_driver->owner)).

This is done to make sure module doesn't get unloaded if it is currently in use.
This will work only if the .owner field of cpufreq driver is initialized with a
valid pointer.

This field wasn't initialized for this driver, lets initialize it with
THIS_MODULE.

Cc: Kukjin Kim <[email protected]>
Signed-off-by: Viresh Kumar <[email protected]>
---
drivers/cpufreq/s3c24xx-cpufreq.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/cpufreq/s3c24xx-cpufreq.c b/drivers/cpufreq/s3c24xx-cpufreq.c
index 87781eb..c5a46cc 100644
--- a/drivers/cpufreq/s3c24xx-cpufreq.c
+++ b/drivers/cpufreq/s3c24xx-cpufreq.c
@@ -479,6 +479,7 @@ static struct cpufreq_driver s3c24xx_driver = {
.init = s3c_cpufreq_init,
.suspend = s3c_cpufreq_suspend,
.resume = s3c_cpufreq_resume,
+ .owner = THIS_MODULE,
.name = "s3c24xx",
};

--
1.7.12.rc2.18.g61b472e

2013-07-31 14:21:54

by Viresh Kumar

[permalink] [raw]
Subject: [PATCH 13/15] cpufreq: SPEAr: initialize .owner field with THIS_MODULE

CPUFreq core does following at multiple places:
module_{get|put}(cpufreq_driver->owner)).

This is done to make sure module doesn't get unloaded if it is currently in use.
This will work only if the .owner field of cpufreq driver is initialized with a
valid pointer.

This field wasn't initialized for this driver, lets initialize it with
THIS_MODULE.

Signed-off-by: Viresh Kumar <[email protected]>
---
drivers/cpufreq/spear-cpufreq.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/cpufreq/spear-cpufreq.c b/drivers/cpufreq/spear-cpufreq.c
index c3efa7f..3c00dd5 100644
--- a/drivers/cpufreq/spear-cpufreq.c
+++ b/drivers/cpufreq/spear-cpufreq.c
@@ -212,6 +212,7 @@ static struct cpufreq_driver spear_cpufreq_driver = {
.get = spear_cpufreq_get,
.init = spear_cpufreq_init,
.exit = spear_cpufreq_exit,
+ .owner = THIS_MODULE,
.attr = spear_cpufreq_attr,
};

--
1.7.12.rc2.18.g61b472e

2013-07-31 14:22:03

by Viresh Kumar

[permalink] [raw]
Subject: [PATCH 14/15] cpufreq: Tegra: initialize .owner field with THIS_MODULE

CPUFreq core does following at multiple places:
module_{get|put}(cpufreq_driver->owner)).

This is done to make sure module doesn't get unloaded if it is currently in use.
This will work only if the .owner field of cpufreq driver is initialized with a
valid pointer.

This field wasn't initialized for this driver, lets initialize it with
THIS_MODULE.

Cc: Stephen Warren <[email protected]>
Signed-off-by: Viresh Kumar <[email protected]>
---
drivers/cpufreq/tegra-cpufreq.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/cpufreq/tegra-cpufreq.c b/drivers/cpufreq/tegra-cpufreq.c
index cd66b85..fc0ea61 100644
--- a/drivers/cpufreq/tegra-cpufreq.c
+++ b/drivers/cpufreq/tegra-cpufreq.c
@@ -250,6 +250,7 @@ static struct cpufreq_driver tegra_cpufreq_driver = {
.init = tegra_cpu_init,
.exit = tegra_cpu_exit,
.name = "tegra",
+ .owner = THIS_MODULE,
.attr = tegra_cpufreq_attr,
};

--
1.7.12.rc2.18.g61b472e

2013-07-31 14:22:11

by Viresh Kumar

[permalink] [raw]
Subject: [PATCH 15/15] cpufreq: Unicore: initialize .owner field with THIS_MODULE

CPUFreq core does following at multiple places:
module_{get|put}(cpufreq_driver->owner)).

This is done to make sure module doesn't get unloaded if it is currently in use.
This will work only if the .owner field of cpufreq driver is initialized with a
valid pointer.

This field wasn't initialized for this driver, lets initialize it with
THIS_MODULE.

Cc: Guan Xuetao <[email protected]>
Signed-off-by: Viresh Kumar <[email protected]>
---
drivers/cpufreq/unicore2-cpufreq.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/cpufreq/unicore2-cpufreq.c b/drivers/cpufreq/unicore2-cpufreq.c
index 12fc904..93519f7 100644
--- a/drivers/cpufreq/unicore2-cpufreq.c
+++ b/drivers/cpufreq/unicore2-cpufreq.c
@@ -81,6 +81,7 @@ static struct cpufreq_driver ucv2_driver = {
.target = ucv2_target,
.get = ucv2_getspeed,
.init = ucv2_cpu_init,
+ .owner = THIS_MODULE,
.name = "UniCore-II",
};

--
1.7.12.rc2.18.g61b472e

2013-07-31 14:22:55

by Viresh Kumar

[permalink] [raw]
Subject: [PATCH 09/15] cpufreq: pxa: initialize .owner field with THIS_MODULE

CPUFreq core does following at multiple places:
module_{get|put}(cpufreq_driver->owner)).

This is done to make sure module doesn't get unloaded if it is currently in use.
This will work only if the .owner field of cpufreq driver is initialized with a
valid pointer.

This field wasn't initialized for this driver, lets initialize it with
THIS_MODULE.

Cc: Eric Miao <[email protected]>
Signed-off-by: Viresh Kumar <[email protected]>
---
drivers/cpufreq/pxa2xx-cpufreq.c | 1 +
drivers/cpufreq/pxa3xx-cpufreq.c | 1 +
2 files changed, 2 insertions(+)

diff --git a/drivers/cpufreq/pxa2xx-cpufreq.c b/drivers/cpufreq/pxa2xx-cpufreq.c
index fb3981a..d62781b 100644
--- a/drivers/cpufreq/pxa2xx-cpufreq.c
+++ b/drivers/cpufreq/pxa2xx-cpufreq.c
@@ -468,6 +468,7 @@ static struct cpufreq_driver pxa_cpufreq_driver = {
.target = pxa_set_target,
.init = pxa_cpufreq_init,
.get = pxa_cpufreq_get,
+ .owner = THIS_MODULE,
.name = "PXA2xx",
};

diff --git a/drivers/cpufreq/pxa3xx-cpufreq.c b/drivers/cpufreq/pxa3xx-cpufreq.c
index 9c92ef0..81727ec 100644
--- a/drivers/cpufreq/pxa3xx-cpufreq.c
+++ b/drivers/cpufreq/pxa3xx-cpufreq.c
@@ -232,6 +232,7 @@ static struct cpufreq_driver pxa3xx_cpufreq_driver = {
.target = pxa3xx_cpufreq_set,
.init = pxa3xx_cpufreq_init,
.get = pxa3xx_cpufreq_get,
+ .owner = THIS_MODULE,
.name = "pxa3xx-cpufreq",
};

--
1.7.12.rc2.18.g61b472e

2013-07-31 14:22:59

by Santosh Shilimkar

[permalink] [raw]
Subject: Re: [PATCH 08/15] cpufreq: omap: initialize .owner field with THIS_MODULE

On Wednesday 31 July 2013 10:19 AM, Viresh Kumar wrote:
> CPUFreq core does following at multiple places:
> module_{get|put}(cpufreq_driver->owner)).
>
> This is done to make sure module doesn't get unloaded if it is currently in use.
> This will work only if the .owner field of cpufreq driver is initialized with a
> valid pointer.
>
> This field wasn't initialized for this driver, lets initialize it with
> THIS_MODULE.
>
> Cc: Santosh Shilimkar <[email protected]>
> Signed-off-by: Viresh Kumar <[email protected]>
> ---
Looks fine.
Acked-by: Santosh Shilimkar <[email protected]>

2013-07-31 14:20:17

by Viresh Kumar

[permalink] [raw]
Subject: [PATCH 04/15] cpufreq: dbx500: initialize .owner field with THIS_MODULE

CPUFreq core does following at multiple places:
module_{get|put}(cpufreq_driver->owner)).

This is done to make sure module doesn't get unloaded if it is currently in use.
This will work only if the .owner field of cpufreq driver is initialized with a
valid pointer.

This field wasn't initialized for this driver, lets initialize it with
THIS_MODULE.

Cc: Linus Walleij <[email protected]>
Signed-off-by: Viresh Kumar <[email protected]>
---
drivers/cpufreq/dbx500-cpufreq.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/cpufreq/dbx500-cpufreq.c b/drivers/cpufreq/dbx500-cpufreq.c
index 26321cd..2527f1d 100644
--- a/drivers/cpufreq/dbx500-cpufreq.c
+++ b/drivers/cpufreq/dbx500-cpufreq.c
@@ -120,6 +120,7 @@ static struct cpufreq_driver dbx500_cpufreq_driver = {
.get = dbx500_cpufreq_getspeed,
.init = dbx500_cpufreq_init,
.name = "DBX500",
+ .owner = THIS_MODULE,
.attr = dbx500_cpufreq_attr,
};

--
1.7.12.rc2.18.g61b472e

2013-07-31 16:36:11

by Sachin Kamat

[permalink] [raw]
Subject: Re: [PATCH 00/15] cpufreq: initialize drivers .owner field with THIS_MODULE

Hi Viresh,

On 31 July 2013 19:49, Viresh Kumar <[email protected]> wrote:
> CPUFreq core does following at multiple places:
> module_{get|put}(cpufreq_driver->owner)).
>
> This is done to make sure module doesn't get unloaded if it is currently in use.
> This will work only if the .owner field of cpufreq driver is initialized with a
> valid pointer.
>
> This field wasn't initialized for many cpufreq driver, lets initialize it with
> THIS_MODULE.


Isn't it possible to do this inside cpufreq_register_driver function
in a similar way as done for platform_driver_register [1].

[1] https://lkml.org/lkml/2013/5/25/5

--
With warm regards,
Sachin

2013-07-31 16:39:59

by Viresh Kumar

[permalink] [raw]
Subject: Re: [PATCH 00/15] cpufreq: initialize drivers .owner field with THIS_MODULE

On 31 July 2013 22:06, Sachin Kamat <[email protected]> wrote:
> Hi Viresh,
>
> On 31 July 2013 19:49, Viresh Kumar <[email protected]> wrote:
>> CPUFreq core does following at multiple places:
>> module_{get|put}(cpufreq_driver->owner)).
>>
>> This is done to make sure module doesn't get unloaded if it is currently in use.
>> This will work only if the .owner field of cpufreq driver is initialized with a
>> valid pointer.
>>
>> This field wasn't initialized for many cpufreq driver, lets initialize it with
>> THIS_MODULE.
>
>
> Isn't it possible to do this inside cpufreq_register_driver function
> in a similar way as done for platform_driver_register [1].
>
> [1] https://lkml.org/lkml/2013/5/25/5

Don't know if its possible to set it to something other than THIS_MODULE.
In which case we want something else to be done.

2013-07-31 19:13:15

by Stephen Warren

[permalink] [raw]
Subject: Re: [PATCH 14/15] cpufreq: Tegra: initialize .owner field with THIS_MODULE

On 07/31/2013 08:19 AM, Viresh Kumar wrote:
> CPUFreq core does following at multiple places:
> module_{get|put}(cpufreq_driver->owner)).
>
> This is done to make sure module doesn't get unloaded if it is currently in use.
> This will work only if the .owner field of cpufreq driver is initialized with a
> valid pointer.
>
> This field wasn't initialized for this driver, lets initialize it with
> THIS_MODULE.

Acked-by: Stephen Warren <[email protected]>

I assume this is all part of a series you'll take through the cpufreq tree.

2013-07-31 21:00:44

by Rafael J. Wysocki

[permalink] [raw]
Subject: Re: [PATCH 14/15] cpufreq: Tegra: initialize .owner field with THIS_MODULE

On Wednesday, July 31, 2013 01:13:09 PM Stephen Warren wrote:
> On 07/31/2013 08:19 AM, Viresh Kumar wrote:
> > CPUFreq core does following at multiple places:
> > module_{get|put}(cpufreq_driver->owner)).
> >
> > This is done to make sure module doesn't get unloaded if it is currently in use.
> > This will work only if the .owner field of cpufreq driver is initialized with a
> > valid pointer.
> >
> > This field wasn't initialized for this driver, lets initialize it with
> > THIS_MODULE.
>
> Acked-by: Stephen Warren <[email protected]>
>
> I assume this is all part of a series you'll take through the cpufreq tree.

I'm going to apply this series eventually, but I'd like some ACKs to accumulate
before doing that.

Thanks,
Rafael


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

2013-08-02 09:42:25

by Sachin Kamat

[permalink] [raw]
Subject: Re: [PATCH 00/15] cpufreq: initialize drivers .owner field with THIS_MODULE

On 31 July 2013 22:09, Viresh Kumar <[email protected]> wrote:
> On 31 July 2013 22:06, Sachin Kamat <[email protected]> wrote:
>> Hi Viresh,
>>
>> On 31 July 2013 19:49, Viresh Kumar <[email protected]> wrote:
>>> CPUFreq core does following at multiple places:
>>> module_{get|put}(cpufreq_driver->owner)).
>>>
>>> This is done to make sure module doesn't get unloaded if it is currently in use.
>>> This will work only if the .owner field of cpufreq driver is initialized with a
>>> valid pointer.
>>>
>>> This field wasn't initialized for many cpufreq driver, lets initialize it with
>>> THIS_MODULE.
>>
>>
>> Isn't it possible to do this inside cpufreq_register_driver function
>> in a similar way as done for platform_driver_register [1].
>>
>> [1] https://lkml.org/lkml/2013/5/25/5
>
> Don't know if its possible to set it to something other than THIS_MODULE.
> In which case we want something else to be done.

Even I am curious to know if it is possible to set the owner to
something other than THIS_MODULE.

--
With warm regards,
Sachin

2013-08-03 11:52:10

by Viresh Kumar

[permalink] [raw]
Subject: Re: [PATCH 00/15] cpufreq: initialize drivers .owner field with THIS_MODULE

On 31 July 2013 19:49, Viresh Kumar <[email protected]> wrote:
> CPUFreq core does following at multiple places:
> module_{get|put}(cpufreq_driver->owner)).
>
> This is done to make sure module doesn't get unloaded if it is currently in use.
> This will work only if the .owner field of cpufreq driver is initialized with a
> valid pointer.
>
> This field wasn't initialized for many cpufreq driver, lets initialize it with
> THIS_MODULE.

You can drop this patchset now as .owner field is removed in the latest
patchset from me which is posted today:

"[PATCH 00/10] CPUFreq: Fixes & Cleanups for 3.12"

2013-08-04 11:38:04

by Shawn Guo

[permalink] [raw]
Subject: Re: [PATCH 02/15] cpufreq: cpufreq-cpu0: initialize .owner field with THIS_MODULE

On Wed, Jul 31, 2013 at 07:49:11PM +0530, Viresh Kumar wrote:
> CPUFreq core does following at multiple places:
> module_{get|put}(cpufreq_driver->owner)).
>
> This is done to make sure module doesn't get unloaded if it is currently in use.
> This will work only if the .owner field of cpufreq driver is initialized with a
> valid pointer.
>
> This field wasn't initialized for this driver, lets initialize it with
> THIS_MODULE.
>
> Cc: Shawn Guo <[email protected]>
> Signed-off-by: Viresh Kumar <[email protected]>

For this and imx6q-cpufreq one,

Acked-by: Shawn Guo <[email protected]>

> ---
> drivers/cpufreq/cpufreq-cpu0.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/cpufreq/cpufreq-cpu0.c b/drivers/cpufreq/cpufreq-cpu0.c
> index ad1fde2..a087bf1 100644
> --- a/drivers/cpufreq/cpufreq-cpu0.c
> +++ b/drivers/cpufreq/cpufreq-cpu0.c
> @@ -169,6 +169,7 @@ static struct cpufreq_driver cpu0_cpufreq_driver = {
> .init = cpu0_cpufreq_init,
> .exit = cpu0_cpufreq_exit,
> .name = "generic_cpu0",
> + .owner = THIS_MODULE,
> .attr = cpu0_cpufreq_attr,
> };
>
> --
> 1.7.12.rc2.18.g61b472e
>

2013-08-14 16:44:00

by Linus Walleij

[permalink] [raw]
Subject: Re: [PATCH 04/15] cpufreq: dbx500: initialize .owner field with THIS_MODULE

On Wed, Jul 31, 2013 at 4:19 PM, Viresh Kumar <[email protected]> wrote:

> CPUFreq core does following at multiple places:
> module_{get|put}(cpufreq_driver->owner)).
>
> This is done to make sure module doesn't get unloaded if it is currently in use.
> This will work only if the .owner field of cpufreq driver is initialized with a
> valid pointer.
>
> This field wasn't initialized for this driver, lets initialize it with
> THIS_MODULE.
>
> Cc: Linus Walleij <[email protected]>
> Signed-off-by: Viresh Kumar <[email protected]>

Acked-by: Linus Walleij <[email protected]>

Yours,
Linus Walleij