* [PATCH 00/44] cpufreq: define generic routines for cpufreq drivers: for 3.13 @ 2013-08-10 6:55 Viresh Kumar 2013-08-10 6:56 ` [PATCH 08/44] cpufreq: define generic .attr, .exit() and .verify() routines Viresh Kumar ` (2 more replies) 0 siblings, 3 replies; 4+ messages in thread From: Viresh Kumar @ 2013-08-10 6:55 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, Guan Xuetao, Hans-Christian Egtvedt, Jesper Nilsson, John Crispin, Kukjin Kim, Linus Walleij, linux-cris-kernel, linux-sh, Mikael Starvik, Paul Mundt, Santosh Shilimkar, Sekhar Nori, Shawn Guo, sparclinux, spear-devel, Stephen Warren Most of the CPUFreq drivers do similar things in .exit() and .verify() routines and .attr. So its better if we have generic routines for them which can be used by cpufreq drivers then. This patchset first fixes all existing drivers to do cpufreq_frequency_table_put_attr() corresponding to cpufreq_frequency_table_get_attr() and then create generic routines which will be used by most of the cpufreq drivers. This is rebased on Rafael's bleeding edge + some more cleanup work that I posted earlier: https://lkml.org/lkml/2013/8/8/263 This patchset and its dependencies are pushed here: https://git.linaro.org/gitweb?p=people/vireshk/linux.git;a=shortlog;h=refs/heads/for-v3.13 @Rafael: You would be very happy to see the changelog :) 49 files changed, 287 insertions(+), 1215 deletions(-) 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: Guan Xuetao <gxt@mprc.pku.edu.cn> 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: Santosh Shilimkar <santosh.shilimkar@ti.com> Cc: Sekhar Nori <nsekhar@ti.com> Cc: Shawn Guo <shawn.guo@linaro.org> Cc: sparclinux@vger.kernel.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 (44): cpufreq: arm_big_little: call cpufreq_frequency_table_put_attr() cpufreq: blackfin: call cpufreq_frequency_table_put_attr() cpufreq: exynos: call cpufreq_frequency_table_put_attr() cpufreq: loongson2: call cpufreq_frequency_table_put_attr() cpufreq: omap: call cpufreq_frequency_table_put_attr() cpufreq: pxa: call cpufreq_frequency_table_put_attr() cpufreq: sparc: call cpufreq_frequency_table_put_attr() cpufreq: define generic .attr, .exit() and .verify() routines cpufreq: acpi: Use generic cpufreq routines cpufreq: arm_big_little: Use generic cpufreq routines cpufreq: at32ap: Use generic cpufreq routines cpufreq: blackfin: Use generic cpufreq routines cpufreq: cpu0: Use generic cpufreq routines cpufreq: cris: Use generic cpufreq routines cpufreq: davinci: Use generic cpufreq routines cpufreq: dbx500: Use generic cpufreq routines cpufreq: e_powersaver: Use generic cpufreq routines cpufreq: elanfreq: Use generic cpufreq routines cpufreq: exynos: Use generic cpufreq routines cpufreq: ia64-acpi: Use generic cpufreq routines cpufreq: imx6q: Use generic cpufreq routines cpufreq: kirkwood: Use generic cpufreq routines cpufreq: longhaul: Use generic cpufreq routines cpufreq: loongson2: Use generic cpufreq routines cpufreq: maple: Use generic cpufreq routines cpufreq: omap: Use generic cpufreq routines cpufreq: p4-clockmod: Use generic cpufreq routines cpufreq: pasemi: Use generic cpufreq routines cpufreq: pcc: Use generic cpufreq routines cpufreq: pmac: Use generic cpufreq routines cpufreq: powernow: Use generic cpufreq routines cpufreq: ppc-corenet: Use generic cpufreq routines cpufreq: ppc_cbe: Use generic cpufreq routines cpufreq: pxa: Use generic cpufreq routines cpufreq: s3cx4xx: Use generic cpufreq routines cpufreq: s5pv210: Use generic cpufreq routines cpufreq: sc520: Use generic cpufreq routines cpufreq: sh: Use generic cpufreq routines cpufreq: sparc: Use generic cpufreq routines cpufreq: spear: Use generic cpufreq routines cpufreq: speedstep: Use generic cpufreq routines cpufreq: tegra: Use generic cpufreq routines cpufreq: unicore2: Use generic cpufreq routines cpufreq: pass suitable index instead of freq to cpufreq_driver->target() drivers/cpufreq/acpi-cpufreq.c | 30 ++++--------------- drivers/cpufreq/arm_big_little.c | 34 +++++----------------- drivers/cpufreq/at32ap-cpufreq.c | 12 +------- drivers/cpufreq/blackfin-cpufreq.c | 29 ++++--------------- drivers/cpufreq/cpufreq-cpu0.c | 37 +++--------------------- drivers/cpufreq/cpufreq.c | 30 +++++++++++++++++-- drivers/cpufreq/cris-artpec3-cpufreq.c | 41 ++++---------------------- drivers/cpufreq/cris-etraxfs-cpufreq.c | 38 ++++-------------------- drivers/cpufreq/davinci-cpufreq.c | 30 ++++--------------- drivers/cpufreq/dbx500-cpufreq.c | 27 +++-------------- drivers/cpufreq/e_powersaver.c | 28 +++--------------- drivers/cpufreq/elanfreq.c | 53 ++++------------------------------ drivers/cpufreq/exynos-cpufreq.c | 40 ++++--------------------- drivers/cpufreq/exynos5440-cpufreq.c | 18 +++--------- drivers/cpufreq/freq_table.c | 20 +++++++++++++ drivers/cpufreq/ia64-acpi-cpufreq.c | 41 +++----------------------- drivers/cpufreq/imx6q-cpufreq.c | 38 ++++-------------------- drivers/cpufreq/kirkwood-cpufreq.c | 40 ++++--------------------- drivers/cpufreq/longhaul.c | 34 +++------------------- drivers/cpufreq/loongson2_cpufreq.c | 34 +++++----------------- drivers/cpufreq/maple-cpufreq.c | 28 ++++-------------- drivers/cpufreq/omap-cpufreq.c | 44 ++++------------------------ drivers/cpufreq/p4-clockmod.c | 37 ++++-------------------- drivers/cpufreq/pasemi-cpufreq.c | 23 ++------------- drivers/cpufreq/pcc-cpufreq.c | 9 +----- drivers/cpufreq/pmac32-cpufreq.c | 23 +++------------ drivers/cpufreq/pmac64-cpufreq.c | 28 ++++-------------- drivers/cpufreq/powernow-k6.c | 32 +++----------------- drivers/cpufreq/powernow-k7.c | 36 +++++------------------ drivers/cpufreq/powernow-k8.c | 36 +++++------------------ drivers/cpufreq/ppc-corenet-cpufreq.c | 30 ++++--------------- drivers/cpufreq/ppc_cbe_cpufreq.c | 24 ++------------- drivers/cpufreq/pxa2xx-cpufreq.c | 29 ++----------------- drivers/cpufreq/pxa3xx-cpufreq.c | 21 +++----------- drivers/cpufreq/s3c2416-cpufreq.c | 48 ++++++++++-------------------- drivers/cpufreq/s3c24xx-cpufreq.c | 37 +++--------------------- drivers/cpufreq/s3c64xx-cpufreq.c | 25 +++------------- drivers/cpufreq/s5pv210-cpufreq.c | 24 ++------------- drivers/cpufreq/sc520_freq.c | 43 ++++----------------------- drivers/cpufreq/sh-cpufreq.c | 7 +---- drivers/cpufreq/sparc-us2e-cpufreq.c | 23 ++++----------- drivers/cpufreq/sparc-us3-cpufreq.c | 25 ++++------------ drivers/cpufreq/spear-cpufreq.c | 32 ++++---------------- drivers/cpufreq/speedstep-centrino.c | 42 +++++---------------------- drivers/cpufreq/speedstep-ich.c | 48 +++++------------------------- drivers/cpufreq/speedstep-smi.c | 46 +++++------------------------ drivers/cpufreq/tegra-cpufreq.c | 22 +++----------- drivers/cpufreq/unicore2-cpufreq.c | 16 +--------- include/linux/cpufreq.h | 10 ++++++- 49 files changed, 287 insertions(+), 1215 deletions(-) -- 1.7.12.rc2.18.g61b472e ^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 08/44] cpufreq: define generic .attr, .exit() and .verify() routines 2013-08-10 6:55 [PATCH 00/44] cpufreq: define generic routines for cpufreq drivers: for 3.13 Viresh Kumar @ 2013-08-10 6:56 ` Viresh Kumar 2013-08-10 6:56 ` [PATCH 38/44] cpufreq: sh: Use generic cpufreq routines Viresh Kumar 2013-08-10 7:58 ` [PATCH 00/44] cpufreq: define generic routines for cpufreq drivers: for 3.13 Viresh Kumar 2 siblings, 0 replies; 4+ messages in thread From: Viresh Kumar @ 2013-08-10 6:56 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, Guan Xuetao, Hans-Christian Egtvedt, Jesper Nilsson, John Crispin, Kukjin Kim, Linus Walleij, linux-cris-kernel, linux-sh, Mikael Starvik, Paul Mundt, Santosh Shilimkar, Sekhar Nori, Shawn Guo, sparclinux, spear-devel, Stephen Warren Most of the CPUFreq drivers do similar things in .exit() and .verify() routines and .attr. So its better if we have generic routines for them which can be used by cpufreq drivers then. This patch introduces generic .attr, .exit() and .verify() cpufreq drivers. 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: Guan Xuetao <gxt@mprc.pku.edu.cn> 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: Santosh Shilimkar <santosh.shilimkar@ti.com> Cc: Sekhar Nori <nsekhar@ti.com> Cc: Shawn Guo <shawn.guo@linaro.org> Cc: sparclinux@vger.kernel.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/freq_table.c | 20 ++++++++++++++++++++ include/linux/cpufreq.h | 8 ++++++++ 2 files changed, 28 insertions(+) diff --git a/drivers/cpufreq/freq_table.c b/drivers/cpufreq/freq_table.c index 11f6fa9..b198458 100644 --- a/drivers/cpufreq/freq_table.c +++ b/drivers/cpufreq/freq_table.c @@ -87,6 +87,20 @@ int cpufreq_frequency_table_verify(struct cpufreq_policy *policy, } EXPORT_SYMBOL_GPL(cpufreq_frequency_table_verify); +/* + * Generic routine to verify policy & frequency table, requires driver to call + * cpufreq_frequency_table_get_attr() prior to it. + */ +int cpufreq_generic_frequency_table_verify(struct cpufreq_policy *policy) +{ + struct cpufreq_frequency_table *table + cpufreq_frequency_get_table(policy->cpu); + if (!table) + return -ENODEV; + + return cpufreq_frequency_table_verify(policy, table); +} +EXPORT_SYMBOL_GPL(cpufreq_generic_frequency_table_verify); int cpufreq_frequency_table_target(struct cpufreq_policy *policy, struct cpufreq_frequency_table *table, @@ -200,6 +214,12 @@ struct freq_attr cpufreq_freq_attr_scaling_available_freqs = { }; EXPORT_SYMBOL_GPL(cpufreq_freq_attr_scaling_available_freqs); +struct freq_attr *cpufreq_generic_attr[] = { + &cpufreq_freq_attr_scaling_available_freqs, + NULL, +}; +EXPORT_SYMBOL_GPL(cpufreq_generic_attr); + /* * if you use these, you must assure that the frequency table is valid * all the time between get_attr and put_attr! diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h index c0297a6..4907eb2 100644 --- a/include/linux/cpufreq.h +++ b/include/linux/cpufreq.h @@ -393,6 +393,7 @@ int cpufreq_frequency_table_cpuinfo(struct cpufreq_policy *policy, int cpufreq_frequency_table_verify(struct cpufreq_policy *policy, struct cpufreq_frequency_table *table); +int cpufreq_generic_frequency_table_verify(struct cpufreq_policy *policy); int cpufreq_frequency_table_target(struct cpufreq_policy *policy, struct cpufreq_frequency_table *table, @@ -408,10 +409,17 @@ struct cpufreq_frequency_table *cpufreq_frequency_get_table(unsigned int cpu); /* the following are really really optional */ extern struct freq_attr cpufreq_freq_attr_scaling_available_freqs; +extern struct freq_attr *cpufreq_generic_attr[]; void cpufreq_frequency_table_get_attr(struct cpufreq_frequency_table *table, unsigned int cpu); void cpufreq_frequency_table_put_attr(unsigned int cpu); int cpufreq_table_validate_and_show(struct cpufreq_policy *policy, struct cpufreq_frequency_table *table); +static inline int cpufreq_generic_exit(struct cpufreq_policy *policy) +{ + cpufreq_frequency_table_put_attr(policy->cpu); + return 0; +} + #endif /* _LINUX_CPUFREQ_H */ -- 1.7.12.rc2.18.g61b472e ^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 38/44] cpufreq: sh: Use generic cpufreq routines 2013-08-10 6:55 [PATCH 00/44] cpufreq: define generic routines for cpufreq drivers: for 3.13 Viresh Kumar 2013-08-10 6:56 ` [PATCH 08/44] cpufreq: define generic .attr, .exit() and .verify() routines Viresh Kumar @ 2013-08-10 6:56 ` Viresh Kumar 2013-08-10 7:58 ` [PATCH 00/44] cpufreq: define generic routines for cpufreq drivers: for 3.13 Viresh Kumar 2 siblings, 0 replies; 4+ messages in thread From: Viresh Kumar @ 2013-08-10 6:56 UTC (permalink / raw) To: rjw Cc: linaro-kernel, patches, cpufreq, linux-pm, linux-kernel, Viresh Kumar, Paul Mundt, linux-sh Most of the CPUFreq drivers do similar things in .exit() and .verify() routines and .attr. So its better if we have generic routines for them which can be used by cpufreq drivers then. This patch uses these generic routines for this driver. 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 | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/drivers/cpufreq/sh-cpufreq.c b/drivers/cpufreq/sh-cpufreq.c index 1362e88..91c6446 100644 --- a/drivers/cpufreq/sh-cpufreq.c +++ b/drivers/cpufreq/sh-cpufreq.c @@ -154,11 +154,6 @@ static int sh_cpufreq_cpu_exit(struct cpufreq_policy *policy) return 0; } -static struct freq_attr *sh_freq_attr[] = { - &cpufreq_freq_attr_scaling_available_freqs, - NULL, -}; - static struct cpufreq_driver sh_cpufreq_driver = { .name = "sh", .get = sh_cpufreq_get, @@ -166,7 +161,7 @@ static struct cpufreq_driver sh_cpufreq_driver = { .verify = sh_cpufreq_verify, .init = sh_cpufreq_cpu_init, .exit = sh_cpufreq_cpu_exit, - .attr = sh_freq_attr, + .attr = cpufreq_generic_attr, }; static int __init sh_cpufreq_module_init(void) -- 1.7.12.rc2.18.g61b472e ^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 00/44] cpufreq: define generic routines for cpufreq drivers: for 3.13 2013-08-10 6:55 [PATCH 00/44] cpufreq: define generic routines for cpufreq drivers: for 3.13 Viresh Kumar 2013-08-10 6:56 ` [PATCH 08/44] cpufreq: define generic .attr, .exit() and .verify() routines Viresh Kumar 2013-08-10 6:56 ` [PATCH 38/44] cpufreq: sh: Use generic cpufreq routines Viresh Kumar @ 2013-08-10 7:58 ` Viresh Kumar 2 siblings, 0 replies; 4+ messages in thread From: Viresh Kumar @ 2013-08-10 7:58 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, Guan Xuetao, Hans-Christian Egtvedt, Jesper Nilsson, John Crispin, Kukjin Kim, Linus Walleij, linux-cris-kernel, linux-sh, Mikael Starvik, Paul Mundt, Santosh Shilimkar, Sekhar Nori, Shawn Guo, sparclinux, spear-devel, Stephen Warren On 10 August 2013 12:13, Viresh Kumar <viresh.kumar@linaro.org> wrote: > cpufreq: pass suitable index instead of freq to > cpufreq_driver->target() This one is sent by mistake.. It isn't ready yet and will be sent separately later. :( ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2013-08-10 7:58 UTC | newest] Thread overview: 4+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2013-08-10 6:55 [PATCH 00/44] cpufreq: define generic routines for cpufreq drivers: for 3.13 Viresh Kumar 2013-08-10 6:56 ` [PATCH 08/44] cpufreq: define generic .attr, .exit() and .verify() routines Viresh Kumar 2013-08-10 6:56 ` [PATCH 38/44] cpufreq: sh: Use generic cpufreq routines Viresh Kumar 2013-08-10 7:58 ` [PATCH 00/44] cpufreq: define generic routines for cpufreq drivers: for 3.13 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).