cpufreq: create & use cpufreq_generic_init() routine
Subsystems (5)
Viresh Kumar
maintainercover cpufreq: create & use cpufreq_generic_init() routine
Many CPUFreq drivers for SMP system (where all cores share same clock lines), do similar stuff in their ->init() part.
This patch creates a generic routine in cpufreq core which can be used by these so that we can remove some redundant code. And later part of patchset makes other drivers use this infrastructure.
Many drivers which weren't setting policy->cpus haven't been updated as they might have separate clocks for CPUs and setting all CPUs in policy->cpus may corrupt them..
This is Sixth part of my cleanup work for CPUFreq, first five 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
4. CPUFreq: set policy->cur in cpufreq core instead of drivers
https://lkml.org/lkml/2013/8/14/288
5. CPUFreq: Move freq change notifications out of drivers
https://lkml.org/lkml/2013/8/15/506
All these are pushed here:
https://git.linaro.org/gitweb?p=people/vireshk/linux.git;a=shortlog;h=refs/heads/for-v3.13
Viresh Kumar (14):
cpufreq: create cpufreq_generic_init() routine
cpufreq: cpu0: use cpufreq_generic_init() routine
cpufreq: dbx500: use cpufreq_generic_init() routine
cpufreq: exynos: use cpufreq_generic_init() routine
cpufreq: imx6q: use cpufreq_generic_init() routine
cpufreq: kirkwood: use cpufreq_generic_init() routine
cpufreq: maple: use cpufreq_generic_init() routine
cpufreq: pasemi: use cpufreq_generic_init() routine
cpufreq: pmac64: use cpufreq_generic_init() routine
cpufreq: s3c: use cpufreq_generic_init() routine
cpufreq: s5pv210: use cpufreq_generic_init() routine
cpufreq: sa11x0: use cpufreq_generic_init() routine
cpufreq: spear: use cpufreq_generic_init() routine
cpufreq: tegra: use cpufreq_generic_init() routine
drivers/cpufreq/cpufreq-cpu0.c | 19 +------------------ drivers/cpufreq/cpufreq.c | 31 +++++++++++++++++++++++++++++++ drivers/cpufreq/dbx500-cpufreq.c | 21 +-------------------- drivers/cpufreq/exynos-cpufreq.c | 7 +------ drivers/cpufreq/exynos5440-cpufreq.c | 14 ++------------ drivers/cpufreq/imx6q-cpufreq.c | 13 +------------ drivers/cpufreq/kirkwood-cpufreq.c | 5 +---- drivers/cpufreq/maple-cpufreq.c | 9 +-------- drivers/cpufreq/pasemi-cpufreq.c | 9 +-------- drivers/cpufreq/pmac64-cpufreq.c | 9 +-------- drivers/cpufreq/s3c2416-cpufreq.c | 6 ++---- drivers/cpufreq/s3c24xx-cpufreq.c | 13 +------------ drivers/cpufreq/s3c64xx-cpufreq.c | 5 ++--- drivers/cpufreq/s5pv210-cpufreq.c | 4 +--- drivers/cpufreq/sa1100-cpufreq.c | 6 +----- drivers/cpufreq/sa1110-cpufreq.c | 6 +----- drivers/cpufreq/spear-cpufreq.c | 14 ++------------ drivers/cpufreq/tegra-cpufreq.c | 14 +++++++++----- include/linux/cpufreq.h | 3 +++ 19 files changed, 63 insertions(+), 145 deletions(-)
Signature · 1 line
1.7.12.rc2.18.g61b472e
Viresh Kumar
maintainerPATCH 1/14 cpufreq: create cpufreq_generic_init() routine
Many CPUFreq drivers for SMP system (where all cores share same clock lines), do similar stuff in their ->init() part.
This patch creates a generic routine in cpufreq core which can be used by these so that we can remove some redundant code.
--- drivers/cpufreq/cpufreq.c | 31 +++++++++++++++++++++++++++++++ include/linux/cpufreq.h | 3 +++ 2 files changed, 34 insertions(+)
drivers/cpufreq/cpufreq.c +31 -0
@@ -188,6 +188,37 @@ u64 get_cpu_idle_time(unsigned int cpu, u64 *wall, int io_busy) }EXPORT_SYMBOL_GPL (get_cpu_idle_time); +/* +* This is a generic cpufreq init() routine which can be used by cpufreq +* drivers of SMP systems. It will do following: +* - validate & show freq table passed +* - set policies transition latency +* - policy->cpus with all possible CPUs +*/ +int cpufreq_generic_init (struct cpufreq_policy *policy, +struct cpufreq_frequency_table *table, +unsigned int transition_latency) +{ +int ret; + + ret =cpufreq_table_validate_and_show (policy, table); +if (ret) { +pr_err ("%s: invalid frequency table: %d\n" , __func__, ret); +return ret; + } + + policy->cpuinfo.transition_latency = transition_latency; + +/* +* The driver only supports the SMP configuartion where all processors +* share the clock and voltage and clock. +*/ +cpumask_setall (policy->cpus); + +return 0 ; +} +EXPORT_SYMBOL_GPL (cpufreq_generic_init); +struct cpufreq_policy *cpufreq_cpu_get (unsigned int cpu) {struct cpufreq_policy *policy =NULL ;
include/linux/cpufreq.h +3 -0
@@ -424,6 +424,9 @@ void cpufreq_frequency_table_put_attr(unsigned int cpu);int cpufreq_table_validate_and_show (struct cpufreq_policy *policy,struct cpufreq_frequency_table *table); +int cpufreq_generic_init (struct cpufreq_policy *policy, +struct cpufreq_frequency_table *table, +unsigned int transition_latency);static inline int cpufreq_generic_exit (struct cpufreq_policy *policy) {cpufreq_frequency_table_put_attr (policy->cpu);
Signature · 1 line
1.7.12.rc2.18.g61b472e
Viresh Kumar
maintainerPATCH 2/14 cpufreq: cpu0: use cpufreq_generic_init() routine
In reply to Viresh KumarUse generic cpufreq_generic_init() routine instead of replicating the same code here.
--- drivers/cpufreq/cpufreq-cpu0.c | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-)
drivers/cpufreq/cpufreq-cpu0.c +1 -18
@@ -99,24 +99,7 @@ static int cpu0_set_target(struct cpufreq_policy *policy, unsigned int index)static int cpu0_cpufreq_init (struct cpufreq_policy *policy) { -int ret; - - ret =cpufreq_table_validate_and_show (policy, freq_table); -if (ret) { -pr_err ("invalid frequency table: %d\n" , ret); -return ret; - } - - policy->cpuinfo.transition_latency = transition_latency; - -/* -* The driver only supports the SMP configuartion where all processors -* share the clock and voltage and clock. Use cpufreq affected_cpus -* interface to have all CPUs scaled together. -*/ -cpumask_setall (policy->cpus); - -return 0 ; +return cpufreq_generic_init (policy, freq_table, transition_latency); }static struct cpufreq_driver cpu0_cpufreq_driver = {
Signature · 1 line
1.7.12.rc2.18.g61b472e
Viresh Kumar
maintainerPATCH 3/14 cpufreq: dbx500: use cpufreq_generic_init() routine
In reply to Viresh KumarUse generic cpufreq_generic_init() routine instead of replicating the same code here.
--- drivers/cpufreq/dbx500-cpufreq.c | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-)
drivers/cpufreq/dbx500-cpufreq.c +1 -20
@@ -44,26 +44,7 @@ static unsigned int dbx500_cpufreq_getspeed(unsigned int cpu)static int dbx500_cpufreq_init (struct cpufreq_policy *policy) { -int res; - -/* get policy fields based on the table */ - res =cpufreq_table_validate_and_show (policy, freq_table); -if (res) { -pr_err ("dbx500-cpufreq: Failed to read policy table\n" ); -return res; - } - -/* -* FIXME : Need to take time measurement across the target() -* function with no/some/all drivers in the notification -* list. -*/ - policy->cpuinfo.transition_latency =20 *1000 ;/* in ns */ - -/* policy sharing between dual CPUs */ -cpumask_setall (policy->cpus); - -return 0 ; +return cpufreq_generic_init (policy, freq_table,20 *1000 ); }static struct cpufreq_driver dbx500_cpufreq_driver = {
Signature · 1 line
1.7.12.rc2.18.g61b472e
Re: [PATCH 03/14] cpufreq: dbx500: use cpufreq_generic_init() routine
Quoted 5 lines · Viresh Kumar
Use generic
cpufreq_generic_init()routine instead of replicating the same code here.Cc Linus Walleij <[email protected]>Signed-off-by Viresh Kumar <[email protected]>
Yours,
Linus Walleij
Viresh Kumar
maintainerPATCH 4/14 cpufreq: exynos: use cpufreq_generic_init() routine
In reply to Viresh KumarUse generic cpufreq_generic_init() routine instead of replicating the same code here.
--- drivers/cpufreq/exynos-cpufreq.c | 7 +------ drivers/cpufreq/exynos5440-cpufreq.c | 14 ++------------ 2 files changed, 3 insertions(+), 18 deletions(-)
drivers/cpufreq/exynos-cpufreq.c +1 -6
@@ -214,12 +214,7 @@ static struct notifier_block exynos_cpufreq_nb = {static int exynos_cpufreq_cpu_init (struct cpufreq_policy *policy) { -/* set the transition latency value */ - policy->cpuinfo.transition_latency =100000 ; - -cpumask_setall (policy->cpus); - -return cpufreq_table_validate_and_show (policy, exynos_info->freq_table); +return cpufreq_generic_init (policy, exynos_info->freq_table,100000 ); }static struct cpufreq_driver exynos_driver = {
drivers/cpufreq/exynos5440-cpufreq.c +2 -12
@@ -308,18 +308,8 @@ static void exynos_sort_descend_freq_table(void)static int exynos_cpufreq_cpu_init (struct cpufreq_policy *policy) { -int ret; - - ret =cpufreq_table_validate_and_show (policy, dvfs_info->freq_table); -if (ret) { -dev_err (dvfs_info->dev,"Invalid frequency table: %d\n" , ret); -return ret; - } - - policy->cpuinfo.transition_latency = dvfs_info->latency; -cpumask_setall (policy->cpus); - -return 0 ; +return cpufreq_generic_init (policy, dvfs_info->freq_table, + dvfs_info->latency); }static struct cpufreq_driver exynos_driver = {
Signature · 1 line
1.7.12.rc2.18.g61b472e
Viresh Kumar
maintainerPATCH 5/14 cpufreq: imx6q: use cpufreq_generic_init() routine
In reply to Viresh KumarUse generic cpufreq_generic_init() routine instead of replicating the same code here.
--- drivers/cpufreq/imx6q-cpufreq.c | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-)
drivers/cpufreq/imx6q-cpufreq.c +1 -12
@@ -150,18 +150,7 @@ static int imx6q_set_target(struct cpufreq_policy *policy, unsigned int index)static int imx6q_cpufreq_init (struct cpufreq_policy *policy) { -int ret; - - ret =cpufreq_table_validate_and_show (policy, freq_table); -if (ret) { -dev_err (cpu_dev,"invalid frequency table: %d\n" , ret); -return ret; - } - - policy->cpuinfo.transition_latency = transition_latency; -cpumask_setall (policy->cpus); - -return 0 ; +return cpufreq_generic_init (policy, freq_table, transition_latency); }static struct cpufreq_driver imx6q_cpufreq_driver = {
Signature · 1 line
1.7.12.rc2.18.g61b472e
Viresh Kumar
maintainerPATCH 6/14 cpufreq: kirkwood: use cpufreq_generic_init() routine
In reply to Viresh KumarUse generic cpufreq_generic_init() routine instead of replicating the same code here.
--- drivers/cpufreq/kirkwood-cpufreq.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/cpufreq/kirkwood-cpufreq.c +1 -4
@@ -93,10 +93,7 @@ static int kirkwood_cpufreq_target(struct cpufreq_policy *policy,/* Module init and exit code */ static int kirkwood_cpufreq_cpu_init (struct cpufreq_policy *policy) { -/* cpuinfo and default policy values */ - policy->cpuinfo.transition_latency =5000 ;/* 5uS */ - -return cpufreq_table_validate_and_show (policy, kirkwood_freq_table); +return cpufreq_generic_init (policy, kirkwood_freq_table,5000 ); }static struct cpufreq_driver kirkwood_cpufreq_driver = {
Signature · 1 line
1.7.12.rc2.18.g61b472e
Viresh Kumar
maintainerPATCH 7/14 cpufreq: maple: use cpufreq_generic_init() routine
In reply to Viresh KumarUse generic cpufreq_generic_init() routine instead of replicating the same code here.
--- drivers/cpufreq/maple-cpufreq.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-)
drivers/cpufreq/maple-cpufreq.c +1 -8
@@ -141,16 +141,9 @@ static unsigned int maple_cpufreq_get_speed(unsigned int cpu)static int maple_cpufreq_cpu_init (struct cpufreq_policy *policy) { - policy->cpuinfo.transition_latency =12000 ; -/* secondary CPUs are tied to the primary one by the -* cpufreq core if in the secondary policy we tell it that -* it actually must be one policy together with all others. */ -cpumask_setall (policy->cpus); - -return cpufreq_table_validate_and_show (policy, maple_cpu_freqs); +return cpufreq_generic_init (policy, maple_cpu_freqs,12000 ); } -static struct cpufreq_driver maple_cpufreq_driver = { .name ="maple" , .flags =CPUFREQ_CONST_LOOPS ,
Signature · 1 line
1.7.12.rc2.18.g61b472e
Viresh Kumar
maintainerPATCH 8/14 cpufreq: pasemi: use cpufreq_generic_init() routine
In reply to Viresh KumarUse generic cpufreq_generic_init() routine instead of replicating the same code here.
--- drivers/cpufreq/pasemi-cpufreq.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-)
drivers/cpufreq/pasemi-cpufreq.c +1 -8
@@ -202,20 +202,13 @@ static int pas_cpufreq_cpu_init(struct cpufreq_policy *policy)pr_debug ("%d: %d\n" , i, pas_freqs[i].frequency); } - policy->cpuinfo.transition_latency =get_gizmo_latency (); - cur_astate =get_cur_astate (policy->cpu);pr_debug ("current astate is at %d\n" ,cur_astate); policy->cur = pas_freqs[cur_astate].frequency; -cpumask_copy (policy->cpus, cpu_online_mask); - ppc_proc_freq = policy->cur *1000ul ; -/* this ensures that policy->cpuinfo_min and policy->cpuinfo_max -* are set correctly -*/ -return cpufreq_table_validate_and_show (policy, pas_freqs); +return cpufreq_generic_init (policy, pas_freqs,get_gizmo_latency ()); out_unmap_sdcpwr:iounmap (sdcpwr_mapbase);
Signature · 1 line
1.7.12.rc2.18.g61b472e
Viresh Kumar
maintainerPATCH 9/14 cpufreq: pmac64: use cpufreq_generic_init() routine
In reply to Viresh KumarUse generic cpufreq_generic_init() routine instead of replicating the same code here.
--- drivers/cpufreq/pmac64-cpufreq.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-)
drivers/cpufreq/pmac64-cpufreq.c +1 -8
@@ -321,16 +321,9 @@ static unsigned int g5_cpufreq_get_speed(unsigned int cpu)static int g5_cpufreq_cpu_init (struct cpufreq_policy *policy) { - policy->cpuinfo.transition_latency = transition_latency; -/* secondary CPUs are tied to the primary one by the -* cpufreq core if in the secondary policy we tell it that -* it actually must be one policy together with all others. */ -cpumask_copy (policy->cpus, cpu_online_mask); - -return cpufreq_table_validate_and_show (policy, g5_cpu_freqs); +return cpufreq_generic_init (policy, g5_cpu_freqs, transition_latency); } -static struct cpufreq_driver g5_cpufreq_driver = { .name ="powermac" , .flags =CPUFREQ_CONST_LOOPS ,
Signature · 1 line
1.7.12.rc2.18.g61b472e
Viresh Kumar
maintainerPATCH 10/14 cpufreq: s3c: use cpufreq_generic_init() routine
In reply to Viresh KumarUse generic cpufreq_generic_init() routine instead of replicating the same code here.
--- drivers/cpufreq/s3c2416-cpufreq.c | 6 ++---- drivers/cpufreq/s3c24xx-cpufreq.c | 13 +------------ drivers/cpufreq/s3c64xx-cpufreq.c | 5 ++--- 3 files changed, 5 insertions(+), 19 deletions(-)
drivers/cpufreq/s3c2416-cpufreq.c +2 -4
@@ -457,10 +457,8 @@ static int __init s3c2416_cpufreq_driver_init(struct cpufreq_policy *policy)/* Datasheet says PLL stabalisation time must be at least 300us, * so but add some fudge. (reference in LOCKCON0 register description) */ - policy->cpuinfo.transition_latency = (500 *1000 ) + - s3c_freq->regulator_latency; - - ret =cpufreq_table_validate_and_show (policy, s3c_freq->freq_table); + ret =cpufreq_generic_init (policy, s3c_freq->freq_table, + (500 *1000 ) + s3c_freq->regulator_latency);if (ret) goto err_freq_table;
drivers/cpufreq/s3c24xx-cpufreq.c +1 -12
@@ -373,18 +373,7 @@ struct clk *s3c_cpufreq_clk_get(struct device *dev, const char *name)static int s3c_cpufreq_init (struct cpufreq_policy *policy) { -printk (KERN_INFO "%s: initialising policy %p\n" , __func__, policy); - -if (policy->cpu !=0 ) -return -EINVAL ; - -/* feed the latency information from the cpu driver */ - policy->cpuinfo.transition_latency = cpu_cur.info->latency; - -if (ftab) -return cpufreq_table_validate_and_show (policy, ftab); - -return 0 ; +return cpufreq_generic_init (policy, ftab, cpu_cur.info->latency); }static int __init s3c_cpufreq_initclks (void )
drivers/cpufreq/s3c64xx-cpufreq.c +2 -3
@@ -213,9 +213,8 @@ static int s3c64xx_cpufreq_driver_init(struct cpufreq_policy *policy)* the PLLs, which we don't currently) is ~300us worst case, * but add some fudge. */ - policy->cpuinfo.transition_latency = (500 *1000 ) + regulator_latency; - - ret =cpufreq_table_validate_and_show (policy, s3c64xx_freq_table); + ret =cpufreq_generic_init (policy, s3c64xx_freq_table, + (500 *1000 ) + regulator_latency);if (ret !=0 ) {pr_err ("Failed to configure frequency table: %d\n" , ret);
Signature · 1 line
1.7.12.rc2.18.g61b472e
Viresh Kumar
maintainerPATCH 11/14 cpufreq: s5pv210: use cpufreq_generic_init() routine
In reply to Viresh KumarUse generic cpufreq_generic_init() routine instead of replicating the same code here.
--- drivers/cpufreq/s5pv210-cpufreq.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/cpufreq/s5pv210-cpufreq.c +1 -3
@@ -511,9 +511,7 @@ static int __init s5pv210_cpu_init(struct cpufreq_policy *policy) s5pv210_dram_conf[1 ].refresh = (__raw_readl (S5P_VA_DMC1 +0x30 ) *1000 ); s5pv210_dram_conf[1 ].freq =clk_get_rate (dmc1_clk); - policy->cpuinfo.transition_latency =40000 ; - -return cpufreq_table_validate_and_show (policy, s5pv210_freq_table); +return cpufreq_generic_init (policy, s5pv210_freq_table,40000 ); out_dmc1:clk_put (dmc0_clk);
Signature · 1 line
1.7.12.rc2.18.g61b472e
Viresh Kumar
maintainerPATCH 12/14 cpufreq: sa11x0: use cpufreq_generic_init() routine
In reply to Viresh KumarUse generic cpufreq_generic_init() routine instead of replicating the same code here.
--- drivers/cpufreq/sa1100-cpufreq.c | 6 +----- drivers/cpufreq/sa1110-cpufreq.c | 6 +----- 2 files changed, 2 insertions(+), 10 deletions(-)
drivers/cpufreq/sa1100-cpufreq.c +1 -5
@@ -197,11 +197,7 @@ static int sa1100_target(struct cpufreq_policy *policy, unsigned int ppcr)static int __init sa1100_cpu_init (struct cpufreq_policy *policy) { -if (policy->cpu !=0 ) -return -EINVAL ; - policy->cpuinfo.transition_latency =CPUFREQ_ETERNAL ; - -return cpufreq_table_validate_and_show (policy, sa11x0_freq_table); +return cpufreq_generic_init (policy, sa11x0_freq_table,CPUFREQ_ETERNAL ); }static struct cpufreq_driver sa1100_driver__refdata = {
drivers/cpufreq/sa1110-cpufreq.c +1 -5
@@ -306,11 +306,7 @@ static int sa1110_target(struct cpufreq_policy *policy, unsigned int ppcr)static int __init sa1110_cpu_init (struct cpufreq_policy *policy) { -if (policy->cpu !=0 ) -return -EINVAL ; - policy->cpuinfo.transition_latency =CPUFREQ_ETERNAL ; - -return cpufreq_table_validate_and_show (policy, sa11x0_freq_table); +return cpufreq_generic_init (policy, sa11x0_freq_table,CPUFREQ_ETERNAL ); }/* sa1110_driver needs __refdata because it must remain after init registers
Signature · 1 line
1.7.12.rc2.18.g61b472e
Viresh Kumar
maintainerPATCH 13/14 cpufreq: spear: use cpufreq_generic_init() routine
In reply to Viresh KumarUse generic cpufreq_generic_init() routine instead of replicating the same code here.
--- drivers/cpufreq/spear-cpufreq.c | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-)
drivers/cpufreq/spear-cpufreq.c +2 -12
@@ -156,18 +156,8 @@ static int spear_cpufreq_target(struct cpufreq_policy *policy,static int spear_cpufreq_init (struct cpufreq_policy *policy) { -int ret; - - ret =cpufreq_table_validate_and_show (policy, spear_cpufreq.freq_tbl); -if (ret) { -pr_err ("cpufreq_table_validate_and_show() failed" ); -return ret; - } - - policy->cpuinfo.transition_latency = spear_cpufreq.transition_latency; -cpumask_setall (policy->cpus); - -return 0 ; +return cpufreq_generic_init (policy, spear_cpufreq.freq_tbl, + spear_cpufreq.transition_latency); }static struct cpufreq_driver spear_cpufreq_driver = {
Signature · 1 line
1.7.12.rc2.18.g61b472e
Viresh Kumar
maintainerPATCH 14/14 cpufreq: tegra: use cpufreq_generic_init() routine
In reply to Viresh KumarUse generic cpufreq_generic_init() routine instead of replicating the same code here.
Along with that we are disabling clks in error cases and ->exit() routine.
--- drivers/cpufreq/tegra-cpufreq.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-)
drivers/cpufreq/tegra-cpufreq.c +9 -5
@@ -161,18 +161,21 @@ static struct notifier_block tegra_cpu_pm_notifier = {static int tegra_cpu_init (struct cpufreq_policy *policy) { +int ret; +if (policy->cpu >=NUM_CPUS )return -EINVAL ;clk_prepare_enable (emc_clk);clk_prepare_enable (cpu_clk); -cpufreq_table_validate_and_show (policy, freq_table); -/* FIXME: what's the actual transition time? */ - policy->cpuinfo.transition_latency =300 *1000 ; - -cpumask_copy (policy->cpus, cpu_possible_mask); + ret =cpufreq_generic_init (policy, freq_table,300 *1000 ); +if (ret) { +clk_disable_unprepare (cpu_clk); +clk_disable_unprepare (emc_clk); +return ret; + }if (policy->cpu ==0 )register_pm_notifier (&tegra_cpu_pm_notifier);
@@ -183,6 +186,7 @@ static int tegra_cpu_init(struct cpufreq_policy *policy)static int tegra_cpu_exit (struct cpufreq_policy *policy) {cpufreq_frequency_table_put_attr (policy->cpu); +clk_disable_unprepare (cpu_clk);clk_disable_unprepare (emc_clk);return 0 ; }
Signature · 1 line
1.7.12.rc2.18.g61b472e
Quoted 7 lines · Viresh Kumar
Many CPUFreq drivers for SMP system (where all cores share same clock lines), do similar stuff in their ->init() part.
This patch creates a generic routine in cpufreq core which can be used by these so that we can remove some redundant code. And later part of patchset makes other drivers use this infrastructure.
Quoted 6 lines
Many drivers which weren't setting
policy->cpushaven't been updated as they might have separate clocks for CPUs and setting all CPUs inpolicy->cpusmay corrupt them..This is Sixth part of my cleanup work for CPUFreq, first five are (And obviously its rebased over them):
OK, so the plan for merging this will be that we'll put 1 into linux-next and add 2 to it after a few days etc. to give people a chance to test one set of changes before going to the next one.
Quoted 2 lines
1: cpufreq: Introduce
cpufreq_table_validate_and_show()
https://lkml.org/lkml/2013/8/8/263
So perhaps we can *try* to push the above for 3.12 if it doesn't breaks stuff left and right.
Can you please resend it with all of the ACKs collected so far?
Thanks,
Rafael
Viresh Kumar
maintainerQuoted 11 lines · Rafael J. Wysocki
OK, so the plan for merging this will be that we'll put 1 into linux-next and add 2 to it after a few days etc. to give people a chance to test one set of changes before going to the next one.
Quoted 2 lines
1: cpufreq: Introduce
cpufreq_table_validate_and_show()
https://lkml.org/lkml/2013/8/8/263So perhaps we can *try* to push the above for 3.12 if it doesn't breaks stuff left and right.
Can you please resend it with all of the ACKs collected so far?
Sure..
But I believe we can reduce our work to some extent.. Probably instead of sending all again separately, we can bind them together logically..
So, I would like to divide these six patchsets into two and we can get the first one in 3.12 now..
This is how I would bind them:
Set I: CPUFreq: Introduce helper functions to remove code redundancy <132 Patches>
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
4. CPUFreq: set policy->cur in cpufreq core instead of drivers
https://lkml.org/lkml/2013/8/14/288
6. cpufreq: create & use cpufreq_generic_init() routine <This series>
Set II: CPUFreq: Make ->target lightweight()
<70 Patches>
3. CPUFreq: Implement light weight ->target(): for 3.13
https://lkml.org/lkml/2013/8/13/349
5. CPUFreq: Move freq change notifications out of drivers
https://lkml.org/lkml/2013/8/15/506
What do you say? I will wait for your reply before actually spamming LKML with so many patches :)
I have updated commits with all the Acks and pushed them to my for-v3.13 branch..
--
viresh