linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] clk: ralink: avoid to set 'CLK_IS_CRITICAL' flag for gates
@ 2021-07-27  5:55 Sergio Paracuellos
  2021-08-23  5:55 ` Sergio Paracuellos
  2021-08-29  5:24 ` Stephen Boyd
  0 siblings, 2 replies; 3+ messages in thread
From: Sergio Paracuellos @ 2021-07-27  5:55 UTC (permalink / raw)
  To: linux-clk; +Cc: sboyd, mturquette, matthias.bgg, linux-kernel, dqfext

'clk_init_data' for gates is setting up 'CLK_IS_CRITICAL'
flag for all of them. This was being doing because some
drivers of this SoC might not be ready to use the clock
and we don't wanted the kernel to disable them since default
behaviour without clock driver was to set all gate bits to
enabled state. After a bit more testing and checking driver
code it is safe to remove this flag and just let the kernel
to disable those gates that are not in use. No regressions
seems to appear.

Fixes: 48df7a26f470 ("clk: ralink: add clock driver for mt7621 SoC")
Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
---
 drivers/clk/ralink/clk-mt7621.c | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)

diff --git a/drivers/clk/ralink/clk-mt7621.c b/drivers/clk/ralink/clk-mt7621.c
index 857da1e274be..a2c045390f00 100644
--- a/drivers/clk/ralink/clk-mt7621.c
+++ b/drivers/clk/ralink/clk-mt7621.c
@@ -131,14 +131,7 @@ static int mt7621_gate_ops_init(struct device *dev,
 				struct mt7621_gate *sclk)
 {
 	struct clk_init_data init = {
-		/*
-		 * Until now no clock driver existed so
-		 * these SoC drivers are not prepared
-		 * yet for the clock. We don't want kernel to
-		 * disable anything so we add CLK_IS_CRITICAL
-		 * flag here.
-		 */
-		.flags = CLK_SET_RATE_PARENT | CLK_IS_CRITICAL,
+		.flags = CLK_SET_RATE_PARENT,
 		.num_parents = 1,
 		.parent_names = &sclk->parent_name,
 		.ops = &mt7621_gate_ops,
-- 
2.25.1


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

* Re: [PATCH] clk: ralink: avoid to set 'CLK_IS_CRITICAL' flag for gates
  2021-07-27  5:55 [PATCH] clk: ralink: avoid to set 'CLK_IS_CRITICAL' flag for gates Sergio Paracuellos
@ 2021-08-23  5:55 ` Sergio Paracuellos
  2021-08-29  5:24 ` Stephen Boyd
  1 sibling, 0 replies; 3+ messages in thread
From: Sergio Paracuellos @ 2021-08-23  5:55 UTC (permalink / raw)
  To: open list:COMMON CLK FRAMEWORK
  Cc: Stephen Boyd, Michael Turquette, Matthias Brugger, linux-kernel,
	DENG Qingfang

On Tue, Jul 27, 2021 at 7:55 AM Sergio Paracuellos
<sergio.paracuellos@gmail.com> wrote:
>
> 'clk_init_data' for gates is setting up 'CLK_IS_CRITICAL'
> flag for all of them. This was being doing because some
> drivers of this SoC might not be ready to use the clock
> and we don't wanted the kernel to disable them since default
> behaviour without clock driver was to set all gate bits to
> enabled state. After a bit more testing and checking driver
> code it is safe to remove this flag and just let the kernel
> to disable those gates that are not in use. No regressions
> seems to appear.
>
> Fixes: 48df7a26f470 ("clk: ralink: add clock driver for mt7621 SoC")
> Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
> ---
>  drivers/clk/ralink/clk-mt7621.c | 9 +--------
>  1 file changed, 1 insertion(+), 8 deletions(-)

Hi Stephen,

Are you ok with this?? It has been a while without response.

Thanks in advance for your time.

Sergio Paracuellos

>
> diff --git a/drivers/clk/ralink/clk-mt7621.c b/drivers/clk/ralink/clk-mt7621.c
> index 857da1e274be..a2c045390f00 100644
> --- a/drivers/clk/ralink/clk-mt7621.c
> +++ b/drivers/clk/ralink/clk-mt7621.c
> @@ -131,14 +131,7 @@ static int mt7621_gate_ops_init(struct device *dev,
>                                 struct mt7621_gate *sclk)
>  {
>         struct clk_init_data init = {
> -               /*
> -                * Until now no clock driver existed so
> -                * these SoC drivers are not prepared
> -                * yet for the clock. We don't want kernel to
> -                * disable anything so we add CLK_IS_CRITICAL
> -                * flag here.
> -                */
> -               .flags = CLK_SET_RATE_PARENT | CLK_IS_CRITICAL,
> +               .flags = CLK_SET_RATE_PARENT,
>                 .num_parents = 1,
>                 .parent_names = &sclk->parent_name,
>                 .ops = &mt7621_gate_ops,
> --
> 2.25.1
>

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

* Re: [PATCH] clk: ralink: avoid to set 'CLK_IS_CRITICAL' flag for gates
  2021-07-27  5:55 [PATCH] clk: ralink: avoid to set 'CLK_IS_CRITICAL' flag for gates Sergio Paracuellos
  2021-08-23  5:55 ` Sergio Paracuellos
@ 2021-08-29  5:24 ` Stephen Boyd
  1 sibling, 0 replies; 3+ messages in thread
From: Stephen Boyd @ 2021-08-29  5:24 UTC (permalink / raw)
  To: Sergio Paracuellos, linux-clk
  Cc: mturquette, matthias.bgg, linux-kernel, dqfext

Quoting Sergio Paracuellos (2021-07-26 22:55:37)
> 'clk_init_data' for gates is setting up 'CLK_IS_CRITICAL'
> flag for all of them. This was being doing because some
> drivers of this SoC might not be ready to use the clock
> and we don't wanted the kernel to disable them since default
> behaviour without clock driver was to set all gate bits to
> enabled state. After a bit more testing and checking driver
> code it is safe to remove this flag and just let the kernel
> to disable those gates that are not in use. No regressions
> seems to appear.
> 
> Fixes: 48df7a26f470 ("clk: ralink: add clock driver for mt7621 SoC")
> Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
> ---

Applied to clk-next

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

end of thread, other threads:[~2021-08-29  5:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-27  5:55 [PATCH] clk: ralink: avoid to set 'CLK_IS_CRITICAL' flag for gates Sergio Paracuellos
2021-08-23  5:55 ` Sergio Paracuellos
2021-08-29  5:24 ` Stephen Boyd

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).