clk: imx8m: check mcore_booted before register clk
If mcore_booted is true, ignore the clk root gate registration and this will simplify AMP clock management and avoid system hang unexpectly especially Linux shutdown clk used by mcore. Signed-off-by: Peng Fan <peng.fan@nxp.com> Reviewed-by: Abel Vesa <abel.vesa@nxp.com> Link: https://lore.kernel.org/r/20220228124112.3974242-2-peng.fan@oss.nxp.com [abelvesa@kernel.org: Removed if-case for when mcore_booted is true] Signed-off-by: Abel Vesa <abel.vesa@nxp.com>
This commit is contained in:
parent
19565ea12d
commit
bb7e897b00
|
@ -178,7 +178,7 @@ struct clk_hw *__imx8m_clk_hw_composite(const char *name,
|
||||||
unsigned long flags)
|
unsigned long flags)
|
||||||
{
|
{
|
||||||
struct clk_hw *hw = ERR_PTR(-ENOMEM), *mux_hw;
|
struct clk_hw *hw = ERR_PTR(-ENOMEM), *mux_hw;
|
||||||
struct clk_hw *div_hw, *gate_hw;
|
struct clk_hw *div_hw, *gate_hw = NULL;
|
||||||
struct clk_divider *div = NULL;
|
struct clk_divider *div = NULL;
|
||||||
struct clk_gate *gate = NULL;
|
struct clk_gate *gate = NULL;
|
||||||
struct clk_mux *mux = NULL;
|
struct clk_mux *mux = NULL;
|
||||||
|
@ -223,6 +223,8 @@ struct clk_hw *__imx8m_clk_hw_composite(const char *name,
|
||||||
div->lock = &imx_ccm_lock;
|
div->lock = &imx_ccm_lock;
|
||||||
div->flags = CLK_DIVIDER_ROUND_CLOSEST;
|
div->flags = CLK_DIVIDER_ROUND_CLOSEST;
|
||||||
|
|
||||||
|
/* skip registering the gate ops if M4 is enabled */
|
||||||
|
if (!mcore_booted) {
|
||||||
gate = kzalloc(sizeof(*gate), GFP_KERNEL);
|
gate = kzalloc(sizeof(*gate), GFP_KERNEL);
|
||||||
if (!gate)
|
if (!gate)
|
||||||
goto fail;
|
goto fail;
|
||||||
|
@ -231,6 +233,7 @@ struct clk_hw *__imx8m_clk_hw_composite(const char *name,
|
||||||
gate->reg = reg;
|
gate->reg = reg;
|
||||||
gate->bit_idx = PCG_CGC_SHIFT;
|
gate->bit_idx = PCG_CGC_SHIFT;
|
||||||
gate->lock = &imx_ccm_lock;
|
gate->lock = &imx_ccm_lock;
|
||||||
|
}
|
||||||
|
|
||||||
hw = clk_hw_register_composite(NULL, name, parent_names, num_parents,
|
hw = clk_hw_register_composite(NULL, name, parent_names, num_parents,
|
||||||
mux_hw, mux_ops, div_hw,
|
mux_hw, mux_ops, div_hw,
|
||||||
|
|
Loading…
Reference in New Issue