* [PATCH 00/37] CPUFreq: set policy->cur in cpufreq core instead of
@ 2013-08-14 13:43 Viresh Kumar
2013-08-14 13:43 ` [PATCH 01/37] cpufreq: call cpufreq_driver->get() after calling ->init() Viresh Kumar
2013-08-14 13:44 ` [PATCH 33/37] cpufreq: sh: don't initialize part of policy that is set by core too Viresh Kumar
0 siblings, 2 replies; 3+ messages in thread
From: Viresh Kumar @ 2013-08-14 13:43 UTC (permalink / raw)
To: rjw
Cc: linaro-kernel, patches, cpufreq, linux-pm, linux-kernel,
Viresh Kumar, Andrew Lunn, David S. Miller,
Dmitry Eremin-Solenikov, Eric Miao, Hans-Christian Egtvedt,
Jesper Nilsson, John Crispin, Kukjin Kim, Linus Walleij,
linux-cris-kernel, linux-sh, Mikael Starvik, Paul Mundt,
Russell King, Santosh Shilimkar, Sekhar Nori, Shawn Guo,
spear-devel, Stephen Warren
Almost all drivers set policy->cur with current cpu frequency in their ->init()
part. This can be done for all of them at core level and so they wouldn't need
to do it.
This patchset adds supporting code in cpufreq core for calling get() after we have
called init() for a policy. Also fixes all drivers accordingly.
These drivers were still doing some stuff which isn't required and was done by
core already. And that is cleaned as well.
This is Fourth part of my cleanup work for CPUFreq, first three are (And
obviously its rebased over them):
1: cpufreq: Introduce cpufreq_table_validate_and_show()
https://lkml.org/lkml/2013/8/8/263
2: cpufreq: define generic routines for cpufreq drivers
https://lkml.org/lkml/2013/8/10/48
3. CPUFreq: Implement light weight ->target(): for 3.13
https://lkml.org/lkml/2013/8/13/349
All these are pushed here:
https://git.linaro.org/gitweb?p=people/vireshk/linux.git;a=shortlog;h=refs/heads/for-v3.13
--
viresh
Cc: Andrew Lunn <andrew@lunn.ch>
Cc: David S. Miller <davem@davemloft.net>
Cc: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Cc: Eric Miao <eric.y.miao@gmail.com>
Cc: Hans-Christian Egtvedt <egtvedt@samfundet.no>
Cc: Jesper Nilsson <jesper.nilsson@axis.com>
Cc: John Crispin <blogic@openwrt.org>
Cc: Kukjin Kim <kgene.kim@samsung.com>
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: linux-cris-kernel@axis.com
Cc: linux-sh@vger.kernel.org
Cc: Mikael Starvik <starvik@axis.com>
Cc: Paul Mundt <lethal@linux-sh.org>
Cc: Russell King <linux@arm.linux.org.uk>
Cc: Santosh Shilimkar <santosh.shilimkar@ti.com>
Cc: Sekhar Nori <nsekhar@ti.com>
Cc: Shawn Guo <shawn.guo@linaro.org>
Cc: spear-devel@list.st.com
Cc: Stephen Warren <swarren@nvidia.com>
Cc: Steven Miao <realmz6@gmail.com>
Cc: Tony Luck <tony.luck@intel.com>
Viresh Kumar (37):
cpufreq: call cpufreq_driver->get() after calling ->init()
cpufreq: acpi: don't initialize part of policy that is set by core
too
cpufreq: arm_big_little: don't initialize part of policy that is set
by core too
cpufreq: at32ap: don't initialize part of policy that is set by core
too
cpufreq: blackfin: don't initialize part of policy that is set by
core too
cpufreq: cpu0: don't initialize part of policy that is set by core
too
cpufreq: nforce2: don't initialize part of policy that is set by core
too
cpufreq: cris: don't initialize part of policy that is set by core
too
cpufreq: davinci: don't initialize part of policy that is set by core
too
cpufreq: dbx500: don't initialize part of policy that is set by core
too
cpufreq: e_powersaver: don't initialize part of policy that is set by
core too
cpufreq: elanfreq: don't initialize part of policy that is set by
core too
cpufreq: exynos: don't initialize part of policy that is set by core
too
cpufreq: gx: don't initialize part of policy that is set by core too
cpufreq: ia64-acpi: don't initialize part of policy that is set by
core too
cpufreq: imx6q: don't initialize part of policy that is set by core
too
cpufreq: integrator: don't initialize part of policy that is set by
core too
cpufreq: kirkwood: don't initialize part of policy that is set by
core too
cpufreq: longhaul: don't initialize part of policy that is set by
core too
cpufreq: loongson2: don't initialize part of policy that is set by
core too
cpufreq: maple: don't initialize part of policy that is set by core
too
cpufreq: omap: don't initialize part of policy that is set by core
too
cpufreq: p4: don't initialize part of policy that is set by core too
cpufreq: pcc: don't initialize part of policy that is set by core too
cpufreq: pmac: don't initialize part of policy that is set by core
too
cpufreq: powernow: don't initialize part of policy that is set by
core too
cpufreq: ppc: don't initialize part of policy that is set by core too
cpufreq: pxa: don't initialize part of policy that is set by core too
cpufreq: s3c: don't initialize part of policy that is set by core too
cpufreq: s5pv210: don't initialize part of policy that is set by core
too
cpufreq: sa11x0: don't initialize part of policy that is set by core
too
cpufreq: sc520_freq: don't initialize part of policy that is set by
core too
cpufreq: sh: don't initialize part of policy that is set by core too
cpufreq: spear: don't initialize part of policy that is set by core
too
cpufreq: speedstep: don't initialize part of policy that is set by
core too
cpufreq: tegra: don't initialize part of policy that is set by core
too
cpufreq: unicore2: don't initialize part of policy that is set by
core too
drivers/cpufreq/acpi-cpufreq.c | 1 -
drivers/cpufreq/arm_big_little.c | 2 --
drivers/cpufreq/at32ap-cpufreq.c | 12 ++++--------
drivers/cpufreq/blackfin-cpufreq.c | 1 -
drivers/cpufreq/cpufreq-cpu0.c | 1 -
drivers/cpufreq/cpufreq-nforce2.c | 1 -
drivers/cpufreq/cpufreq.c | 11 +++++++++++
drivers/cpufreq/cris-artpec3-cpufreq.c | 1 -
drivers/cpufreq/cris-etraxfs-cpufreq.c | 1 -
drivers/cpufreq/davinci-cpufreq.c | 2 --
drivers/cpufreq/dbx500-cpufreq.c | 5 -----
drivers/cpufreq/e_powersaver.c | 1 -
drivers/cpufreq/elanfreq.c | 1 -
drivers/cpufreq/exynos-cpufreq.c | 2 --
drivers/cpufreq/exynos5440-cpufreq.c | 1 -
drivers/cpufreq/gx-suspmod.c | 5 +----
drivers/cpufreq/ia64-acpi-cpufreq.c | 1 -
drivers/cpufreq/imx6q-cpufreq.c | 1 -
drivers/cpufreq/integrator-cpufreq.c | 5 ++---
drivers/cpufreq/kirkwood-cpufreq.c | 1 -
drivers/cpufreq/longhaul.c | 1 -
drivers/cpufreq/loongson2_cpufreq.c | 2 --
drivers/cpufreq/maple-cpufreq.c | 1 -
drivers/cpufreq/omap-cpufreq.c | 4 ----
drivers/cpufreq/p4-clockmod.c | 1 -
drivers/cpufreq/pcc-cpufreq.c | 7 -------
drivers/cpufreq/pmac32-cpufreq.c | 1 -
drivers/cpufreq/pmac64-cpufreq.c | 1 -
drivers/cpufreq/powernow-k6.c | 1 -
drivers/cpufreq/powernow-k7.c | 2 --
drivers/cpufreq/powernow-k8.c | 3 ---
drivers/cpufreq/ppc-corenet-cpufreq.c | 2 --
drivers/cpufreq/pxa2xx-cpufreq.c | 2 --
drivers/cpufreq/pxa3xx-cpufreq.c | 7 +++----
drivers/cpufreq/s3c2416-cpufreq.c | 2 --
drivers/cpufreq/s3c24xx-cpufreq.c | 5 -----
drivers/cpufreq/s3c64xx-cpufreq.c | 2 --
drivers/cpufreq/s5pv210-cpufreq.c | 2 --
drivers/cpufreq/sa1100-cpufreq.c | 1 -
drivers/cpufreq/sa1110-cpufreq.c | 1 -
drivers/cpufreq/sc520_freq.c | 1 -
drivers/cpufreq/sh-cpufreq.c | 2 --
drivers/cpufreq/spear-cpufreq.c | 2 --
drivers/cpufreq/speedstep-centrino.c | 5 -----
drivers/cpufreq/speedstep-ich.c | 15 +--------------
drivers/cpufreq/speedstep-smi.c | 13 -------------
drivers/cpufreq/tegra-cpufreq.c | 3 +--
drivers/cpufreq/unicore2-cpufreq.c | 1 -
48 files changed, 23 insertions(+), 123 deletions(-)
--
1.7.12.rc2.18.g61b472e
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH 01/37] cpufreq: call cpufreq_driver->get() after calling ->init()
2013-08-14 13:43 [PATCH 00/37] CPUFreq: set policy->cur in cpufreq core instead of Viresh Kumar
@ 2013-08-14 13:43 ` Viresh Kumar
2013-08-14 13:44 ` [PATCH 33/37] cpufreq: sh: don't initialize part of policy that is set by core too Viresh Kumar
1 sibling, 0 replies; 3+ messages in thread
From: Viresh Kumar @ 2013-08-14 13:43 UTC (permalink / raw)
To: rjw
Cc: linaro-kernel, patches, cpufreq, linux-pm, linux-kernel,
Viresh Kumar, Andrew Lunn, David S. Miller,
Dmitry Eremin-Solenikov, Eric Miao, Hans-Christian Egtvedt,
Jesper Nilsson, John Crispin, Kukjin Kim, Linus Walleij,
linux-cris-kernel, linux-sh, Mikael Starvik, Paul Mundt,
Russell King, Santosh Shilimkar, Sekhar Nori, Shawn Guo,
spear-devel, Stephen Warren
Almost all drivers set policy->cur with current cpu frequency in their ->init()
part. This can be done for all of them at core level and so they wouldn't need
to do it.
This patch adds supporting code in cpufreq core for calling get() after we have
called init() for a policy.
Cc: Andrew Lunn <andrew@lunn.ch>
Cc: David S. Miller <davem@davemloft.net>
Cc: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Cc: Eric Miao <eric.y.miao@gmail.com>
Cc: Hans-Christian Egtvedt <egtvedt@samfundet.no>
Cc: Jesper Nilsson <jesper.nilsson@axis.com>
Cc: John Crispin <blogic@openwrt.org>
Cc: Kukjin Kim <kgene.kim@samsung.com>
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: linux-cris-kernel@axis.com
Cc: linux-sh@vger.kernel.org
Cc: Mikael Starvik <starvik@axis.com>
Cc: Paul Mundt <lethal@linux-sh.org>
Cc: Russell King <linux@arm.linux.org.uk>
Cc: Santosh Shilimkar <santosh.shilimkar@ti.com>
Cc: Sekhar Nori <nsekhar@ti.com>
Cc: Shawn Guo <shawn.guo@linaro.org>
Cc: spear-devel@list.st.com
Cc: Stephen Warren <swarren@nvidia.com>
Cc: Steven Miao <realmz6@gmail.com>
Cc: Tony Luck <tony.luck@intel.com>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
drivers/cpufreq/cpufreq.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
index 4d37306..a7a1d3e 100644
--- a/drivers/cpufreq/cpufreq.c
+++ b/drivers/cpufreq/cpufreq.c
@@ -1038,6 +1038,14 @@ static int __cpufreq_add_dev(struct device *dev, struct subsys_interface *sif,
goto err_set_policy_cpu;
}
+ if (cpufreq_driver->get) {
+ policy->cur = cpufreq_driver->get(policy->cpu);
+ if (!policy->cur) {
+ pr_err("%s: ->get() failed\n", __func__);
+ goto err_get_freq;
+ }
+ }
+
/* related cpus should atleast have policy->cpus */
cpumask_or(policy->related_cpus, policy->related_cpus, policy->cpus);
@@ -1097,6 +1105,9 @@ err_out_unregister:
}
write_unlock_irqrestore(&cpufreq_driver_lock, flags);
+err_get_freq:
+ if (cpufreq_driver->exit)
+ cpufreq_driver->exit(policy);
err_set_policy_cpu:
per_cpu(cpufreq_policy_cpu, cpu) = -1;
cpufreq_policy_free(policy);
--
1.7.12.rc2.18.g61b472e
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH 33/37] cpufreq: sh: don't initialize part of policy that is set by core too
2013-08-14 13:43 [PATCH 00/37] CPUFreq: set policy->cur in cpufreq core instead of Viresh Kumar
2013-08-14 13:43 ` [PATCH 01/37] cpufreq: call cpufreq_driver->get() after calling ->init() Viresh Kumar
@ 2013-08-14 13:44 ` Viresh Kumar
1 sibling, 0 replies; 3+ messages in thread
From: Viresh Kumar @ 2013-08-14 13:44 UTC (permalink / raw)
To: rjw
Cc: linaro-kernel, patches, cpufreq, linux-pm, linux-kernel,
Viresh Kumar, Paul Mundt, linux-sh
Many common initializations of struct policy are moved to core now and hence
this driver doesn't need to do it. This patch removes such code.
Most recent of those changes is to call ->get() in the core after calling
->init().
Cc: Paul Mundt <lethal@linux-sh.org>
Cc: linux-sh@vger.kernel.org
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
drivers/cpufreq/sh-cpufreq.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/drivers/cpufreq/sh-cpufreq.c b/drivers/cpufreq/sh-cpufreq.c
index 91c6446..018348b 100644
--- a/drivers/cpufreq/sh-cpufreq.c
+++ b/drivers/cpufreq/sh-cpufreq.c
@@ -114,8 +114,6 @@ static int sh_cpufreq_cpu_init(struct cpufreq_policy *policy)
return PTR_ERR(cpuclk);
}
- policy->cur = sh_cpufreq_get(cpu);
-
freq_table = cpuclk->nr_freqs ? cpuclk->freq_table : NULL;
if (freq_table) {
int result;
--
1.7.12.rc2.18.g61b472e
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-08-14 13:44 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-14 13:43 [PATCH 00/37] CPUFreq: set policy->cur in cpufreq core instead of Viresh Kumar
2013-08-14 13:43 ` [PATCH 01/37] cpufreq: call cpufreq_driver->get() after calling ->init() Viresh Kumar
2013-08-14 13:44 ` [PATCH 33/37] cpufreq: sh: don't initialize part of policy that is set by core too Viresh Kumar
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).