* [PATCH V3] ARM: imx: add always-on clock array for i.mx6sl to maintain correct usecount
@ 2014-01-22 7:14 Anson Huang
2014-01-28 11:59 ` Shawn Guo
0 siblings, 1 reply; 2+ messages in thread
From: Anson Huang @ 2014-01-22 7:14 UTC (permalink / raw)
To: linux-arm-kernel
IPG, ARM and MMDC's clock should be enabled during kernel boot up,
so we need to maintain their usecount, otherwise, they may be
disabled unexpectedly if their children's clock are turned off, and
caused their parent PLLs also get disabled, which is incorrect.
Signed-off-by: Anson Huang <b20788@freescale.com>
---
arch/arm/mach-imx/clk-imx6sl.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/arch/arm/mach-imx/clk-imx6sl.c b/arch/arm/mach-imx/clk-imx6sl.c
index 78f3bd6..04e9f1c 100644
--- a/arch/arm/mach-imx/clk-imx6sl.c
+++ b/arch/arm/mach-imx/clk-imx6sl.c
@@ -66,6 +66,10 @@ static struct clk_div_table video_div_table[] = {
static struct clk *clks[IMX6SL_CLK_END];
static struct clk_onecell_data clk_data;
+static const u32 clks_init_on[] __initconst = {
+ IMX6SL_CLK_IPG, IMX6SL_CLK_ARM, IMX6SL_CLK_MMDC_ROOT,
+};
+
/*
* ERR005311 CCM: After exit from WAIT mode, unwanted interrupt(s) taken
* during WAIT mode entry process could cause cache memory
@@ -291,6 +295,13 @@ static void __init imx6sl_clocks_init(struct device_node *ccm_node)
pr_warn("%s: failed to set AHB clock rate %d!\n",
__func__, ret);
+ /*
+ * Make sure those always on clocks are enabled to maintain the correct
+ * usecount and enabling/disabling of parent PLLs.
+ */
+ for (i = 0; i < ARRAY_SIZE(clks_init_on); i++)
+ clk_prepare_enable(clks[clks_init_on[i]]);
+
if (IS_ENABLED(CONFIG_USB_MXS_PHY)) {
clk_prepare_enable(clks[IMX6SL_CLK_USBPHY1_GATE]);
clk_prepare_enable(clks[IMX6SL_CLK_USBPHY2_GATE]);
--
1.7.9.5
^ permalink raw reply related [flat|nested] 2+ messages in thread* [PATCH V3] ARM: imx: add always-on clock array for i.mx6sl to maintain correct usecount
2014-01-22 7:14 [PATCH V3] ARM: imx: add always-on clock array for i.mx6sl to maintain correct usecount Anson Huang
@ 2014-01-28 11:59 ` Shawn Guo
0 siblings, 0 replies; 2+ messages in thread
From: Shawn Guo @ 2014-01-28 11:59 UTC (permalink / raw)
To: linux-arm-kernel
On Wed, Jan 22, 2014 at 03:14:47PM +0800, Anson Huang wrote:
> IPG, ARM and MMDC's clock should be enabled during kernel boot up,
> so we need to maintain their usecount, otherwise, they may be
> disabled unexpectedly if their children's clock are turned off, and
> caused their parent PLLs also get disabled, which is incorrect.
>
> Signed-off-by: Anson Huang <b20788@freescale.com>
Applied, thanks.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-01-28 11:59 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-22 7:14 [PATCH V3] ARM: imx: add always-on clock array for i.mx6sl to maintain correct usecount Anson Huang
2014-01-28 11:59 ` Shawn Guo
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox