aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorViresh Kumar <viresh.kumar@linaro.org>2018-02-26 00:08:57 -0500
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2018-03-20 07:07:52 -0400
commite2376d1fa075238a93a4ca188e7cee0bea924975 (patch)
tree3e3e94a3f0ac79a344c89a264fc930bd20d61f42
parentb01b531f67a255df0d2c90fcda7c509ed55186a6 (diff)
cpufreq: powernow: Don't validate the frequency table twice
The cpufreq core is already validating the CPU frequency table after calling the ->init() callback of the cpufreq drivers and the drivers don't need to do the same anymore. Though they need to set the policy->freq_table field directly from the ->init() callback now. Stop validating the frequency table from powernow driver. Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
-rw-r--r--drivers/cpufreq/powernow-k6.c3
-rw-r--r--drivers/cpufreq/powernow-k7.c3
-rw-r--r--drivers/cpufreq/powernow-k8.c10
3 files changed, 5 insertions, 11 deletions
diff --git a/drivers/cpufreq/powernow-k6.c b/drivers/cpufreq/powernow-k6.c
index dedd2568e852..8a8ea68611a8 100644
--- a/drivers/cpufreq/powernow-k6.c
+++ b/drivers/cpufreq/powernow-k6.c
@@ -214,8 +214,9 @@ have_busfreq:
214 214
215 /* cpuinfo and default policy values */ 215 /* cpuinfo and default policy values */
216 policy->cpuinfo.transition_latency = 500000; 216 policy->cpuinfo.transition_latency = 500000;
217 policy->freq_table = clock_ratio;
217 218
218 return cpufreq_table_validate_and_show(policy, clock_ratio); 219 return 0;
219} 220}
220 221
221 222
diff --git a/drivers/cpufreq/powernow-k7.c b/drivers/cpufreq/powernow-k7.c
index 302e9ce793a0..d6cb052b0a75 100644
--- a/drivers/cpufreq/powernow-k7.c
+++ b/drivers/cpufreq/powernow-k7.c
@@ -639,8 +639,9 @@ static int powernow_cpu_init(struct cpufreq_policy *policy)
639 639
640 policy->cpuinfo.transition_latency = 640 policy->cpuinfo.transition_latency =
641 cpufreq_scale(2000000UL, fsb, latency); 641 cpufreq_scale(2000000UL, fsb, latency);
642 policy->freq_table = powernow_table;
642 643
643 return cpufreq_table_validate_and_show(policy, powernow_table); 644 return 0;
644} 645}
645 646
646static int powernow_cpu_exit(struct cpufreq_policy *policy) 647static int powernow_cpu_exit(struct cpufreq_policy *policy)
diff --git a/drivers/cpufreq/powernow-k8.c b/drivers/cpufreq/powernow-k8.c
index 782a8c2a359d..fb77b39a4ce3 100644
--- a/drivers/cpufreq/powernow-k8.c
+++ b/drivers/cpufreq/powernow-k8.c
@@ -1076,15 +1076,7 @@ static int powernowk8_cpu_init(struct cpufreq_policy *pol)
1076 1076
1077 cpumask_copy(pol->cpus, topology_core_cpumask(pol->cpu)); 1077 cpumask_copy(pol->cpus, topology_core_cpumask(pol->cpu));
1078 data->available_cores = pol->cpus; 1078 data->available_cores = pol->cpus;
1079 1079 pol->freq_table = data->powernow_table;
1080 /* min/max the cpu is capable of */
1081 if (cpufreq_table_validate_and_show(pol, data->powernow_table)) {
1082 pr_err(FW_BUG "invalid powernow_table\n");
1083 powernow_k8_cpu_exit_acpi(data);
1084 kfree(data->powernow_table);
1085 kfree(data);
1086 return -EINVAL;
1087 }
1088 1080
1089 pr_debug("cpu_init done, current fid 0x%x, vid 0x%x\n", 1081 pr_debug("cpu_init done, current fid 0x%x, vid 0x%x\n",
1090 data->currfid, data->currvid); 1082 data->currfid, data->currvid);