aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/cpufreq
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2013-08-26 07:48:36 -0400
committerViresh Kumar <viresh.kumar@linaro.org>2013-08-26 10:04:07 -0400
commitfae19b84724ff93c1ac59ce1eecc1411f8269d9e (patch)
treeec3d8cbd4006c2c45e2afb5725683efc69fc39a3 /drivers/cpufreq
parentb192b910f3832793082c1a18262c4da0efe121ae (diff)
cpufreq: imx6q: Fix clock enable balance
For changing the cpu frequency the i.MX6q has to be switched to some intermediate clock during the PLL reprogramming. The driver tries to be clever to keep the enable count correct but gets it wrong. If the cpufreq is increased it calls clk_disable_unprepare twice on pll2_pfd2_396m. This puts all other devices which get their clock from pll2_pfd2_396m into a nonworking state. Fix this by removing the clk enabling/disabling altogether since the clk core will do this automatically during a reparent. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Diffstat (limited to 'drivers/cpufreq')
-rw-r--r--drivers/cpufreq/imx6q-cpufreq.c17
1 files changed, 0 insertions, 17 deletions
diff --git a/drivers/cpufreq/imx6q-cpufreq.c b/drivers/cpufreq/imx6q-cpufreq.c
index e37cdaedbb5b..2971d12b28e8 100644
--- a/drivers/cpufreq/imx6q-cpufreq.c
+++ b/drivers/cpufreq/imx6q-cpufreq.c
@@ -117,28 +117,11 @@ static int imx6q_set_target(struct cpufreq_policy *policy,
117 * - Reprogram pll1_sys_clk and reparent pll1_sw_clk back to it 117 * - Reprogram pll1_sys_clk and reparent pll1_sw_clk back to it
118 * - Disable pll2_pfd2_396m_clk 118 * - Disable pll2_pfd2_396m_clk
119 */ 119 */
120 clk_prepare_enable(pll2_pfd2_396m_clk);
121 clk_set_parent(step_clk, pll2_pfd2_396m_clk); 120 clk_set_parent(step_clk, pll2_pfd2_396m_clk);
122 clk_set_parent(pll1_sw_clk, step_clk); 121 clk_set_parent(pll1_sw_clk, step_clk);
123 if (freq_hz > clk_get_rate(pll2_pfd2_396m_clk)) { 122 if (freq_hz > clk_get_rate(pll2_pfd2_396m_clk)) {
124 clk_set_rate(pll1_sys_clk, freqs.new * 1000); 123 clk_set_rate(pll1_sys_clk, freqs.new * 1000);
125 /*
126 * If we are leaving 396 MHz set-point, we need to enable
127 * pll1_sys_clk and disable pll2_pfd2_396m_clk to keep
128 * their use count correct.
129 */
130 if (freqs.old * 1000 <= clk_get_rate(pll2_pfd2_396m_clk)) {
131 clk_prepare_enable(pll1_sys_clk);
132 clk_disable_unprepare(pll2_pfd2_396m_clk);
133 }
134 clk_set_parent(pll1_sw_clk, pll1_sys_clk); 124 clk_set_parent(pll1_sw_clk, pll1_sys_clk);
135 clk_disable_unprepare(pll2_pfd2_396m_clk);
136 } else {
137 /*
138 * Disable pll1_sys_clk if pll2_pfd2_396m_clk is sufficient
139 * to provide the frequency.
140 */
141 clk_disable_unprepare(pll1_sys_clk);
142 } 125 }
143 126
144 /* Ensure the arm clock divider is what we expect */ 127 /* Ensure the arm clock divider is what we expect */