From: Abel Vesa <abel.vesa@nxp.com> To: "Peng Fan (OSS)" <peng.fan@oss.nxp.com> Cc: sboyd@kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Peng Fan <peng.fan@nxp.com> Subject: Re: [PATCH V2 2/2] clk: imx8m: check mcore_booted before register clk Date: Tue, 12 Apr 2022 11:14:03 +0300 [thread overview] Message-ID: <YlU0y9F2VGXsJDzU@abelvesa> (raw) In-Reply-To: <YlU0JRrInWbCiylZ@abelvesa> On 22-04-12 11:11:17, Abel Vesa wrote: > On 22-02-28 20:41:12, Peng Fan (OSS) wrote: > > From: Peng Fan <peng.fan@nxp.com> > > > > 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> > > --- > > > > V2: > > None > > > > drivers/clk/imx/clk-composite-8m.c | 21 +++++++++++++-------- > > 1 file changed, 13 insertions(+), 8 deletions(-) > > > > diff --git a/drivers/clk/imx/clk-composite-8m.c b/drivers/clk/imx/clk-composite-8m.c > > index 2dfd6149e528..b16c2c0ea9f6 100644 > > --- a/drivers/clk/imx/clk-composite-8m.c > > +++ b/drivers/clk/imx/clk-composite-8m.c > > @@ -223,14 +223,19 @@ struct clk_hw *__imx8m_clk_hw_composite(const char *name, > > div->lock = &imx_ccm_lock; > > div->flags = CLK_DIVIDER_ROUND_CLOSEST; > > > > - gate = kzalloc(sizeof(*gate), GFP_KERNEL); > > - if (!gate) > > - goto fail; > > - > > - gate_hw = &gate->hw; > > - gate->reg = reg; > > - gate->bit_idx = PCG_CGC_SHIFT; > > - gate->lock = &imx_ccm_lock; > > + /* skip registering the gate ops if M4 is enabled */ > > + if (mcore_booted) { > > + gate_hw = NULL; > > Lets have the gate_hw set to NULL when declared and get rid of this if > case. > On a second thought, no need to resend, I'll squash this in myself. > > + } else { > > And then lets do here: > > if (!mcore_booted) { > > + gate = kzalloc(sizeof(*gate), GFP_KERNEL); > > + if (!gate) > > + goto fail; > > + > > + gate_hw = &gate->hw; > > + gate->reg = reg; > > + gate->bit_idx = PCG_CGC_SHIFT; > > + gate->lock = &imx_ccm_lock; > > + } > > > > Would look a bit cleaner this way. > > With that done: > > Reviewed-by: Abel Vesa <abel.vesa@nxp.com> > > > hw = clk_hw_register_composite(NULL, name, parent_names, num_parents, > > mux_hw, mux_ops, div_hw, > > -- > > 2.25.1 > > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
WARNING: multiple messages have this Message-ID (diff)
From: Abel Vesa <abel.vesa@nxp.com> To: "Peng Fan (OSS)" <peng.fan@oss.nxp.com> Cc: sboyd@kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Peng Fan <peng.fan@nxp.com> Subject: Re: [PATCH V2 2/2] clk: imx8m: check mcore_booted before register clk Date: Tue, 12 Apr 2022 11:14:03 +0300 [thread overview] Message-ID: <YlU0y9F2VGXsJDzU@abelvesa> (raw) In-Reply-To: <YlU0JRrInWbCiylZ@abelvesa> On 22-04-12 11:11:17, Abel Vesa wrote: > On 22-02-28 20:41:12, Peng Fan (OSS) wrote: > > From: Peng Fan <peng.fan@nxp.com> > > > > 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> > > --- > > > > V2: > > None > > > > drivers/clk/imx/clk-composite-8m.c | 21 +++++++++++++-------- > > 1 file changed, 13 insertions(+), 8 deletions(-) > > > > diff --git a/drivers/clk/imx/clk-composite-8m.c b/drivers/clk/imx/clk-composite-8m.c > > index 2dfd6149e528..b16c2c0ea9f6 100644 > > --- a/drivers/clk/imx/clk-composite-8m.c > > +++ b/drivers/clk/imx/clk-composite-8m.c > > @@ -223,14 +223,19 @@ struct clk_hw *__imx8m_clk_hw_composite(const char *name, > > div->lock = &imx_ccm_lock; > > div->flags = CLK_DIVIDER_ROUND_CLOSEST; > > > > - gate = kzalloc(sizeof(*gate), GFP_KERNEL); > > - if (!gate) > > - goto fail; > > - > > - gate_hw = &gate->hw; > > - gate->reg = reg; > > - gate->bit_idx = PCG_CGC_SHIFT; > > - gate->lock = &imx_ccm_lock; > > + /* skip registering the gate ops if M4 is enabled */ > > + if (mcore_booted) { > > + gate_hw = NULL; > > Lets have the gate_hw set to NULL when declared and get rid of this if > case. > On a second thought, no need to resend, I'll squash this in myself. > > + } else { > > And then lets do here: > > if (!mcore_booted) { > > + gate = kzalloc(sizeof(*gate), GFP_KERNEL); > > + if (!gate) > > + goto fail; > > + > > + gate_hw = &gate->hw; > > + gate->reg = reg; > > + gate->bit_idx = PCG_CGC_SHIFT; > > + gate->lock = &imx_ccm_lock; > > + } > > > > Would look a bit cleaner this way. > > With that done: > > Reviewed-by: Abel Vesa <abel.vesa@nxp.com> > > > hw = clk_hw_register_composite(NULL, name, parent_names, num_parents, > > mux_hw, mux_ops, div_hw, > > -- > > 2.25.1 > >
next prev parent reply other threads:[~2022-04-12 8:15 UTC|newest] Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top 2022-02-28 12:41 [PATCH V2 1/2] clk: imx: add mcore_booted module paratemter Peng Fan (OSS) 2022-02-28 12:41 ` Peng Fan (OSS) 2022-02-28 12:41 ` [PATCH V2 2/2] clk: imx8m: check mcore_booted before register clk Peng Fan (OSS) 2022-02-28 12:41 ` Peng Fan (OSS) 2022-03-17 19:38 ` Stephen Boyd 2022-03-17 19:38 ` Stephen Boyd 2022-03-18 1:15 ` Peng Fan 2022-03-18 1:15 ` Peng Fan 2022-04-12 8:11 ` Abel Vesa 2022-04-12 8:11 ` Abel Vesa 2022-04-12 8:14 ` Abel Vesa [this message] 2022-04-12 8:14 ` Abel Vesa 2022-03-17 19:37 ` [PATCH V2 1/2] clk: imx: add mcore_booted module paratemter Stephen Boyd 2022-03-17 19:37 ` Stephen Boyd 2022-03-18 1:14 ` Peng Fan 2022-03-18 1:14 ` Peng Fan 2022-04-12 7:58 ` Abel Vesa 2022-04-12 7:58 ` Abel Vesa 2022-04-12 10:48 ` Abel Vesa 2022-04-12 10:48 ` Abel Vesa
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=YlU0y9F2VGXsJDzU@abelvesa \ --to=abel.vesa@nxp.com \ --cc=festevam@gmail.com \ --cc=kernel@pengutronix.de \ --cc=linux-arm-kernel@lists.infradead.org \ --cc=linux-clk@vger.kernel.org \ --cc=linux-imx@nxp.com \ --cc=linux-kernel@vger.kernel.org \ --cc=peng.fan@nxp.com \ --cc=peng.fan@oss.nxp.com \ --cc=s.hauer@pengutronix.de \ --cc=sboyd@kernel.org \ --cc=shawnguo@kernel.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.