This is actually part of a bigger patchset which will change declaration of cpufreq_driver->target() to include index instead of target_freq and relation and hence cpufreq drivers wouldn't require to cpufreq_frequency_table_target() anymore.
Almost every cpufreq driver is required to validate its frequency table with: cpufreq_frequency_table_cpuinfo() and then expose it to cpufreq core with: cpufreq_frequency_table_get_attr().
This patch creates another helper routine cpufreq_table_validate_and_show() that will do both these steps in a single call and will return 0 for success, error otherwise.
This also fixes potential bugs in cpufreq drivers where people have called cpufreq_frequency_table_get_attr() before calling cpufreq_frequency_table_cpuinfo(), as the later may fail.
Viresh Kumar (35): cpufreq: Add new helper cpufreq_table_validate_and_show() cpufreq: pxa: call cpufreq_frequency_table_get_attr() cpufreq: s3cx4xx: call cpufreq_frequency_table_get_attr() cpufreq: sparc: call cpufreq_frequency_table_get_attr() cpufreq: acpi-cpufreq: use cpufreq_table_validate_and_show() cpufreq: arm_big_little: use cpufreq_table_validate_and_show() cpufreq: blackfin: use cpufreq_table_validate_and_show() cpufreq: cpufreq-cpu0: use cpufreq_table_validate_and_show() cpufreq: cris: use cpufreq_table_validate_and_show() cpufreq: davinci: use cpufreq_table_validate_and_show() cpufreq: dbx500: use cpufreq_table_validate_and_show() cpufreq: e_powersaver: use cpufreq_table_validate_and_show() cpufreq: elanfreq: use cpufreq_table_validate_and_show() cpufreq: exynos: use cpufreq_table_validate_and_show() cpufreq: ia64-acpi: use cpufreq_table_validate_and_show() cpufreq: imx6q: use cpufreq_table_validate_and_show() cpufreq: kirkwood: use cpufreq_table_validate_and_show() cpufreq: longhaul: use cpufreq_table_validate_and_show() cpufreq: loongson2: use cpufreq_table_validate_and_show() cpufreq: maple: use cpufreq_table_validate_and_show() cpufreq: omap: use cpufreq_table_validate_and_show() cpufreq: p4-clockmod: use cpufreq_table_validate_and_show() cpufreq: pasemi: use cpufreq_table_validate_and_show() cpufreq: pmac: use cpufreq_table_validate_and_show() cpufreq: powernow: use cpufreq_table_validate_and_show() cpufreq: ppc: use cpufreq_table_validate_and_show() cpufreq: pxa: use cpufreq_table_validate_and_show() cpufreq: s3cx4xx: use cpufreq_table_validate_and_show() cpufreq: s5pv210: use cpufreq_table_validate_and_show() cpufreq: sc520: use cpufreq_table_validate_and_show() cpufreq: sh: use cpufreq_table_validate_and_show() cpufreq: sparc: use cpufreq_table_validate_and_show() cpufreq: spear: use cpufreq_table_validate_and_show() cpufreq: speedstep: use cpufreq_table_validate_and_show() cpufreq: tegra: use cpufreq_table_validate_and_show()
drivers/cpufreq/acpi-cpufreq.c | 4 +--- drivers/cpufreq/arm_big_little.c | 4 +--- drivers/cpufreq/blackfin-cpufreq.c | 3 +-- drivers/cpufreq/cpufreq-cpu0.c | 4 +--- drivers/cpufreq/cris-artpec3-cpufreq.c | 10 +--------- drivers/cpufreq/cris-etraxfs-cpufreq.c | 10 +--------- drivers/cpufreq/davinci-cpufreq.c | 6 ++---- drivers/cpufreq/dbx500-cpufreq.c | 6 ++---- drivers/cpufreq/e_powersaver.c | 3 +-- drivers/cpufreq/elanfreq.c | 8 +------- drivers/cpufreq/exynos-cpufreq.c | 4 +--- drivers/cpufreq/exynos5440-cpufreq.c | 4 +--- drivers/cpufreq/freq_table.c | 12 ++++++++++++ drivers/cpufreq/ia64-acpi-cpufreq.c | 4 +--- drivers/cpufreq/imx6q-cpufreq.c | 3 +-- drivers/cpufreq/kirkwood-cpufreq.c | 10 +--------- drivers/cpufreq/longhaul.c | 8 +------- drivers/cpufreq/loongson2_cpufreq.c | 5 +---- drivers/cpufreq/maple-cpufreq.c | 4 +--- drivers/cpufreq/omap-cpufreq.c | 4 +--- drivers/cpufreq/p4-clockmod.c | 3 +-- drivers/cpufreq/pasemi-cpufreq.c | 4 +--- drivers/cpufreq/pmac32-cpufreq.c | 3 +-- drivers/cpufreq/pmac64-cpufreq.c | 4 +--- drivers/cpufreq/powernow-k6.c | 9 +-------- drivers/cpufreq/powernow-k7.c | 4 +--- drivers/cpufreq/powernow-k8.c | 4 +--- drivers/cpufreq/ppc-corenet-cpufreq.c | 3 +-- drivers/cpufreq/ppc_cbe_cpufreq.c | 4 +--- drivers/cpufreq/pxa2xx-cpufreq.c | 8 +++++--- drivers/cpufreq/pxa3xx-cpufreq.c | 2 +- drivers/cpufreq/s3c2416-cpufreq.c | 4 +--- drivers/cpufreq/s3c24xx-cpufreq.c | 2 +- drivers/cpufreq/s3c64xx-cpufreq.c | 2 +- drivers/cpufreq/s5pv210-cpufreq.c | 4 +--- drivers/cpufreq/sc520_freq.c | 9 +-------- drivers/cpufreq/sh-cpufreq.c | 6 +++--- drivers/cpufreq/sparc-us2e-cpufreq.c | 2 +- drivers/cpufreq/sparc-us3-cpufreq.c | 2 +- drivers/cpufreq/spear-cpufreq.c | 5 ++--- drivers/cpufreq/speedstep-centrino.c | 10 +--------- drivers/cpufreq/speedstep-ich.c | 9 +-------- drivers/cpufreq/speedstep-smi.c | 8 +------- drivers/cpufreq/tegra-cpufreq.c | 4 +--- include/linux/cpufreq.h | 2 ++ 45 files changed, 66 insertions(+), 167 deletions(-)
Almost every cpufreq driver is required to validate its frequency table with: cpufreq_frequency_table_cpuinfo() and then expose it to cpufreq core with: cpufreq_frequency_table_get_attr().
This patch creates another helper routine cpufreq_table_validate_and_show() that will do both these steps in a single call and will return 0 for success, error otherwise.
This also fixes potential bugs in cpufreq drivers where people have called cpufreq_frequency_table_get_attr() before calling cpufreq_frequency_table_cpuinfo(), as the later may fail.
Signed-off-by: Viresh Kumar viresh.kumar@linaro.org --- drivers/cpufreq/freq_table.c | 12 ++++++++++++ include/linux/cpufreq.h | 2 ++ 2 files changed, 14 insertions(+)
diff --git a/drivers/cpufreq/freq_table.c b/drivers/cpufreq/freq_table.c index f111454a..11f6fa9 100644 --- a/drivers/cpufreq/freq_table.c +++ b/drivers/cpufreq/freq_table.c @@ -219,6 +219,18 @@ void cpufreq_frequency_table_put_attr(unsigned int cpu) } EXPORT_SYMBOL_GPL(cpufreq_frequency_table_put_attr);
+int cpufreq_table_validate_and_show(struct cpufreq_policy *policy, + struct cpufreq_frequency_table *table) +{ + int ret = cpufreq_frequency_table_cpuinfo(policy, table); + + if (!ret) + cpufreq_frequency_table_get_attr(table, policy->cpu); + + return ret; +} +EXPORT_SYMBOL_GPL(cpufreq_table_validate_and_show); + void cpufreq_frequency_table_update_policy_cpu(struct cpufreq_policy *policy) { pr_debug("Updating show_table for new_cpu %u from last_cpu %u\n", diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h index d568f39..c0297a6 100644 --- a/include/linux/cpufreq.h +++ b/include/linux/cpufreq.h @@ -411,5 +411,7 @@ extern struct freq_attr cpufreq_freq_attr_scaling_available_freqs; 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);
#endif /* _LINUX_CPUFREQ_H */
This exposes frequency table of driver to cpufreq core and is required for core to guess what the index for a target frequency is, when it calls cpufreq_frequency_table_target(). And so this driver needs to expose it.
Cc: Eric Miao eric.y.miao@gmail.com Signed-off-by: Viresh Kumar viresh.kumar@linaro.org --- drivers/cpufreq/pxa2xx-cpufreq.c | 6 +++++- drivers/cpufreq/pxa3xx-cpufreq.c | 8 ++++++-- 2 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/drivers/cpufreq/pxa2xx-cpufreq.c b/drivers/cpufreq/pxa2xx-cpufreq.c index fb3981a..c7ea005 100644 --- a/drivers/cpufreq/pxa2xx-cpufreq.c +++ b/drivers/cpufreq/pxa2xx-cpufreq.c @@ -453,10 +453,14 @@ static int pxa_cpufreq_init(struct cpufreq_policy *policy) find_freq_tables(&pxa255_freq_table, &pxa255_freqs); pr_info("PXA255 cpufreq using %s frequency table\n", pxa255_turbo_table ? "turbo" : "run"); + cpufreq_frequency_table_cpuinfo(policy, pxa255_freq_table); + cpufreq_frequency_table_get_attr(pxa255_freq_table, policy->cpu); } - else if (cpu_is_pxa27x()) + else if (cpu_is_pxa27x()) { cpufreq_frequency_table_cpuinfo(policy, pxa27x_freq_table); + cpufreq_frequency_table_get_attr(pxa27x_freq_table, policy->cpu); + }
printk(KERN_INFO "PXA CPU frequency change support initialized\n");
diff --git a/drivers/cpufreq/pxa3xx-cpufreq.c b/drivers/cpufreq/pxa3xx-cpufreq.c index 9c92ef0..f53f28d6 100644 --- a/drivers/cpufreq/pxa3xx-cpufreq.c +++ b/drivers/cpufreq/pxa3xx-cpufreq.c @@ -91,7 +91,7 @@ static int setup_freqs_table(struct cpufreq_policy *policy, struct pxa3xx_freq_info *freqs, int num) { struct cpufreq_frequency_table *table; - int i; + int i, ret;
table = kzalloc((num + 1) * sizeof(*table), GFP_KERNEL); if (table == NULL) @@ -108,7 +108,11 @@ static int setup_freqs_table(struct cpufreq_policy *policy, pxa3xx_freqs_num = num; pxa3xx_freqs_table = table;
- return cpufreq_frequency_table_cpuinfo(policy, table); + ret = cpufreq_frequency_table_cpuinfo(policy, table); + if (!ret) + cpufreq_frequency_table_get_attr(table, policy->cpu); + + return ret; }
static void __update_core_freq(struct pxa3xx_freq_info *info)
This exposes frequency table of driver to cpufreq core and is required for core to guess what the index for a target frequency is, when it calls cpufreq_frequency_table_target(). And so this driver needs to expose it.
Cc: Kukjin Kim kgene.kim@samsung.com Signed-off-by: Viresh Kumar viresh.kumar@linaro.org --- drivers/cpufreq/s3c24xx-cpufreq.c | 4 +++- drivers/cpufreq/s3c64xx-cpufreq.c | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/drivers/cpufreq/s3c24xx-cpufreq.c b/drivers/cpufreq/s3c24xx-cpufreq.c index f169ee5..8843454 100644 --- a/drivers/cpufreq/s3c24xx-cpufreq.c +++ b/drivers/cpufreq/s3c24xx-cpufreq.c @@ -386,8 +386,10 @@ static int s3c_cpufreq_init(struct cpufreq_policy *policy) /* feed the latency information from the cpu driver */ policy->cpuinfo.transition_latency = cpu_cur.info->latency;
- if (ftab) + if (ftab) { cpufreq_frequency_table_cpuinfo(policy, ftab); + cpufreq_frequency_table_get_attr(ftab, policy->cpu); + }
return 0; } diff --git a/drivers/cpufreq/s3c64xx-cpufreq.c b/drivers/cpufreq/s3c64xx-cpufreq.c index 8a72b0c..9024043 100644 --- a/drivers/cpufreq/s3c64xx-cpufreq.c +++ b/drivers/cpufreq/s3c64xx-cpufreq.c @@ -257,6 +257,9 @@ static int s3c64xx_cpufreq_driver_init(struct cpufreq_policy *policy) ret); regulator_put(vddarm); clk_put(armclk); + } else { + cpufreq_frequency_table_get_attr(s3c64xx_freq_table, + policy->cpu); }
return ret;
This exposes frequency table of driver to cpufreq core and is required for core to guess what the index for a target frequency is, when it calls cpufreq_frequency_table_target(). And so this driver needs to expose it.
Cc: David S. Miller davem@davemloft.net Cc: sparclinux@vger.kernel.org Signed-off-by: Viresh Kumar viresh.kumar@linaro.org --- drivers/cpufreq/sparc-us2e-cpufreq.c | 6 +++++- drivers/cpufreq/sparc-us3-cpufreq.c | 7 ++++++- 2 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/drivers/cpufreq/sparc-us2e-cpufreq.c b/drivers/cpufreq/sparc-us2e-cpufreq.c index cf5bc2c..80e6d92 100644 --- a/drivers/cpufreq/sparc-us2e-cpufreq.c +++ b/drivers/cpufreq/sparc-us2e-cpufreq.c @@ -307,6 +307,7 @@ static int __init us2e_freq_cpu_init(struct cpufreq_policy *policy) unsigned long clock_tick = sparc64_get_clock_tick(cpu) / 1000; struct cpufreq_frequency_table *table = &us2e_freq_table[cpu].table[0]; + int ret;
table[0].driver_data = 0; table[0].frequency = clock_tick / 1; @@ -324,7 +325,10 @@ static int __init us2e_freq_cpu_init(struct cpufreq_policy *policy) policy->cpuinfo.transition_latency = 0; policy->cur = clock_tick;
- return cpufreq_frequency_table_cpuinfo(policy, table); + ret = cpufreq_frequency_table_cpuinfo(policy, table); + if (!ret) + cpufreq_frequency_table_get_attr(table, policy->cpu); + return ret; }
static int us2e_freq_cpu_exit(struct cpufreq_policy *policy) diff --git a/drivers/cpufreq/sparc-us3-cpufreq.c b/drivers/cpufreq/sparc-us3-cpufreq.c index ac76b48..73a90de 100644 --- a/drivers/cpufreq/sparc-us3-cpufreq.c +++ b/drivers/cpufreq/sparc-us3-cpufreq.c @@ -168,6 +168,7 @@ static int __init us3_freq_cpu_init(struct cpufreq_policy *policy) unsigned long clock_tick = sparc64_get_clock_tick(cpu) / 1000; struct cpufreq_frequency_table *table = &us3_freq_table[cpu].table[0]; + int ret;
table[0].driver_data = 0; table[0].frequency = clock_tick / 1; @@ -181,7 +182,11 @@ static int __init us3_freq_cpu_init(struct cpufreq_policy *policy) policy->cpuinfo.transition_latency = 0; policy->cur = clock_tick;
- return cpufreq_frequency_table_cpuinfo(policy, table); + ret = cpufreq_frequency_table_cpuinfo(policy, table); + if (!ret) + cpufreq_frequency_table_get_attr(table, policy->cpu); + + return ret; }
static int us3_freq_cpu_exit(struct cpufreq_policy *policy)
Lets use cpufreq_table_validate_and_show() instead of calling cpufreq_frequency_table_cpuinfo() and cpufreq_frequency_table_get_attr().
Signed-off-by: Viresh Kumar viresh.kumar@linaro.org --- drivers/cpufreq/acpi-cpufreq.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/cpufreq/acpi-cpufreq.c b/drivers/cpufreq/acpi-cpufreq.c index 9b5d1b1..75e829d 100644 --- a/drivers/cpufreq/acpi-cpufreq.c +++ b/drivers/cpufreq/acpi-cpufreq.c @@ -837,7 +837,7 @@ static int acpi_cpufreq_cpu_init(struct cpufreq_policy *policy) data->freq_table[valid_states].frequency = CPUFREQ_TABLE_END; perf->state = 0;
- result = cpufreq_frequency_table_cpuinfo(policy, data->freq_table); + result = cpufreq_table_validate_and_show(policy, data->freq_table); if (result) goto err_freqfree;
@@ -868,8 +868,6 @@ static int acpi_cpufreq_cpu_init(struct cpufreq_policy *policy) (u32) perf->states[i].power, (u32) perf->states[i].transition_latency);
- cpufreq_frequency_table_get_attr(data->freq_table, policy->cpu); - /* * the first call to ->target() should result in us actually * writing something to the appropriate registers.
Lets use cpufreq_table_validate_and_show() instead of calling cpufreq_frequency_table_cpuinfo() and cpufreq_frequency_table_get_attr().
Signed-off-by: Viresh Kumar viresh.kumar@linaro.org --- drivers/cpufreq/arm_big_little.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/cpufreq/arm_big_little.c b/drivers/cpufreq/arm_big_little.c index 3549f07..5070273 100644 --- a/drivers/cpufreq/arm_big_little.c +++ b/drivers/cpufreq/arm_big_little.c @@ -165,7 +165,7 @@ static int bL_cpufreq_init(struct cpufreq_policy *policy) if (ret) return ret;
- ret = cpufreq_frequency_table_cpuinfo(policy, freq_table[cur_cluster]); + ret = cpufreq_table_validate_and_show(policy, freq_table[cur_cluster]); if (ret) { dev_err(cpu_dev, "CPU %d, cluster: %d invalid freq table\n", policy->cpu, cur_cluster); @@ -173,8 +173,6 @@ static int bL_cpufreq_init(struct cpufreq_policy *policy) return ret; }
- cpufreq_frequency_table_get_attr(freq_table[cur_cluster], policy->cpu); - if (arm_bL_ops->get_transition_latency) policy->cpuinfo.transition_latency = arm_bL_ops->get_transition_latency(cpu_dev);
Lets use cpufreq_table_validate_and_show() instead of calling cpufreq_frequency_table_cpuinfo() and cpufreq_frequency_table_get_attr().
Cc: Steven Miao realmz6@gmail.com Signed-off-by: Viresh Kumar viresh.kumar@linaro.org --- drivers/cpufreq/blackfin-cpufreq.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/cpufreq/blackfin-cpufreq.c b/drivers/cpufreq/blackfin-cpufreq.c index ef05978..54c0a0c 100644 --- a/drivers/cpufreq/blackfin-cpufreq.c +++ b/drivers/cpufreq/blackfin-cpufreq.c @@ -210,8 +210,7 @@ static int __bfin_cpu_init(struct cpufreq_policy *policy) policy->cpuinfo.transition_latency = 50000; /* 50us assumed */
policy->cur = cclk; - cpufreq_frequency_table_get_attr(bfin_freq_table, policy->cpu); - return cpufreq_frequency_table_cpuinfo(policy, bfin_freq_table); + return cpufreq_table_validate_and_show(policy, bfin_freq_table); }
static struct freq_attr *bfin_freq_attr[] = {
Lets use cpufreq_table_validate_and_show() instead of calling cpufreq_frequency_table_cpuinfo() and cpufreq_frequency_table_get_attr().
Cc: Shawn Guo shawn.guo@linaro.org Signed-off-by: Viresh Kumar viresh.kumar@linaro.org --- drivers/cpufreq/cpufreq-cpu0.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/cpufreq/cpufreq-cpu0.c b/drivers/cpufreq/cpufreq-cpu0.c index ad1fde2..65d70a3 100644 --- a/drivers/cpufreq/cpufreq-cpu0.c +++ b/drivers/cpufreq/cpufreq-cpu0.c @@ -128,7 +128,7 @@ static int cpu0_cpufreq_init(struct cpufreq_policy *policy) { int ret;
- ret = cpufreq_frequency_table_cpuinfo(policy, freq_table); + ret = cpufreq_table_validate_and_show(policy, freq_table); if (ret) { pr_err("invalid frequency table: %d\n", ret); return ret; @@ -144,8 +144,6 @@ static int cpu0_cpufreq_init(struct cpufreq_policy *policy) */ cpumask_setall(policy->cpus);
- cpufreq_frequency_table_get_attr(freq_table, policy->cpu); - return 0; }
On Thu, Aug 08, 2013 at 07:18:10PM +0530, Viresh Kumar wrote:
Lets use cpufreq_table_validate_and_show() instead of calling cpufreq_frequency_table_cpuinfo() and cpufreq_frequency_table_get_attr().
Cc: Shawn Guo shawn.guo@linaro.org Signed-off-by: Viresh Kumar viresh.kumar@linaro.org
I'm not copied on the patch that introduces function cpufreq_table_validate_and_show(). So if it does the right/equivalent thing, for cpufreq-cpu0 and imx6q-cpufreq:
Acked-by: Shawn Guo shawn.guo@linaro.org
On 12 August 2013 13:05, Shawn Guo shawn.guo@linaro.org wrote:
On Thu, Aug 08, 2013 at 07:18:10PM +0530, Viresh Kumar wrote:
Lets use cpufreq_table_validate_and_show() instead of calling cpufreq_frequency_table_cpuinfo() and cpufreq_frequency_table_get_attr().
Cc: Shawn Guo shawn.guo@linaro.org Signed-off-by: Viresh Kumar viresh.kumar@linaro.org
I'm not copied on the patch that introduces function cpufreq_table_validate_and_show(). So if it does the right/equivalent thing, for cpufreq-cpu0 and imx6q-cpufreq:
You better check it :)
https://lkml.org/lkml/2013/8/8/266
I wasn't probably following the right way for sending mails as I was expecting people to look at these patches over list..
In the next series with 44 patch I tried to fix this issue. And so cc'd people on cover-letter and the important patch they must check.
Acked-by: Shawn Guo shawn.guo@linaro.org
Thanks.
Lets use cpufreq_table_validate_and_show() instead of calling cpufreq_frequency_table_cpuinfo() and cpufreq_frequency_table_get_attr().
Cc: Jesper Nilsson jesper.nilsson@axis.com Cc: Mikael Starvik starvik@axis.com Cc: linux-cris-kernel@axis.com Signed-off-by: Viresh Kumar viresh.kumar@linaro.org --- drivers/cpufreq/cris-artpec3-cpufreq.c | 10 +--------- drivers/cpufreq/cris-etraxfs-cpufreq.c | 10 +--------- 2 files changed, 2 insertions(+), 18 deletions(-)
diff --git a/drivers/cpufreq/cris-artpec3-cpufreq.c b/drivers/cpufreq/cris-artpec3-cpufreq.c index cb8276d..444fd96 100644 --- a/drivers/cpufreq/cris-artpec3-cpufreq.c +++ b/drivers/cpufreq/cris-artpec3-cpufreq.c @@ -76,19 +76,11 @@ static int cris_freq_target(struct cpufreq_policy *policy,
static int cris_freq_cpu_init(struct cpufreq_policy *policy) { - int result; - /* cpuinfo and default policy values */ policy->cpuinfo.transition_latency = 1000000; /* 1ms */ policy->cur = cris_freq_get_cpu_frequency(0);
- result = cpufreq_frequency_table_cpuinfo(policy, cris_freq_table); - if (result) - return (result); - - cpufreq_frequency_table_get_attr(cris_freq_table, policy->cpu); - - return 0; + return cpufreq_table_validate_and_show(policy, cris_freq_table); }
diff --git a/drivers/cpufreq/cris-etraxfs-cpufreq.c b/drivers/cpufreq/cris-etraxfs-cpufreq.c index 72328f7..428395e 100644 --- a/drivers/cpufreq/cris-etraxfs-cpufreq.c +++ b/drivers/cpufreq/cris-etraxfs-cpufreq.c @@ -75,19 +75,11 @@ static int cris_freq_target(struct cpufreq_policy *policy,
static int cris_freq_cpu_init(struct cpufreq_policy *policy) { - int result; - /* cpuinfo and default policy values */ policy->cpuinfo.transition_latency = 1000000; /* 1ms */ policy->cur = cris_freq_get_cpu_frequency(0);
- result = cpufreq_frequency_table_cpuinfo(policy, cris_freq_table); - if (result) - return (result); - - cpufreq_frequency_table_get_attr(cris_freq_table, policy->cpu); - - return 0; + return cpufreq_table_validate_and_show(policy, cris_freq_table); }
static int cris_freq_cpu_exit(struct cpufreq_policy *policy)
Lets use cpufreq_table_validate_and_show() instead of calling cpufreq_frequency_table_cpuinfo() and cpufreq_frequency_table_get_attr().
Cc: Sekhar Nori nsekhar@ti.com Signed-off-by: Viresh Kumar viresh.kumar@linaro.org --- drivers/cpufreq/davinci-cpufreq.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/cpufreq/davinci-cpufreq.c b/drivers/cpufreq/davinci-cpufreq.c index 551dd65..f67196e 100644 --- a/drivers/cpufreq/davinci-cpufreq.c +++ b/drivers/cpufreq/davinci-cpufreq.c @@ -140,15 +140,13 @@ static int davinci_cpu_init(struct cpufreq_policy *policy)
policy->cur = davinci_getspeed(0);
- result = cpufreq_frequency_table_cpuinfo(policy, freq_table); + result = cpufreq_table_validate_and_show(policy, freq_table); if (result) { - pr_err("%s: cpufreq_frequency_table_cpuinfo() failed", + pr_err("%s: cpufreq_table_validate_and_show() failed", __func__); return result; }
- cpufreq_frequency_table_get_attr(freq_table, policy->cpu); - /* * Time measurement across the target() function yields ~1500-1800us * time taken with no drivers on notification list.
Lets use cpufreq_table_validate_and_show() instead of calling cpufreq_frequency_table_cpuinfo() and cpufreq_frequency_table_get_attr().
Cc: Linus Walleij linus.walleij@linaro.org Signed-off-by: Viresh Kumar viresh.kumar@linaro.org --- drivers/cpufreq/dbx500-cpufreq.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/cpufreq/dbx500-cpufreq.c b/drivers/cpufreq/dbx500-cpufreq.c index 26321cd..ea03b92 100644 --- a/drivers/cpufreq/dbx500-cpufreq.c +++ b/drivers/cpufreq/dbx500-cpufreq.c @@ -87,10 +87,8 @@ static int dbx500_cpufreq_init(struct cpufreq_policy *policy) int res;
/* get policy fields based on the table */ - res = cpufreq_frequency_table_cpuinfo(policy, freq_table); - if (!res) - cpufreq_frequency_table_get_attr(freq_table, policy->cpu); - else { + res = cpufreq_table_validate_and_show(policy, freq_table); + if (res) pr_err("dbx500-cpufreq: Failed to read policy table\n"); return res; }
On Thu, Aug 8, 2013 at 3:48 PM, Viresh Kumar viresh.kumar@linaro.org wrote:
Lets use cpufreq_table_validate_and_show() instead of calling cpufreq_frequency_table_cpuinfo() and cpufreq_frequency_table_get_attr().
Cc: Linus Walleij linus.walleij@linaro.org Signed-off-by: Viresh Kumar viresh.kumar@linaro.org
Acked-by: Linus Walleij linus.walleij@linaro.org
Yours, Linus Walleij
Lets use cpufreq_table_validate_and_show() instead of calling cpufreq_frequency_table_cpuinfo() and cpufreq_frequency_table_get_attr().
Signed-off-by: Viresh Kumar viresh.kumar@linaro.org --- drivers/cpufreq/e_powersaver.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/cpufreq/e_powersaver.c b/drivers/cpufreq/e_powersaver.c index 09f64cc..c1b7c99 100644 --- a/drivers/cpufreq/e_powersaver.c +++ b/drivers/cpufreq/e_powersaver.c @@ -403,13 +403,12 @@ static int eps_cpu_init(struct cpufreq_policy *policy) policy->cpuinfo.transition_latency = 140000; /* 844mV -> 700mV in ns */ policy->cur = fsb * current_multiplier;
- ret = cpufreq_frequency_table_cpuinfo(policy, ¢aur->freq_table[0]); + ret = cpufreq_table_validate_and_show(policy, ¢aur->freq_table[0]); if (ret) { kfree(centaur); return ret; }
- cpufreq_frequency_table_get_attr(¢aur->freq_table[0], policy->cpu); return 0; }
Lets use cpufreq_table_validate_and_show() instead of calling cpufreq_frequency_table_cpuinfo() and cpufreq_frequency_table_get_attr().
Signed-off-by: Viresh Kumar viresh.kumar@linaro.org --- drivers/cpufreq/elanfreq.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-)
diff --git a/drivers/cpufreq/elanfreq.c b/drivers/cpufreq/elanfreq.c index 823a400..4000c34 100644 --- a/drivers/cpufreq/elanfreq.c +++ b/drivers/cpufreq/elanfreq.c @@ -202,7 +202,6 @@ static int elanfreq_cpu_init(struct cpufreq_policy *policy) { struct cpuinfo_x86 *c = &cpu_data(0); unsigned int i; - int result;
/* capability check */ if ((c->x86_vendor != X86_VENDOR_AMD) || @@ -223,12 +222,7 @@ static int elanfreq_cpu_init(struct cpufreq_policy *policy) policy->cpuinfo.transition_latency = CPUFREQ_ETERNAL; policy->cur = elanfreq_get_cpu_frequency(0);
- result = cpufreq_frequency_table_cpuinfo(policy, elanfreq_table); - if (result) - return result; - - cpufreq_frequency_table_get_attr(elanfreq_table, policy->cpu); - return 0; + return cpufreq_table_validate_and_show(policy, elanfreq_table); }
Lets use cpufreq_table_validate_and_show() instead of calling cpufreq_frequency_table_cpuinfo() and cpufreq_frequency_table_get_attr().
Cc: Kukjin Kim kgene.kim@samsung.com Signed-off-by: Viresh Kumar viresh.kumar@linaro.org --- drivers/cpufreq/exynos-cpufreq.c | 4 +--- drivers/cpufreq/exynos5440-cpufreq.c | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-)
diff --git a/drivers/cpufreq/exynos-cpufreq.c b/drivers/cpufreq/exynos-cpufreq.c index 3664751..71c4926 100644 --- a/drivers/cpufreq/exynos-cpufreq.c +++ b/drivers/cpufreq/exynos-cpufreq.c @@ -249,14 +249,12 @@ static int exynos_cpufreq_cpu_init(struct cpufreq_policy *policy) { policy->cur = policy->min = policy->max = exynos_getspeed(policy->cpu);
- cpufreq_frequency_table_get_attr(exynos_info->freq_table, policy->cpu); - /* set the transition latency value */ policy->cpuinfo.transition_latency = 100000;
cpumask_setall(policy->cpus);
- return cpufreq_frequency_table_cpuinfo(policy, exynos_info->freq_table); + return cpufreq_table_validate_and_show(policy, exynos_info->freq_table); }
static int exynos_cpufreq_cpu_exit(struct cpufreq_policy *policy) diff --git a/drivers/cpufreq/exynos5440-cpufreq.c b/drivers/cpufreq/exynos5440-cpufreq.c index 0c74018..1ac93e0 100644 --- a/drivers/cpufreq/exynos5440-cpufreq.c +++ b/drivers/cpufreq/exynos5440-cpufreq.c @@ -323,7 +323,7 @@ static int exynos_cpufreq_cpu_init(struct cpufreq_policy *policy) { int ret;
- ret = cpufreq_frequency_table_cpuinfo(policy, dvfs_info->freq_table); + 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; @@ -333,8 +333,6 @@ static int exynos_cpufreq_cpu_init(struct cpufreq_policy *policy) policy->cpuinfo.transition_latency = dvfs_info->latency; cpumask_setall(policy->cpus);
- cpufreq_frequency_table_get_attr(dvfs_info->freq_table, policy->cpu); - return 0; }
Lets use cpufreq_table_validate_and_show() instead of calling cpufreq_frequency_table_cpuinfo() and cpufreq_frequency_table_get_attr().
Cc: Tony Luck tony.luck@intel.com Signed-off-by: Viresh Kumar viresh.kumar@linaro.org --- drivers/cpufreq/ia64-acpi-cpufreq.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/cpufreq/ia64-acpi-cpufreq.c b/drivers/cpufreq/ia64-acpi-cpufreq.c index 3e14f03..6cfad51 100644 --- a/drivers/cpufreq/ia64-acpi-cpufreq.c +++ b/drivers/cpufreq/ia64-acpi-cpufreq.c @@ -335,7 +335,7 @@ acpi_cpufreq_cpu_init ( } }
- result = cpufreq_frequency_table_cpuinfo(policy, data->freq_table); + result = cpufreq_table_validate_and_show(policy, data->freq_table); if (result) { goto err_freqfree; } @@ -356,8 +356,6 @@ acpi_cpufreq_cpu_init ( (u32) data->acpi_data.states[i].status, (u32) data->acpi_data.states[i].control);
- cpufreq_frequency_table_get_attr(data->freq_table, policy->cpu); - /* the first call to ->target() should result in us actually * writing something to the appropriate registers. */ data->resume = 1;
Lets use cpufreq_table_validate_and_show() instead of calling cpufreq_frequency_table_cpuinfo() and cpufreq_frequency_table_get_attr().
Cc: Shawn Guo shawn.guo@linaro.org Signed-off-by: Viresh Kumar viresh.kumar@linaro.org --- drivers/cpufreq/imx6q-cpufreq.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/cpufreq/imx6q-cpufreq.c b/drivers/cpufreq/imx6q-cpufreq.c index e37cdae..e6f40fa 100644 --- a/drivers/cpufreq/imx6q-cpufreq.c +++ b/drivers/cpufreq/imx6q-cpufreq.c @@ -177,7 +177,7 @@ static int imx6q_cpufreq_init(struct cpufreq_policy *policy) { int ret;
- ret = cpufreq_frequency_table_cpuinfo(policy, freq_table); + ret = cpufreq_table_validate_and_show(policy, freq_table); if (ret) { dev_err(cpu_dev, "invalid frequency table: %d\n", ret); return ret; @@ -186,7 +186,6 @@ static int imx6q_cpufreq_init(struct cpufreq_policy *policy) policy->cpuinfo.transition_latency = transition_latency; policy->cur = clk_get_rate(arm_clk) / 1000; cpumask_setall(policy->cpus); - cpufreq_frequency_table_get_attr(freq_table, policy->cpu);
return 0; }
Lets use cpufreq_table_validate_and_show() instead of calling cpufreq_frequency_table_cpuinfo() and cpufreq_frequency_table_get_attr().
Cc: Andrew Lunn andrew@lunn.ch Signed-off-by: Viresh Kumar viresh.kumar@linaro.org --- drivers/cpufreq/kirkwood-cpufreq.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-)
diff --git a/drivers/cpufreq/kirkwood-cpufreq.c b/drivers/cpufreq/kirkwood-cpufreq.c index 45e4d7f..336f171 100644 --- a/drivers/cpufreq/kirkwood-cpufreq.c +++ b/drivers/cpufreq/kirkwood-cpufreq.c @@ -125,19 +125,11 @@ static int kirkwood_cpufreq_target(struct cpufreq_policy *policy, /* Module init and exit code */ static int kirkwood_cpufreq_cpu_init(struct cpufreq_policy *policy) { - int result; - /* cpuinfo and default policy values */ policy->cpuinfo.transition_latency = 5000; /* 5uS */ policy->cur = kirkwood_cpufreq_get_cpu_frequency(0);
- result = cpufreq_frequency_table_cpuinfo(policy, kirkwood_freq_table); - if (result) - return result; - - cpufreq_frequency_table_get_attr(kirkwood_freq_table, policy->cpu); - - return 0; + return cpufreq_table_validate_and_show(policy, kirkwood_freq_table); }
static int kirkwood_cpufreq_cpu_exit(struct cpufreq_policy *policy)
On Thu, Aug 08, 2013 at 07:18:19PM +0530, Viresh Kumar wrote:
Lets use cpufreq_table_validate_and_show() instead of calling cpufreq_frequency_table_cpuinfo() and cpufreq_frequency_table_get_attr().
Cc: Andrew Lunn andrew@lunn.ch Signed-off-by: Viresh Kumar viresh.kumar@linaro.org
drivers/cpufreq/kirkwood-cpufreq.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-)
diff --git a/drivers/cpufreq/kirkwood-cpufreq.c b/drivers/cpufreq/kirkwood-cpufreq.c index 45e4d7f..336f171 100644 --- a/drivers/cpufreq/kirkwood-cpufreq.c +++ b/drivers/cpufreq/kirkwood-cpufreq.c @@ -125,19 +125,11 @@ static int kirkwood_cpufreq_target(struct cpufreq_policy *policy, /* Module init and exit code */ static int kirkwood_cpufreq_cpu_init(struct cpufreq_policy *policy) {
- int result;
- /* cpuinfo and default policy values */ policy->cpuinfo.transition_latency = 5000; /* 5uS */ policy->cur = kirkwood_cpufreq_get_cpu_frequency(0);
- result = cpufreq_frequency_table_cpuinfo(policy, kirkwood_freq_table);
- if (result)
return result;
- cpufreq_frequency_table_get_attr(kirkwood_freq_table, policy->cpu);
- return 0;
- return cpufreq_table_validate_and_show(policy, kirkwood_freq_table);
} static int kirkwood_cpufreq_cpu_exit(struct cpufreq_policy *policy) -- 1.7.12.rc2.18.g61b472e
Reviewed-by: Andrew Lunn andrew@lunn.ch
Thanks Andrew
Lets use cpufreq_table_validate_and_show() instead of calling cpufreq_frequency_table_cpuinfo() and cpufreq_frequency_table_get_attr().
Signed-off-by: Viresh Kumar viresh.kumar@linaro.org --- drivers/cpufreq/longhaul.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-)
diff --git a/drivers/cpufreq/longhaul.c b/drivers/cpufreq/longhaul.c index 4ada1cc..70b66fd 100644 --- a/drivers/cpufreq/longhaul.c +++ b/drivers/cpufreq/longhaul.c @@ -921,13 +921,7 @@ static int longhaul_cpu_init(struct cpufreq_policy *policy) policy->cpuinfo.transition_latency = 200000; /* nsec */ policy->cur = calc_speed(longhaul_get_cpu_mult());
- ret = cpufreq_frequency_table_cpuinfo(policy, longhaul_table); - if (ret) - return ret; - - cpufreq_frequency_table_get_attr(longhaul_table, policy->cpu); - - return 0; + return cpufreq_table_validate_and_show(policy, longhaul_table); }
static int longhaul_cpu_exit(struct cpufreq_policy *policy)
Lets use cpufreq_table_validate_and_show() instead of calling cpufreq_frequency_table_cpuinfo() and cpufreq_frequency_table_get_attr().
Cc: John Crispin blogic@openwrt.org Signed-off-by: Viresh Kumar viresh.kumar@linaro.org --- drivers/cpufreq/loongson2_cpufreq.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/drivers/cpufreq/loongson2_cpufreq.c b/drivers/cpufreq/loongson2_cpufreq.c index 7bc3c44..5dd3692 100644 --- a/drivers/cpufreq/loongson2_cpufreq.c +++ b/drivers/cpufreq/loongson2_cpufreq.c @@ -133,10 +133,7 @@ static int loongson2_cpufreq_cpu_init(struct cpufreq_policy *policy)
policy->cur = loongson2_cpufreq_get(policy->cpu);
- cpufreq_frequency_table_get_attr(&loongson2_clockmod_table[0], - policy->cpu); - - return cpufreq_frequency_table_cpuinfo(policy, + return cpufreq_table_validate_and_show(policy, &loongson2_clockmod_table[0]); }
Lets use cpufreq_table_validate_and_show() instead of calling cpufreq_frequency_table_cpuinfo() and cpufreq_frequency_table_get_attr().
Cc: Dmitry Eremin-Solenikov dbaryshkov@gmail.com Signed-off-by: Viresh Kumar viresh.kumar@linaro.org --- drivers/cpufreq/maple-cpufreq.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/cpufreq/maple-cpufreq.c b/drivers/cpufreq/maple-cpufreq.c index 41c601f..19076cc 100644 --- a/drivers/cpufreq/maple-cpufreq.c +++ b/drivers/cpufreq/maple-cpufreq.c @@ -181,10 +181,8 @@ static int maple_cpufreq_cpu_init(struct cpufreq_policy *policy) * 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); - cpufreq_frequency_table_get_attr(maple_cpu_freqs, policy->cpu);
- return cpufreq_frequency_table_cpuinfo(policy, - maple_cpu_freqs); + return cpufreq_table_validate_and_show(policy, maple_cpu_freqs); }
Lets use cpufreq_table_validate_and_show() instead of calling cpufreq_frequency_table_cpuinfo() and cpufreq_frequency_table_get_attr().
Cc: Santosh Shilimkar santosh.shilimkar@ti.com Signed-off-by: Viresh Kumar viresh.kumar@linaro.org --- drivers/cpufreq/omap-cpufreq.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/cpufreq/omap-cpufreq.c b/drivers/cpufreq/omap-cpufreq.c index f31fcfc..b68ce4e 100644 --- a/drivers/cpufreq/omap-cpufreq.c +++ b/drivers/cpufreq/omap-cpufreq.c @@ -191,12 +191,10 @@ static int omap_cpu_init(struct cpufreq_policy *policy)
atomic_inc_return(&freq_table_users);
- result = cpufreq_frequency_table_cpuinfo(policy, freq_table); + result = cpufreq_table_validate_and_show(policy, freq_table); if (result) goto fail_table;
- cpufreq_frequency_table_get_attr(freq_table, policy->cpu); - policy->cur = omap_getspeed(policy->cpu);
/*
On Thursday 08 August 2013 09:48 AM, Viresh Kumar wrote:
Lets use cpufreq_table_validate_and_show() instead of calling cpufreq_frequency_table_cpuinfo() and cpufreq_frequency_table_get_attr().
Cc: Santosh Shilimkar santosh.shilimkar@ti.com Signed-off-by: Viresh Kumar viresh.kumar@linaro.org
Acked-by: Santosh Shilimkar santosh.shilimkar@ti.com
Lets use cpufreq_table_validate_and_show() instead of calling cpufreq_frequency_table_cpuinfo() and cpufreq_frequency_table_get_attr().
Cc: David S. Miller davem@davemloft.net Signed-off-by: Viresh Kumar viresh.kumar@linaro.org --- drivers/cpufreq/p4-clockmod.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/cpufreq/p4-clockmod.c b/drivers/cpufreq/p4-clockmod.c index 2f0a2a6..03478bf 100644 --- a/drivers/cpufreq/p4-clockmod.c +++ b/drivers/cpufreq/p4-clockmod.c @@ -230,7 +230,6 @@ static int cpufreq_p4_cpu_init(struct cpufreq_policy *policy) else p4clockmod_table[i].frequency = (stock_freq * i)/8; } - cpufreq_frequency_table_get_attr(p4clockmod_table, policy->cpu);
/* cpuinfo and default policy values */
@@ -239,7 +238,7 @@ static int cpufreq_p4_cpu_init(struct cpufreq_policy *policy) policy->cpuinfo.transition_latency = 10000001; policy->cur = stock_freq;
- return cpufreq_frequency_table_cpuinfo(policy, &p4clockmod_table[0]); + return cpufreq_table_validate_and_show(policy, &p4clockmod_table[0]); }
Lets use cpufreq_table_validate_and_show() instead of calling cpufreq_frequency_table_cpuinfo() and cpufreq_frequency_table_get_attr().
Signed-off-by: Viresh Kumar viresh.kumar@linaro.org --- drivers/cpufreq/pasemi-cpufreq.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/cpufreq/pasemi-cpufreq.c b/drivers/cpufreq/pasemi-cpufreq.c index 534e43a..23bc8a82 100644 --- a/drivers/cpufreq/pasemi-cpufreq.c +++ b/drivers/cpufreq/pasemi-cpufreq.c @@ -219,12 +219,10 @@ static int pas_cpufreq_cpu_init(struct cpufreq_policy *policy)
ppc_proc_freq = policy->cur * 1000ul;
- cpufreq_frequency_table_get_attr(pas_freqs, policy->cpu); - /* this ensures that policy->cpuinfo_min and policy->cpuinfo_max * are set correctly */ - return cpufreq_frequency_table_cpuinfo(policy, pas_freqs); + return cpufreq_table_validate_and_show(policy, pas_freqs);
out_unmap_sdcpwr: iounmap(sdcpwr_mapbase);
Lets use cpufreq_table_validate_and_show() instead of calling cpufreq_frequency_table_cpuinfo() and cpufreq_frequency_table_get_attr().
Signed-off-by: Viresh Kumar viresh.kumar@linaro.org --- drivers/cpufreq/pmac32-cpufreq.c | 3 +-- drivers/cpufreq/pmac64-cpufreq.c | 4 +--- 2 files changed, 2 insertions(+), 5 deletions(-)
diff --git a/drivers/cpufreq/pmac32-cpufreq.c b/drivers/cpufreq/pmac32-cpufreq.c index 38cdc63..0b3efdb 100644 --- a/drivers/cpufreq/pmac32-cpufreq.c +++ b/drivers/cpufreq/pmac32-cpufreq.c @@ -407,8 +407,7 @@ static int pmac_cpufreq_cpu_init(struct cpufreq_policy *policy) policy->cpuinfo.transition_latency = transition_latency; policy->cur = cur_freq;
- cpufreq_frequency_table_get_attr(pmac_cpu_freqs, policy->cpu); - return cpufreq_frequency_table_cpuinfo(policy, pmac_cpu_freqs); + return cpufreq_table_validate_and_show(policy, pmac_cpu_freqs); }
static u32 read_gpio(struct device_node *np) diff --git a/drivers/cpufreq/pmac64-cpufreq.c b/drivers/cpufreq/pmac64-cpufreq.c index b6850d9..366be61 100644 --- a/drivers/cpufreq/pmac64-cpufreq.c +++ b/drivers/cpufreq/pmac64-cpufreq.c @@ -362,10 +362,8 @@ static int g5_cpufreq_cpu_init(struct cpufreq_policy *policy) * 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); - cpufreq_frequency_table_get_attr(g5_cpu_freqs, policy->cpu);
- return cpufreq_frequency_table_cpuinfo(policy, - g5_cpu_freqs); + return cpufreq_table_validate_and_show(policy, g5_cpu_freqs); }
Lets use cpufreq_table_validate_and_show() instead of calling cpufreq_frequency_table_cpuinfo() and cpufreq_frequency_table_get_attr().
Signed-off-by: Viresh Kumar viresh.kumar@linaro.org --- drivers/cpufreq/powernow-k6.c | 9 +-------- drivers/cpufreq/powernow-k7.c | 4 +--- drivers/cpufreq/powernow-k8.c | 4 +--- 3 files changed, 3 insertions(+), 14 deletions(-)
diff --git a/drivers/cpufreq/powernow-k6.c b/drivers/cpufreq/powernow-k6.c index 85f1c8c..ab1de0d 100644 --- a/drivers/cpufreq/powernow-k6.c +++ b/drivers/cpufreq/powernow-k6.c @@ -145,7 +145,6 @@ static int powernow_k6_target(struct cpufreq_policy *policy, static int powernow_k6_cpu_init(struct cpufreq_policy *policy) { unsigned int i, f; - int result;
if (policy->cpu != 0) return -ENODEV; @@ -167,13 +166,7 @@ static int powernow_k6_cpu_init(struct cpufreq_policy *policy) policy->cpuinfo.transition_latency = 200000; policy->cur = busfreq * max_multiplier;
- result = cpufreq_frequency_table_cpuinfo(policy, clock_ratio); - if (result) - return result; - - cpufreq_frequency_table_get_attr(clock_ratio, policy->cpu); - - return 0; + return cpufreq_table_validate_and_show(policy, clock_ratio); }
diff --git a/drivers/cpufreq/powernow-k7.c b/drivers/cpufreq/powernow-k7.c index 14ce480..c863c13 100644 --- a/drivers/cpufreq/powernow-k7.c +++ b/drivers/cpufreq/powernow-k7.c @@ -680,9 +680,7 @@ static int powernow_cpu_init(struct cpufreq_policy *policy)
policy->cur = powernow_get(0);
- cpufreq_frequency_table_get_attr(powernow_table, policy->cpu); - - return cpufreq_frequency_table_cpuinfo(policy, powernow_table); + return cpufreq_table_validate_and_show(policy, powernow_table); }
static int powernow_cpu_exit(struct cpufreq_policy *policy) diff --git a/drivers/cpufreq/powernow-k8.c b/drivers/cpufreq/powernow-k8.c index 2344a9e..8d4114a 100644 --- a/drivers/cpufreq/powernow-k8.c +++ b/drivers/cpufreq/powernow-k8.c @@ -1156,7 +1156,7 @@ static int powernowk8_cpu_init(struct cpufreq_policy *pol) pr_debug("policy current frequency %d kHz\n", pol->cur);
/* min/max the cpu is capable of */ - if (cpufreq_frequency_table_cpuinfo(pol, data->powernow_table)) { + if (cpufreq_table_validate_and_show(pol, data->powernow_table)) { printk(KERN_ERR FW_BUG PFX "invalid powernow_table\n"); powernow_k8_cpu_exit_acpi(data); kfree(data->powernow_table); @@ -1164,8 +1164,6 @@ static int powernowk8_cpu_init(struct cpufreq_policy *pol) return -EINVAL; }
- cpufreq_frequency_table_get_attr(data->powernow_table, pol->cpu); - pr_debug("cpu_init done, current fid 0x%x, vid 0x%x\n", data->currfid, data->currvid);
Lets use cpufreq_table_validate_and_show() instead of calling cpufreq_frequency_table_cpuinfo() and cpufreq_frequency_table_get_attr().
Signed-off-by: Viresh Kumar viresh.kumar@linaro.org --- drivers/cpufreq/ppc-corenet-cpufreq.c | 3 +-- drivers/cpufreq/ppc_cbe_cpufreq.c | 4 +--- 2 files changed, 2 insertions(+), 5 deletions(-)
diff --git a/drivers/cpufreq/ppc-corenet-cpufreq.c b/drivers/cpufreq/ppc-corenet-cpufreq.c index 60e81d5..5716b44 100644 --- a/drivers/cpufreq/ppc-corenet-cpufreq.c +++ b/drivers/cpufreq/ppc-corenet-cpufreq.c @@ -202,7 +202,7 @@ static int corenet_cpufreq_cpu_init(struct cpufreq_policy *policy) table[i].frequency = CPUFREQ_TABLE_END;
/* set the min and max frequency properly */ - ret = cpufreq_frequency_table_cpuinfo(policy, table); + ret = cpufreq_table_validate_and_show(policy, table); if (ret) { pr_err("invalid frequency table: %d\n", ret); goto err_nomem1; @@ -219,7 +219,6 @@ static int corenet_cpufreq_cpu_init(struct cpufreq_policy *policy) policy->cpuinfo.transition_latency = CPUFREQ_ETERNAL; policy->cur = corenet_cpufreq_get_speed(policy->cpu);
- cpufreq_frequency_table_get_attr(table, cpu); of_node_put(np);
return 0; diff --git a/drivers/cpufreq/ppc_cbe_cpufreq.c b/drivers/cpufreq/ppc_cbe_cpufreq.c index 2e448f0..6c5be63 100644 --- a/drivers/cpufreq/ppc_cbe_cpufreq.c +++ b/drivers/cpufreq/ppc_cbe_cpufreq.c @@ -123,11 +123,9 @@ static int cbe_cpufreq_cpu_init(struct cpufreq_policy *policy) cpumask_copy(policy->cpus, cpu_sibling_mask(policy->cpu)); #endif
- cpufreq_frequency_table_get_attr(cbe_freqs, policy->cpu); - /* this ensures that policy->cpuinfo_min * and policy->cpuinfo_max are set correctly */ - return cpufreq_frequency_table_cpuinfo(policy, cbe_freqs); + return cpufreq_table_validate_and_show(policy, cbe_freqs); }
static int cbe_cpufreq_cpu_exit(struct cpufreq_policy *policy)
Lets use cpufreq_table_validate_and_show() instead of calling cpufreq_frequency_table_cpuinfo() and cpufreq_frequency_table_get_attr().
Cc: Eric Miao eric.y.miao@gmail.com Signed-off-by: Viresh Kumar viresh.kumar@linaro.org --- drivers/cpufreq/pxa2xx-cpufreq.c | 6 ++---- drivers/cpufreq/pxa3xx-cpufreq.c | 8 ++------ 2 files changed, 4 insertions(+), 10 deletions(-)
diff --git a/drivers/cpufreq/pxa2xx-cpufreq.c b/drivers/cpufreq/pxa2xx-cpufreq.c index c7ea005..a429d7c 100644 --- a/drivers/cpufreq/pxa2xx-cpufreq.c +++ b/drivers/cpufreq/pxa2xx-cpufreq.c @@ -454,12 +454,10 @@ static int pxa_cpufreq_init(struct cpufreq_policy *policy) pr_info("PXA255 cpufreq using %s frequency table\n", pxa255_turbo_table ? "turbo" : "run");
- cpufreq_frequency_table_cpuinfo(policy, pxa255_freq_table); - cpufreq_frequency_table_get_attr(pxa255_freq_table, policy->cpu); + cpufreq_table_validate_and_show(policy, pxa255_freq_table); } else if (cpu_is_pxa27x()) { - cpufreq_frequency_table_cpuinfo(policy, pxa27x_freq_table); - cpufreq_frequency_table_get_attr(pxa27x_freq_table, policy->cpu); + cpufreq_table_validate_and_show(policy, pxa27x_freq_table); }
printk(KERN_INFO "PXA CPU frequency change support initialized\n"); diff --git a/drivers/cpufreq/pxa3xx-cpufreq.c b/drivers/cpufreq/pxa3xx-cpufreq.c index f53f28d6..89841f5 100644 --- a/drivers/cpufreq/pxa3xx-cpufreq.c +++ b/drivers/cpufreq/pxa3xx-cpufreq.c @@ -91,7 +91,7 @@ static int setup_freqs_table(struct cpufreq_policy *policy, struct pxa3xx_freq_info *freqs, int num) { struct cpufreq_frequency_table *table; - int i, ret; + int i;
table = kzalloc((num + 1) * sizeof(*table), GFP_KERNEL); if (table == NULL) @@ -108,11 +108,7 @@ static int setup_freqs_table(struct cpufreq_policy *policy, pxa3xx_freqs_num = num; pxa3xx_freqs_table = table;
- ret = cpufreq_frequency_table_cpuinfo(policy, table); - if (!ret) - cpufreq_frequency_table_get_attr(table, policy->cpu); - - return ret; + return cpufreq_table_validate_and_show(policy, table); }
static void __update_core_freq(struct pxa3xx_freq_info *info)
Lets use cpufreq_table_validate_and_show() instead of calling cpufreq_frequency_table_cpuinfo() and cpufreq_frequency_table_get_attr().
Cc: Kukjin Kim kgene.kim@samsung.com Signed-off-by: Viresh Kumar viresh.kumar@linaro.org --- drivers/cpufreq/s3c2416-cpufreq.c | 4 +--- drivers/cpufreq/s3c24xx-cpufreq.c | 6 ++---- drivers/cpufreq/s3c64xx-cpufreq.c | 5 +---- 3 files changed, 4 insertions(+), 11 deletions(-)
diff --git a/drivers/cpufreq/s3c2416-cpufreq.c b/drivers/cpufreq/s3c2416-cpufreq.c index 22dcb81..a7a4c61 100644 --- a/drivers/cpufreq/s3c2416-cpufreq.c +++ b/drivers/cpufreq/s3c2416-cpufreq.c @@ -494,12 +494,10 @@ static int __init s3c2416_cpufreq_driver_init(struct cpufreq_policy *policy) policy->cpuinfo.transition_latency = (500 * 1000) + s3c_freq->regulator_latency;
- ret = cpufreq_frequency_table_cpuinfo(policy, s3c_freq->freq_table); + ret = cpufreq_table_validate_and_show(policy, s3c_freq->freq_table); if (ret) goto err_freq_table;
- cpufreq_frequency_table_get_attr(s3c_freq->freq_table, 0); - register_reboot_notifier(&s3c2416_cpufreq_reboot_notifier);
return 0; diff --git a/drivers/cpufreq/s3c24xx-cpufreq.c b/drivers/cpufreq/s3c24xx-cpufreq.c index 8843454..39c1d3e 100644 --- a/drivers/cpufreq/s3c24xx-cpufreq.c +++ b/drivers/cpufreq/s3c24xx-cpufreq.c @@ -386,10 +386,8 @@ static int s3c_cpufreq_init(struct cpufreq_policy *policy) /* feed the latency information from the cpu driver */ policy->cpuinfo.transition_latency = cpu_cur.info->latency;
- if (ftab) { - cpufreq_frequency_table_cpuinfo(policy, ftab); - cpufreq_frequency_table_get_attr(ftab, policy->cpu); - } + if (ftab) + return cpufreq_table_validate_and_show(policy, ftab);
return 0; } diff --git a/drivers/cpufreq/s3c64xx-cpufreq.c b/drivers/cpufreq/s3c64xx-cpufreq.c index 9024043..872f74d 100644 --- a/drivers/cpufreq/s3c64xx-cpufreq.c +++ b/drivers/cpufreq/s3c64xx-cpufreq.c @@ -251,15 +251,12 @@ static int s3c64xx_cpufreq_driver_init(struct cpufreq_policy *policy) */ policy->cpuinfo.transition_latency = (500 * 1000) + regulator_latency;
- ret = cpufreq_frequency_table_cpuinfo(policy, s3c64xx_freq_table); + ret = cpufreq_table_validate_and_show(policy, s3c64xx_freq_table); if (ret != 0) { pr_err("Failed to configure frequency table: %d\n", ret); regulator_put(vddarm); clk_put(armclk); - } else { - cpufreq_frequency_table_get_attr(s3c64xx_freq_table, - policy->cpu); }
return ret;
Lets use cpufreq_table_validate_and_show() instead of calling cpufreq_frequency_table_cpuinfo() and cpufreq_frequency_table_get_attr().
Cc: Kukjin Kim kgene.kim@samsung.com Signed-off-by: Viresh Kumar viresh.kumar@linaro.org --- drivers/cpufreq/s5pv210-cpufreq.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/cpufreq/s5pv210-cpufreq.c b/drivers/cpufreq/s5pv210-cpufreq.c index 5c77570..c266a7e 100644 --- a/drivers/cpufreq/s5pv210-cpufreq.c +++ b/drivers/cpufreq/s5pv210-cpufreq.c @@ -553,11 +553,9 @@ static int __init s5pv210_cpu_init(struct cpufreq_policy *policy)
policy->cur = policy->min = policy->max = s5pv210_getspeed(0);
- cpufreq_frequency_table_get_attr(s5pv210_freq_table, policy->cpu); - policy->cpuinfo.transition_latency = 40000;
- return cpufreq_frequency_table_cpuinfo(policy, s5pv210_freq_table); + return cpufreq_table_validate_and_show(policy, s5pv210_freq_table);
out_dmc1: clk_put(dmc0_clk);
Lets use cpufreq_table_validate_and_show() instead of calling cpufreq_frequency_table_cpuinfo() and cpufreq_frequency_table_get_attr().
Signed-off-by: Viresh Kumar viresh.kumar@linaro.org --- drivers/cpufreq/sc520_freq.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-)
diff --git a/drivers/cpufreq/sc520_freq.c b/drivers/cpufreq/sc520_freq.c index d6f6c6f..bb9c0de 100644 --- a/drivers/cpufreq/sc520_freq.c +++ b/drivers/cpufreq/sc520_freq.c @@ -106,7 +106,6 @@ static int sc520_freq_target(struct cpufreq_policy *policy, static int sc520_freq_cpu_init(struct cpufreq_policy *policy) { struct cpuinfo_x86 *c = &cpu_data(0); - int result;
/* capability check */ if (c->x86_vendor != X86_VENDOR_AMD || @@ -117,13 +116,7 @@ static int sc520_freq_cpu_init(struct cpufreq_policy *policy) policy->cpuinfo.transition_latency = 1000000; /* 1ms */ policy->cur = sc520_freq_get_cpu_frequency(0);
- result = cpufreq_frequency_table_cpuinfo(policy, sc520_freq_table); - if (result) - return result; - - cpufreq_frequency_table_get_attr(sc520_freq_table, policy->cpu); - - return 0; + return cpufreq_table_validate_and_show(policy, sc520_freq_table); }
Lets use cpufreq_table_validate_and_show() instead of calling cpufreq_frequency_table_cpuinfo() and cpufreq_frequency_table_get_attr().
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 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/cpufreq/sh-cpufreq.c b/drivers/cpufreq/sh-cpufreq.c index ffc6d24..1362e88 100644 --- a/drivers/cpufreq/sh-cpufreq.c +++ b/drivers/cpufreq/sh-cpufreq.c @@ -120,9 +120,9 @@ static int sh_cpufreq_cpu_init(struct cpufreq_policy *policy) if (freq_table) { int result;
- result = cpufreq_frequency_table_cpuinfo(policy, freq_table); - if (!result) - cpufreq_frequency_table_get_attr(freq_table, cpu); + result = cpufreq_table_validate_and_show(policy, freq_table); + if (result) + return result; } else { dev_notice(dev, "no frequency table found, falling back " "to rate rounding.\n");
Lets use cpufreq_table_validate_and_show() instead of calling cpufreq_frequency_table_cpuinfo() and cpufreq_frequency_table_get_attr().
Cc: David S. Miller davem@davemloft.net Cc: sparclinux@vger.kernel.org Signed-off-by: Viresh Kumar viresh.kumar@linaro.org --- drivers/cpufreq/sparc-us2e-cpufreq.c | 6 +----- drivers/cpufreq/sparc-us3-cpufreq.c | 7 +------ 2 files changed, 2 insertions(+), 11 deletions(-)
diff --git a/drivers/cpufreq/sparc-us2e-cpufreq.c b/drivers/cpufreq/sparc-us2e-cpufreq.c index 80e6d92..e35840d 100644 --- a/drivers/cpufreq/sparc-us2e-cpufreq.c +++ b/drivers/cpufreq/sparc-us2e-cpufreq.c @@ -307,7 +307,6 @@ static int __init us2e_freq_cpu_init(struct cpufreq_policy *policy) unsigned long clock_tick = sparc64_get_clock_tick(cpu) / 1000; struct cpufreq_frequency_table *table = &us2e_freq_table[cpu].table[0]; - int ret;
table[0].driver_data = 0; table[0].frequency = clock_tick / 1; @@ -325,10 +324,7 @@ static int __init us2e_freq_cpu_init(struct cpufreq_policy *policy) policy->cpuinfo.transition_latency = 0; policy->cur = clock_tick;
- ret = cpufreq_frequency_table_cpuinfo(policy, table); - if (!ret) - cpufreq_frequency_table_get_attr(table, policy->cpu); - return ret; + return cpufreq_table_validate_and_show(policy, table); }
static int us2e_freq_cpu_exit(struct cpufreq_policy *policy) diff --git a/drivers/cpufreq/sparc-us3-cpufreq.c b/drivers/cpufreq/sparc-us3-cpufreq.c index 73a90de..23f2d3b 100644 --- a/drivers/cpufreq/sparc-us3-cpufreq.c +++ b/drivers/cpufreq/sparc-us3-cpufreq.c @@ -168,7 +168,6 @@ static int __init us3_freq_cpu_init(struct cpufreq_policy *policy) unsigned long clock_tick = sparc64_get_clock_tick(cpu) / 1000; struct cpufreq_frequency_table *table = &us3_freq_table[cpu].table[0]; - int ret;
table[0].driver_data = 0; table[0].frequency = clock_tick / 1; @@ -182,11 +181,7 @@ static int __init us3_freq_cpu_init(struct cpufreq_policy *policy) policy->cpuinfo.transition_latency = 0; policy->cur = clock_tick;
- ret = cpufreq_frequency_table_cpuinfo(policy, table); - if (!ret) - cpufreq_frequency_table_get_attr(table, policy->cpu); - - return ret; + return cpufreq_table_validate_and_show(policy, table); }
static int us3_freq_cpu_exit(struct cpufreq_policy *policy)
Lets use cpufreq_table_validate_and_show() instead of calling cpufreq_frequency_table_cpuinfo() and cpufreq_frequency_table_get_attr().
Cc: spear-devel@list.st.com Signed-off-by: Viresh Kumar viresh.kumar@linaro.org --- drivers/cpufreq/spear-cpufreq.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/cpufreq/spear-cpufreq.c b/drivers/cpufreq/spear-cpufreq.c index c3efa7f..1d619dd 100644 --- a/drivers/cpufreq/spear-cpufreq.c +++ b/drivers/cpufreq/spear-cpufreq.c @@ -178,13 +178,12 @@ static int spear_cpufreq_init(struct cpufreq_policy *policy) { int ret;
- ret = cpufreq_frequency_table_cpuinfo(policy, spear_cpufreq.freq_tbl); + ret = cpufreq_table_validate_and_show(policy, spear_cpufreq.freq_tbl); if (ret) { - pr_err("cpufreq_frequency_table_cpuinfo() failed"); + pr_err("cpufreq_table_validate_and_show() failed"); return ret; }
- cpufreq_frequency_table_get_attr(spear_cpufreq.freq_tbl, policy->cpu); policy->cpuinfo.transition_latency = spear_cpufreq.transition_latency; policy->cur = spear_cpufreq_get(0);
Lets use cpufreq_table_validate_and_show() instead of calling cpufreq_frequency_table_cpuinfo() and cpufreq_frequency_table_get_attr().
Cc: David S. Miller davem@davemloft.net Signed-off-by: Viresh Kumar viresh.kumar@linaro.org --- drivers/cpufreq/speedstep-centrino.c | 10 +--------- drivers/cpufreq/speedstep-ich.c | 9 +-------- drivers/cpufreq/speedstep-smi.c | 8 +------- 3 files changed, 3 insertions(+), 24 deletions(-)
diff --git a/drivers/cpufreq/speedstep-centrino.c b/drivers/cpufreq/speedstep-centrino.c index f897d51..f180561 100644 --- a/drivers/cpufreq/speedstep-centrino.c +++ b/drivers/cpufreq/speedstep-centrino.c @@ -345,7 +345,6 @@ static int centrino_cpu_init(struct cpufreq_policy *policy) struct cpuinfo_x86 *cpu = &cpu_data(policy->cpu); unsigned freq; unsigned l, h; - int ret; int i;
/* Only Intel makes Enhanced Speedstep-capable CPUs */ @@ -402,15 +401,8 @@ static int centrino_cpu_init(struct cpufreq_policy *policy)
pr_debug("centrino_cpu_init: cur=%dkHz\n", policy->cur);
- ret = cpufreq_frequency_table_cpuinfo(policy, + return cpufreq_table_validate_and_show(policy, per_cpu(centrino_model, policy->cpu)->op_points); - if (ret) - return (ret); - - cpufreq_frequency_table_get_attr( - per_cpu(centrino_model, policy->cpu)->op_points, policy->cpu); - - return 0; }
static int centrino_cpu_exit(struct cpufreq_policy *policy) diff --git a/drivers/cpufreq/speedstep-ich.c b/drivers/cpufreq/speedstep-ich.c index 5355abb..86a184e 100644 --- a/drivers/cpufreq/speedstep-ich.c +++ b/drivers/cpufreq/speedstep-ich.c @@ -320,7 +320,6 @@ static void get_freqs_on_cpu(void *_get_freqs)
static int speedstep_cpu_init(struct cpufreq_policy *policy) { - int result; unsigned int policy_cpu, speed; struct get_freqs gf;
@@ -349,13 +348,7 @@ static int speedstep_cpu_init(struct cpufreq_policy *policy) /* cpuinfo and default policy values */ policy->cur = speed;
- result = cpufreq_frequency_table_cpuinfo(policy, speedstep_freqs); - if (result) - return result; - - cpufreq_frequency_table_get_attr(speedstep_freqs, policy->cpu); - - return 0; + return cpufreq_table_validate_and_show(policy, speedstep_freqs); }
diff --git a/drivers/cpufreq/speedstep-smi.c b/drivers/cpufreq/speedstep-smi.c index abfba4f..f4d0318 100644 --- a/drivers/cpufreq/speedstep-smi.c +++ b/drivers/cpufreq/speedstep-smi.c @@ -329,13 +329,7 @@ static int speedstep_cpu_init(struct cpufreq_policy *policy) policy->cpuinfo.transition_latency = CPUFREQ_ETERNAL; policy->cur = speed;
- result = cpufreq_frequency_table_cpuinfo(policy, speedstep_freqs); - if (result) - return result; - - cpufreq_frequency_table_get_attr(speedstep_freqs, policy->cpu); - - return 0; + return cpufreq_table_validate_and_show(policy, speedstep_freqs); }
static int speedstep_cpu_exit(struct cpufreq_policy *policy)
Lets use cpufreq_table_validate_and_show() instead of calling cpufreq_frequency_table_cpuinfo() and cpufreq_frequency_table_get_attr().
Cc: Stephen Warren swarren@nvidia.com Signed-off-by: Viresh Kumar viresh.kumar@linaro.org --- drivers/cpufreq/tegra-cpufreq.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/cpufreq/tegra-cpufreq.c b/drivers/cpufreq/tegra-cpufreq.c index cd66b85..b50d2c4 100644 --- a/drivers/cpufreq/tegra-cpufreq.c +++ b/drivers/cpufreq/tegra-cpufreq.c @@ -215,8 +215,7 @@ static int tegra_cpu_init(struct cpufreq_policy *policy) clk_prepare_enable(emc_clk); clk_prepare_enable(cpu_clk);
- cpufreq_frequency_table_cpuinfo(policy, freq_table); - cpufreq_frequency_table_get_attr(freq_table, policy->cpu); + cpufreq_table_validate_and_show(policy, freq_table); policy->cur = tegra_getspeed(policy->cpu); target_cpu_speed[policy->cpu] = policy->cur;
@@ -233,7 +232,6 @@ static int tegra_cpu_init(struct cpufreq_policy *policy)
static int tegra_cpu_exit(struct cpufreq_policy *policy) { - cpufreq_frequency_table_cpuinfo(policy, freq_table); clk_disable_unprepare(emc_clk); return 0; }
On 08/08/2013 07:48 AM, Viresh Kumar wrote:
Lets use cpufreq_table_validate_and_show() instead of calling cpufreq_frequency_table_cpuinfo() and cpufreq_frequency_table_get_attr().
Assuming the new function simply does what the two removed lines do, this looks fine to me.
static int tegra_cpu_exit(struct cpufreq_policy *policy) {
- cpufreq_frequency_table_cpuinfo(policy, freq_table);
This doesn't seem to be mentioned in the commit description. I assume this is simply dead/useless code removal?
On 8 August 2013 21:14, Stephen Warren swarren@wwwdotorg.org wrote:
On 08/08/2013 07:48 AM, Viresh Kumar wrote:
Lets use cpufreq_table_validate_and_show() instead of calling cpufreq_frequency_table_cpuinfo() and cpufreq_frequency_table_get_attr().
Assuming the new function simply does what the two removed lines do, this looks fine to me.
http://lkml.org/lkml/2013/8/8/266
static int tegra_cpu_exit(struct cpufreq_policy *policy) {
cpufreq_frequency_table_cpuinfo(policy, freq_table);
This doesn't seem to be mentioned in the commit description. I assume this is simply dead/useless code removal?
Its useless and the correct routine isn't called at all :) .. I will add that additional patch and send it to you and will get this change out of this commit.
On 8 August 2013 21:37, Viresh Kumar viresh.kumar@linaro.org wrote:
Its useless and the correct routine isn't called at all :) .. I will add that additional patch and send it to you and will get this change out of this commit.
The two commits look like this now attached too in case you want to test:
commit 9abdc9127b9f7f1e00c75694d15345843a60ff99 Author: Viresh Kumar viresh.kumar@linaro.org Date: Thu Aug 8 16:40:32 2013 +0530
cpufreq: tegra: use cpufreq_table_validate_and_show()
Lets use cpufreq_table_validate_and_show() instead of calling cpufreq_frequency_table_cpuinfo() and cpufreq_frequency_table_get_attr().
Cc: Stephen Warren swarren@nvidia.com Signed-off-by: Viresh Kumar viresh.kumar@linaro.org --- drivers/cpufreq/tegra-cpufreq.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/cpufreq/tegra-cpufreq.c b/drivers/cpufreq/tegra-cpufreq.c index cd66b85..51752b3 100644 --- a/drivers/cpufreq/tegra-cpufreq.c +++ b/drivers/cpufreq/tegra-cpufreq.c @@ -215,8 +215,7 @@ static int tegra_cpu_init(struct cpufreq_policy *policy) clk_prepare_enable(emc_clk); clk_prepare_enable(cpu_clk);
- cpufreq_frequency_table_cpuinfo(policy, freq_table); - cpufreq_frequency_table_get_attr(freq_table, policy->cpu); + cpufreq_table_validate_and_show(policy, freq_table); policy->cur = tegra_getspeed(policy->cpu); target_cpu_speed[policy->cpu] = policy->cur;
commit f1bb1cab6130501251eee616280b88c0b49d96d7 Author: Viresh Kumar viresh.kumar@linaro.org Date: Fri Aug 9 09:29:19 2013 +0530
cpufreq: tegra: fix implementation of ->exit()
->exit() of drivers should call cpufreq_frequency_table_put_attr() if they have called cpufreq_frequency_table_get_attr() earlier in init() and they aren't required to validate their cpufreq table in exit by calling cpufreq_frequency_table_cpuinfo(). Tegra's driver wasn't calling cpufreq_frequency_table_put_attr() and was calling cpufreq_frequency_table_cpuinfo() in exit.
Fix both these issues in it.
Signed-off-by: Viresh Kumar viresh.kumar@linaro.org --- drivers/cpufreq/tegra-cpufreq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/cpufreq/tegra-cpufreq.c b/drivers/cpufreq/tegra-cpufreq.c index 51752b3..faf1ce5 100644 --- a/drivers/cpufreq/tegra-cpufreq.c +++ b/drivers/cpufreq/tegra-cpufreq.c @@ -232,7 +232,7 @@ static int tegra_cpu_init(struct cpufreq_policy *policy)
static int tegra_cpu_exit(struct cpufreq_policy *policy) { - cpufreq_frequency_table_cpuinfo(policy, freq_table); + cpufreq_frequency_table_put_attr(policy->cpu); clk_disable_unprepare(emc_clk); return 0; }
On 08/08/2013 10:04 PM, Viresh Kumar wrote:
On 8 August 2013 21:37, Viresh Kumar viresh.kumar@linaro.org wrote:
Its useless and the correct routine isn't called at all :) .. I will add that additional patch and send it to you and will get this change out of this commit.
The two commits look like this now attached too in case you want to test:
I'd be happy to test, but those changes cause build failures on top of next-20130809. Which other patches do I need to apply first?
On 9 August 2013 21:49, Stephen Warren swarren@wwwdotorg.org wrote:
On 08/08/2013 10:04 PM, Viresh Kumar wrote:
On 8 August 2013 21:37, Viresh Kumar viresh.kumar@linaro.org wrote:
Its useless and the correct routine isn't called at all :) .. I will add that additional patch and send it to you and will get this change out of this commit.
The two commits look like this now attached too in case you want to test:
I'd be happy to test, but those changes cause build failures on top of next-20130809. Which other patches do I need to apply first?
None.. You applied all three attached patches? I have given it a try on my side now and it worked without any issues..
Just pushed out a branch for you as well:
https://git.linaro.org/gitweb?p=people/vireshk/linux.git%3Ba=shortlog%3Bh=re...
On 08/09/2013 11:09 AM, Viresh Kumar wrote:
On 9 August 2013 21:49, Stephen Warren swarren@wwwdotorg.org wrote:
On 08/08/2013 10:04 PM, Viresh Kumar wrote:
On 8 August 2013 21:37, Viresh Kumar viresh.kumar@linaro.org wrote:
Its useless and the correct routine isn't called at all :) .. I will add that additional patch and send it to you and will get this change out of this commit.
The two commits look like this now attached too in case you want to test:
I'd be happy to test, but those changes cause build failures on top of next-20130809. Which other patches do I need to apply first?
None.. You applied all three attached patches? I have given it a try on my side now and it worked without any issues..
Just pushed out a branch for you as well:
https://git.linaro.org/gitweb?p=people/vireshk/linux.git%3Ba=shortlog%3Bh=re...
Well, I don't see any issues running this, although the cpufreq sysfs files seem to have disappeared on Tegra, even without your changes, so I'm not sure how to really verify cpufreq.
Did the sysfs files go away, or do I need to investigate why/when the disappeared?
On 10 August 2013 03:38, Stephen Warren swarren@wwwdotorg.org wrote:
Well, I don't see any issues running this, although the cpufreq sysfs files seem to have disappeared on Tegra, even without your changes, so I'm not sure how to really verify cpufreq.
Did the sysfs files go away, or do I need to investigate why/when the disappeared?
It wasn't enabled by default in your defconfig... So enable it first with your menuconfig.
On 08/09/2013 08:53 PM, Viresh Kumar wrote:
On 10 August 2013 03:38, Stephen Warren swarren@wwwdotorg.org wrote:
Well, I don't see any issues running this, although the cpufreq sysfs files seem to have disappeared on Tegra, even without your changes, so I'm not sure how to really verify cpufreq.
Did the sysfs files go away, or do I need to investigate why/when the disappeared?
It wasn't enabled by default in your defconfig... So enable it first with your menuconfig.
It's in defconfig OK; I think the driver simply isn't initializing since some of the clocks it requests don't exist. I'll have our clock driver author look into it. In the meantime, I assume that your change is likely fine.
On 12 August 2013 22:03, Stephen Warren swarren@wwwdotorg.org wrote:
It's in defconfig OK; I think the driver simply isn't initializing since some of the clocks it requests don't exist. I'll have our clock driver author look into it. In the meantime, I assume that your change is likely fine.
I wasn't' talking about your driver but cpufreq_stats.. That is disabled by default with your defconfig.
On Thursday, August 08, 2013 07:18:02 PM Viresh Kumar wrote:
This is actually part of a bigger patchset which will change declaration of cpufreq_driver->target() to include index instead of target_freq and relation and hence cpufreq drivers wouldn't require to cpufreq_frequency_table_target() anymore.
Almost every cpufreq driver is required to validate its frequency table with: cpufreq_frequency_table_cpuinfo() and then expose it to cpufreq core with: cpufreq_frequency_table_get_attr().
This patch creates another helper routine cpufreq_table_validate_and_show() that will do both these steps in a single call and will return 0 for success, error otherwise.
This also fixes potential bugs in cpufreq drivers where people have called cpufreq_frequency_table_get_attr() before calling cpufreq_frequency_table_cpuinfo(), as the later may fail.
Viresh Kumar (35): cpufreq: Add new helper cpufreq_table_validate_and_show() cpufreq: pxa: call cpufreq_frequency_table_get_attr() cpufreq: s3cx4xx: call cpufreq_frequency_table_get_attr() cpufreq: sparc: call cpufreq_frequency_table_get_attr() cpufreq: acpi-cpufreq: use cpufreq_table_validate_and_show() cpufreq: arm_big_little: use cpufreq_table_validate_and_show() cpufreq: blackfin: use cpufreq_table_validate_and_show() cpufreq: cpufreq-cpu0: use cpufreq_table_validate_and_show() cpufreq: cris: use cpufreq_table_validate_and_show() cpufreq: davinci: use cpufreq_table_validate_and_show() cpufreq: dbx500: use cpufreq_table_validate_and_show() cpufreq: e_powersaver: use cpufreq_table_validate_and_show() cpufreq: elanfreq: use cpufreq_table_validate_and_show() cpufreq: exynos: use cpufreq_table_validate_and_show() cpufreq: ia64-acpi: use cpufreq_table_validate_and_show() cpufreq: imx6q: use cpufreq_table_validate_and_show() cpufreq: kirkwood: use cpufreq_table_validate_and_show() cpufreq: longhaul: use cpufreq_table_validate_and_show() cpufreq: loongson2: use cpufreq_table_validate_and_show() cpufreq: maple: use cpufreq_table_validate_and_show() cpufreq: omap: use cpufreq_table_validate_and_show() cpufreq: p4-clockmod: use cpufreq_table_validate_and_show() cpufreq: pasemi: use cpufreq_table_validate_and_show() cpufreq: pmac: use cpufreq_table_validate_and_show() cpufreq: powernow: use cpufreq_table_validate_and_show() cpufreq: ppc: use cpufreq_table_validate_and_show() cpufreq: pxa: use cpufreq_table_validate_and_show() cpufreq: s3cx4xx: use cpufreq_table_validate_and_show() cpufreq: s5pv210: use cpufreq_table_validate_and_show() cpufreq: sc520: use cpufreq_table_validate_and_show() cpufreq: sh: use cpufreq_table_validate_and_show() cpufreq: sparc: use cpufreq_table_validate_and_show() cpufreq: spear: use cpufreq_table_validate_and_show() cpufreq: speedstep: use cpufreq_table_validate_and_show() cpufreq: tegra: use cpufreq_table_validate_and_show()
drivers/cpufreq/acpi-cpufreq.c | 4 +--- drivers/cpufreq/arm_big_little.c | 4 +--- drivers/cpufreq/blackfin-cpufreq.c | 3 +-- drivers/cpufreq/cpufreq-cpu0.c | 4 +--- drivers/cpufreq/cris-artpec3-cpufreq.c | 10 +--------- drivers/cpufreq/cris-etraxfs-cpufreq.c | 10 +--------- drivers/cpufreq/davinci-cpufreq.c | 6 ++---- drivers/cpufreq/dbx500-cpufreq.c | 6 ++---- drivers/cpufreq/e_powersaver.c | 3 +-- drivers/cpufreq/elanfreq.c | 8 +------- drivers/cpufreq/exynos-cpufreq.c | 4 +--- drivers/cpufreq/exynos5440-cpufreq.c | 4 +--- drivers/cpufreq/freq_table.c | 12 ++++++++++++ drivers/cpufreq/ia64-acpi-cpufreq.c | 4 +--- drivers/cpufreq/imx6q-cpufreq.c | 3 +-- drivers/cpufreq/kirkwood-cpufreq.c | 10 +--------- drivers/cpufreq/longhaul.c | 8 +------- drivers/cpufreq/loongson2_cpufreq.c | 5 +---- drivers/cpufreq/maple-cpufreq.c | 4 +--- drivers/cpufreq/omap-cpufreq.c | 4 +--- drivers/cpufreq/p4-clockmod.c | 3 +-- drivers/cpufreq/pasemi-cpufreq.c | 4 +--- drivers/cpufreq/pmac32-cpufreq.c | 3 +-- drivers/cpufreq/pmac64-cpufreq.c | 4 +--- drivers/cpufreq/powernow-k6.c | 9 +-------- drivers/cpufreq/powernow-k7.c | 4 +--- drivers/cpufreq/powernow-k8.c | 4 +--- drivers/cpufreq/ppc-corenet-cpufreq.c | 3 +-- drivers/cpufreq/ppc_cbe_cpufreq.c | 4 +--- drivers/cpufreq/pxa2xx-cpufreq.c | 8 +++++--- drivers/cpufreq/pxa3xx-cpufreq.c | 2 +- drivers/cpufreq/s3c2416-cpufreq.c | 4 +--- drivers/cpufreq/s3c24xx-cpufreq.c | 2 +- drivers/cpufreq/s3c64xx-cpufreq.c | 2 +- drivers/cpufreq/s5pv210-cpufreq.c | 4 +--- drivers/cpufreq/sc520_freq.c | 9 +-------- drivers/cpufreq/sh-cpufreq.c | 6 +++--- drivers/cpufreq/sparc-us2e-cpufreq.c | 2 +- drivers/cpufreq/sparc-us3-cpufreq.c | 2 +- drivers/cpufreq/spear-cpufreq.c | 5 ++--- drivers/cpufreq/speedstep-centrino.c | 10 +--------- drivers/cpufreq/speedstep-ich.c | 9 +-------- drivers/cpufreq/speedstep-smi.c | 8 +------- drivers/cpufreq/tegra-cpufreq.c | 4 +--- include/linux/cpufreq.h | 2 ++ 45 files changed, 66 insertions(+), 167 deletions(-)
I'm not going to take this for 3.12, sorry. Please resend in the 3.12-rc1 / 3.12-rc2 time frame.
Thanks, Rafael
On 8 August 2013 19:30, Rafael J. Wysocki rjw@sisk.pl wrote:
I'm not going to take this for 3.12, sorry. Please resend in the 3.12-rc1 / 3.12-rc2 time frame.
Okay.. By that time I will accumulate all reviews/Acks for it and the next patchset that I will send.
On Thursday, August 08, 2013 07:23:36 PM Viresh Kumar wrote:
On 8 August 2013 19:30, Rafael J. Wysocki rjw@sisk.pl wrote:
I'm not going to take this for 3.12, sorry. Please resend in the 3.12-rc1 / 3.12-rc2 time frame.
Okay.. By that time I will accumulate all reviews/Acks for it and the next patchset that I will send.
OK
linaro-kernel@lists.linaro.org