Linux-Clk Archive on lore.kernel.org
 help / color / 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	[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, back to index

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

Linux-Clk Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-clk/0 linux-clk/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-clk linux-clk/ https://lore.kernel.org/linux-clk \
		linux-clk@vger.kernel.org
	public-inbox-index linux-clk

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-clk


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git