mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-04 02:02:28 +09:00
cpufreq: loongson2: fix regression related to clock management
commitf54fe64d14upstream. Commit42913c799(MIPS: Loongson2: Use clk API instead of direct dereferences) broke the cpufreq functionality on Loongson2 boards: clk_set_rate() is called before the CPU frequency table is initialized, and therefore will always fail. Fix by moving the clk_set_rate() after the table initialization. Tested on Lemote FuLoong mini-PC. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Acked-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
060a7c36d7
commit
4b0be00599
@@ -118,11 +118,6 @@ static int loongson2_cpufreq_cpu_init(struct cpufreq_policy *policy)
|
||||
clk_put(cpuclk);
|
||||
return -EINVAL;
|
||||
}
|
||||
ret = clk_set_rate(cpuclk, rate);
|
||||
if (ret) {
|
||||
clk_put(cpuclk);
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* clock table init */
|
||||
for (i = 2;
|
||||
@@ -130,6 +125,12 @@ static int loongson2_cpufreq_cpu_init(struct cpufreq_policy *policy)
|
||||
i++)
|
||||
loongson2_clockmod_table[i].frequency = (rate * i) / 8;
|
||||
|
||||
ret = clk_set_rate(cpuclk, rate);
|
||||
if (ret) {
|
||||
clk_put(cpuclk);
|
||||
return ret;
|
||||
}
|
||||
|
||||
policy->cur = loongson2_cpufreq_get(policy->cpu);
|
||||
|
||||
cpufreq_frequency_table_get_attr(&loongson2_clockmod_table[0],
|
||||
|
||||
Reference in New Issue
Block a user