msm: acpuclock-7x30: Prepare PLLs during init
The new clk_prepare()/clk_unprepare() APIs need to be called from
non-atomic context. Since acpuclock is used in such places as
suspend/resume which is always in atomic context we must prepare
the PLLs during init or risk the chance of enabling a PLL that
isn't prepared.
Change-Id: I3a191e1750e82b443a1028fe0befa68a09089fb4
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
diff --git a/arch/arm/mach-msm/acpuclock-7x30.c b/arch/arm/mach-msm/acpuclock-7x30.c
index 54d2aa9..29b0065 100644
--- a/arch/arm/mach-msm/acpuclock-7x30.c
+++ b/arch/arm/mach-msm/acpuclock-7x30.c
@@ -461,6 +461,14 @@
BUG_ON(IS_ERR(acpuclk_sources[PLL_2]));
acpuclk_sources[PLL_3] = clk_get_sys("acpu", "pll3_clk");
BUG_ON(IS_ERR(acpuclk_sources[PLL_3]));
+ /*
+ * Prepare all the PLLs because we enable/disable them
+ * from atomic context and can't always ensure they're
+ * all prepared in non-atomic context.
+ */
+ BUG_ON(clk_prepare(acpuclk_sources[PLL_1]));
+ BUG_ON(clk_prepare(acpuclk_sources[PLL_2]));
+ BUG_ON(clk_prepare(acpuclk_sources[PLL_3]));
}
static struct acpuclk_data acpuclk_7x30_data = {