[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <a25ff51d-d328-43d8-98af-91598c1ef23d@salutedevices.com>
Date: Tue, 20 Feb 2024 20:34:52 +0300
From: Jan Dakinevich <jan.dakinevich@...utedevices.com>
To: Michael Turquette <mturquette@...libre.com>, Stephen Boyd
<sboyd@...nel.org>, <linux-clk@...r.kernel.org>,
<linux-kernel@...r.kernel.org>
CC: <kernel@...utedevices.com>
Subject: Re: [PATCH] clk: allow to skip clk_core_req_round_rate_nolock()
Please take a look at this patch.
On 1/26/24 23:14, Jan Dakinevich wrote:
> Calling of clk_core_req_round_rate_nolock() can be time-consuming in a
> case of deep hierarchy with multiple dividers/parents. But if the clock
> already has exactly the same rate as desired, there is no need to
> determine how it could be rounded.
>
> Signed-off-by: Jan Dakinevich <jan.dakinevich@...utedevices.com>
> ---
> drivers/clk/clk.c | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
> index 2253c154a824..04f0ddced932 100644
> --- a/drivers/clk/clk.c
> +++ b/drivers/clk/clk.c
> @@ -2423,6 +2423,12 @@ static int clk_core_set_rate_nolock(struct clk_core *core,
> if (!core)
> return 0;
>
> + /* skip calculation of rounded rate if the clock already has exactly
> + * the same rate as desired
> + */
> + if (req_rate == clk_core_get_rate_nolock(core))
> + return 0;
> +
> rate = clk_core_req_round_rate_nolock(core, req_rate);
>
> /* bail early if nothing to do */
--
Best regards
Jan Dakinevich
Powered by blists - more mailing lists