From d37fe4a81c9c08265d4ead1e30ceb0d770557d44 Mon Sep 17 00:00:00 2001 From: Bai Ping Date: Fri, 31 Oct 2014 16:28:03 +0800 Subject: [PATCH] MLK-9777 cpufreq: imx6: fix the high bus count mismatch Normally, the system is booting up with higher cpufreq. In the cpufreq set_target_index we will release the high bus mode if the target cpu frequency is the lowest. It will release the high bus mode and dcrease the high_bus_count.This will lead to a wrong release of high bus mode. So, in the cpufreq_init function, if the original frequency is not the lowest, we need request high busfreq. Signed-off-by: Bai Ping (cherry picked from commit 7df8887a6ddac148d33cd583da31ec72d0ba07da) --- drivers/cpufreq/imx6q-cpufreq.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/drivers/cpufreq/imx6q-cpufreq.c b/drivers/cpufreq/imx6q-cpufreq.c index 4059228677ae..6955a0e77a42 100644 --- a/drivers/cpufreq/imx6q-cpufreq.c +++ b/drivers/cpufreq/imx6q-cpufreq.c @@ -178,8 +178,20 @@ static int imx6q_set_target(struct cpufreq_policy *policy, unsigned int index) static int imx6q_cpufreq_init(struct cpufreq_policy *policy) { + int ret; + policy->clk = arm_clk; - return cpufreq_generic_init(policy, freq_table, transition_latency); + policy->cur = clk_get_rate(arm_clk) / 1000; + + ret = cpufreq_generic_init(policy, freq_table, transition_latency); + if (ret) { + dev_err(cpu_dev, "imx6 cpufreq init failed!\n"); + return ret; + } + if (policy->cur > freq_table[0].frequency) + request_bus_freq(BUS_FREQ_HIGH); + + return 0; } static struct cpufreq_driver imx6q_cpufreq_driver = { -- 2.17.1