summaryrefslogtreecommitdiff
path: root/drivers/cpufreq/imx6q-cpufreq.c
diff options
context:
space:
mode:
authorBai Ping <ping.bai@nxp.com>2016-07-29 15:25:26 +0800
committerJason Liu <jason.hui.liu@nxp.com>2019-02-12 10:24:51 +0800
commit096032cfc505fb2512db3a9015b686b07fd8349a (patch)
treec2c40cca6297b9911c14dac19d11c2b696585045 /drivers/cpufreq/imx6q-cpufreq.c
parenta1b844189baddd769e5de8979bd6634229fff6d8 (diff)
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 <ping.bai@nxp.com>
Diffstat (limited to 'drivers/cpufreq/imx6q-cpufreq.c')
-rw-r--r--drivers/cpufreq/imx6q-cpufreq.c12
1 files changed, 12 insertions, 0 deletions
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);