diff mbox series

clk: not calculate new rate for protected clks

Message ID 20210531103957.21886-1-peng.fan@oss.nxp.com (mailing list archive)
State New, archived
Headers show
Series clk: not calculate new rate for protected clks | expand

Commit Message

Peng Fan (OSS) May 31, 2021, 10:39 a.m. UTC
From: Peng Fan <peng.fan@nxp.com>

If the protect_count of the parent clk is not 0, we not calculate new
rates for parent. Otherwise, the common clk framework may configure
other child clks that is under using.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
 drivers/clk/clk.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Peng Fan (OSS) July 8, 2021, 3:01 a.m. UTC | #1
> Subject: [PATCH] clk: not calculate new rate for protected clks

Gentle ping...

Thanks,
Peng.

> 
> From: Peng Fan <peng.fan@nxp.com>
> 
> If the protect_count of the parent clk is not 0, we not calculate new rates for
> parent. Otherwise, the common clk framework may configure other child clks
> that is under using.
> 
> Signed-off-by: Peng Fan <peng.fan@nxp.com>
> ---
>  drivers/clk/clk.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c index
> 65508eb89ec9..8ac121838e13 100644
> --- a/drivers/clk/clk.c
> +++ b/drivers/clk/clk.c
> @@ -2002,7 +2002,7 @@ static struct clk_core *clk_calc_new_rates(struct
> clk_core *core,
>  	}
> 
>  	if ((core->flags & CLK_SET_RATE_PARENT) && parent &&
> -	    best_parent_rate != parent->rate)
> +	    best_parent_rate != parent->rate &&
> +!clk_core_rate_is_protected(parent))
>  		top = clk_calc_new_rates(parent, best_parent_rate);
> 
>  out:
> --
> 2.30.0
diff mbox series

Patch

diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
index 65508eb89ec9..8ac121838e13 100644
--- a/drivers/clk/clk.c
+++ b/drivers/clk/clk.c
@@ -2002,7 +2002,7 @@  static struct clk_core *clk_calc_new_rates(struct clk_core *core,
 	}
 
 	if ((core->flags & CLK_SET_RATE_PARENT) && parent &&
-	    best_parent_rate != parent->rate)
+	    best_parent_rate != parent->rate && !clk_core_rate_is_protected(parent))
 		top = clk_calc_new_rates(parent, best_parent_rate);
 
 out: