diff options
author | Aaro Koskinen <aaro.koskinen@iki.fi> | 2014-09-21 08:38:43 -0400 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2014-10-22 13:10:42 -0400 |
commit | aa08ed55442ac6f9810c055e1474be34e785e556 (patch) | |
tree | 81f592d7cb592b101a8400995d9e5e9de737ce31 /arch/mips/loongson | |
parent | 5a1e73ffe57a86a196c08dffcbd9866776594a38 (diff) |
MIPS: loongson2_cpufreq: Fix CPU clock rate setting mismerge
During 3.16 merge window, parts of the commit 8e8acb32960f
(MIPS/loongson2_cpufreq: Fix CPU clock rate setting) seem to have
been deleted probably due to a mismerge, and as a result cpufreq
is broken again on Loongson2 boards in 3.16 and newer kernels.
Fix by repeating the fix.
Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Cc: stable@vger.kernel.org # 3.16
Cc: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Cc: linux-mips@linux-mips.org
Cc: linux-kernel@vger.kernel.org
Patchwork: https://patchwork.linux-mips.org/patch/7835/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/loongson')
-rw-r--r-- | arch/mips/loongson/lemote-2f/clock.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/arch/mips/loongson/lemote-2f/clock.c b/arch/mips/loongson/lemote-2f/clock.c index a217061beee3..462e34d46b4a 100644 --- a/arch/mips/loongson/lemote-2f/clock.c +++ b/arch/mips/loongson/lemote-2f/clock.c | |||
@@ -91,6 +91,7 @@ EXPORT_SYMBOL(clk_put); | |||
91 | 91 | ||
92 | int clk_set_rate(struct clk *clk, unsigned long rate) | 92 | int clk_set_rate(struct clk *clk, unsigned long rate) |
93 | { | 93 | { |
94 | unsigned int rate_khz = rate / 1000; | ||
94 | struct cpufreq_frequency_table *pos; | 95 | struct cpufreq_frequency_table *pos; |
95 | int ret = 0; | 96 | int ret = 0; |
96 | int regval; | 97 | int regval; |
@@ -107,9 +108,9 @@ int clk_set_rate(struct clk *clk, unsigned long rate) | |||
107 | propagate_rate(clk); | 108 | propagate_rate(clk); |
108 | 109 | ||
109 | cpufreq_for_each_valid_entry(pos, loongson2_clockmod_table) | 110 | cpufreq_for_each_valid_entry(pos, loongson2_clockmod_table) |
110 | if (rate == pos->frequency) | 111 | if (rate_khz == pos->frequency) |
111 | break; | 112 | break; |
112 | if (rate != pos->frequency) | 113 | if (rate_khz != pos->frequency) |
113 | return -ENOTSUPP; | 114 | return -ENOTSUPP; |
114 | 115 | ||
115 | clk->rate = rate; | 116 | clk->rate = rate; |