cpufreq: armada-37xx: fix frequency calculation for opp
authorGregory CLEMENT <gregory.clement@bootlin.com>
Fri, 8 Mar 2019 16:47:10 +0000 (17:47 +0100)
committerViresh Kumar <viresh.kumar@linaro.org>
Mon, 29 Apr 2019 09:52:50 +0000 (15:22 +0530)
commit8db82563451f976597ab7b282ec655e4390a4088
treef0a4fd8f06fabeefb68fa5f4471c8187cf38fce6
parentc1d1090c3c7674c965552e22a65b29423aa4f090
cpufreq: armada-37xx: fix frequency calculation for opp

The frequency calculation was based on the current(max) frequency of the
CPU. However for low frequency, the value used was already the parent
frequency divided by a factor of 2.

Instead of using this frequency, this fix directly get the frequency from
the parent clock.

Fixes: 92ce45fb875d ("cpufreq: Add DVFS support for Armada 37xx")
Cc: <stable@vger.kernel.org>
Reported-by: Christian Neubert <christian.neubert.86@gmail.com>
Signed-off-by: Gregory CLEMENT <gregory.clement@bootlin.com>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
drivers/cpufreq/armada-37xx-cpufreq.c