From 096032cfc505fb2512db3a9015b686b07fd8349a Mon Sep 17 00:00:00 2001 From: Bai Ping Date: Fri, 29 Jul 2016 15:25:26 +0800 Subject: MLK-13014 ARM: imx: fix system hang when run cpufreq-info in low bus mode On i.MX6ULL, when the system entering the low bus mode, system will enter low power run mode in which the cpufreq is at 24MHz. If we run 'cpufreq-info' until, the cpu frequency will be change from 24MHz to 99MHz, this will lead to system enter low power idle wrong, and system will hang in low power idle. Add the ARM core clock handling code to fix this issue. Signed-off-by: Bai Ping --- drivers/cpufreq/imx6q-cpufreq.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'drivers/cpufreq') diff --git a/drivers/cpufreq/imx6q-cpufreq.c b/drivers/cpufreq/imx6q-cpufreq.c index c426928a0b39..906f965498ee 100644 --- a/drivers/cpufreq/imx6q-cpufreq.c +++ b/drivers/cpufreq/imx6q-cpufreq.c @@ -25,6 +25,8 @@ #define FREQ_1P2_GHZ 1200000000 #define FREQ_396_MHZ 396000 #define FREQ_696_MHZ 696000 +#define FREQ_99_MHZ 99000 +#define FREQ_24_MHZ 24000 static struct regulator *arm_reg; static struct regulator *pu_reg; @@ -65,6 +67,16 @@ static int imx6q_set_target(struct cpufreq_policy *policy, unsigned int index) freq_hz = new_freq * 1000; old_freq = policy->cur; + /* + * ON i.MX6ULL, the 24MHz setpoint is not seen by cpufreq + * so we neet to prevent the cpufreq change frequency + * from 24MHz to 99Mhz directly. busfreq will handle this + * when exit from low bus mode. + */ + if (old_freq == FREQ_24_MHZ && new_freq == FREQ_99_MHZ) { + return 0; + }; + opp = dev_pm_opp_find_freq_ceil(cpu_dev, &freq_hz); if (IS_ERR(opp)) { dev_err(cpu_dev, "failed to find OPP for %ld\n", freq_hz); -- cgit v1.2.3