linux-clk.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] clk: imx: Fix imx8m_clk_hw_composite_core flags
@ 2020-01-13 23:42 Leonard Crestez
  2020-01-14  0:41 ` Peng Fan
  0 siblings, 1 reply; 2+ messages in thread
From: Leonard Crestez @ 2020-01-13 23:42 UTC (permalink / raw)
  To: Peng Fan, Shawn Guo, Abel Vesa
  Cc: Jacky Bai, Stephen Boyd, Anson Huang, Marco Felsch,
	Michael Turquette, Dong Aisheng, Fabio Estevam, linux-clk,
	kernel, linux-imx, linux-arm-kernel

Just like other imx8m composites the "core" slice needs the
CLK_SET_RATE_NO_REPARENT and CLK_OPS_PARENT_ENABLE flags. It is not
clear why they were omitted.

In particular without the CLK_OPS_PARENT_ENABLE flag the system can hang
when attempting to disable a clock whose parent is disabled. This
current happens for arm_m4_div on imx8mm-evk, breaking boot.

Fixes: 5fcdb45497a0 ("clk: imx: composite-8m: add imx8m_clk_hw_composite_core")

Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>

---
Since this is a very recent breakage (just next-20200113) the fix should
probably be squashed.

 drivers/clk/imx/clk.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/clk/imx/clk.h b/drivers/clk/imx/clk.h
index cd2a60c10a71..17a66a4290fb 100644
--- a/drivers/clk/imx/clk.h
+++ b/drivers/clk/imx/clk.h
@@ -487,11 +487,11 @@ struct clk_hw *imx8m_clk_hw_composite_flags(const char *name,
 					    unsigned long flags);
 
 #define imx8m_clk_hw_composite_core(name, parent_names, reg)	\
 	imx8m_clk_hw_composite_flags(name, parent_names, \
 			ARRAY_SIZE(parent_names), reg, \
-			IMX_COMPOSITE_CORE, 0)
+			IMX_COMPOSITE_CORE, CLK_SET_RATE_NO_REPARENT | CLK_OPS_PARENT_ENABLE)
 
 #define imx8m_clk_composite_flags(name, parent_names, num_parents, reg, \
 				  flags) \
 	to_clk(imx8m_clk_hw_composite_flags(name, parent_names, \
 				num_parents, reg, 0, flags))
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* RE: [PATCH] clk: imx: Fix imx8m_clk_hw_composite_core flags
  2020-01-13 23:42 [PATCH] clk: imx: Fix imx8m_clk_hw_composite_core flags Leonard Crestez
@ 2020-01-14  0:41 ` Peng Fan
  0 siblings, 0 replies; 2+ messages in thread
From: Peng Fan @ 2020-01-14  0:41 UTC (permalink / raw)
  To: Leonard Crestez, Shawn Guo, Abel Vesa
  Cc: Jacky Bai, Stephen Boyd, Anson Huang, Marco Felsch,
	Michael Turquette, Aisheng Dong, Fabio Estevam, linux-clk,
	kernel, dl-linux-imx, linux-arm-kernel


> Subject: [PATCH] clk: imx: Fix imx8m_clk_hw_composite_core flags
> 
> Just like other imx8m composites the "core" slice needs the
> CLK_SET_RATE_NO_REPARENT and CLK_OPS_PARENT_ENABLE flags. It is not
> clear why they were omitted.
> 
> In particular without the CLK_OPS_PARENT_ENABLE flag the system can hang
> when attempting to disable a clock whose parent is disabled. This current
> happens for arm_m4_div on imx8mm-evk, breaking boot.
> 
> Fixes: 5fcdb45497a0 ("clk: imx: composite-8m: add
> imx8m_clk_hw_composite_core")
> 
> Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>

My bad. Thanks for the fix.

Reviewed-by: Peng Fan <peng.fan@nxp.com>

> 
> ---
> Since this is a very recent breakage (just next-20200113) the fix should
> probably be squashed.
> 
>  drivers/clk/imx/clk.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/clk/imx/clk.h b/drivers/clk/imx/clk.h index
> cd2a60c10a71..17a66a4290fb 100644
> --- a/drivers/clk/imx/clk.h
> +++ b/drivers/clk/imx/clk.h
> @@ -487,11 +487,11 @@ struct clk_hw
> *imx8m_clk_hw_composite_flags(const char *name,
>  					    unsigned long flags);
> 
>  #define imx8m_clk_hw_composite_core(name, parent_names, reg)	\
>  	imx8m_clk_hw_composite_flags(name, parent_names, \
>  			ARRAY_SIZE(parent_names), reg, \
> -			IMX_COMPOSITE_CORE, 0)
> +			IMX_COMPOSITE_CORE, CLK_SET_RATE_NO_REPARENT |
> +CLK_OPS_PARENT_ENABLE)
> 
>  #define imx8m_clk_composite_flags(name, parent_names, num_parents,
> reg, \
>  				  flags) \
>  	to_clk(imx8m_clk_hw_composite_flags(name, parent_names, \
>  				num_parents, reg, 0, flags))
> --
> 2.17.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-01-14  0:41 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-13 23:42 [PATCH] clk: imx: Fix imx8m_clk_hw_composite_core flags Leonard Crestez
2020-01-14  0:41 ` Peng Fan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).