mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jan Dakinevich <jan.dakinevich@salutedevices.com>
To: Michael Turquette <mturquette@baylibre.com>,
	Stephen Boyd <sboyd@kernel.org>, <linux-clk@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>
Cc: <kernel@salutedevices.com>
Subject: Re: [PATCH] clk: allow to skip clk_core_req_round_rate_nolock()
Date: Tue, 20 Feb 2024 20:34:52 +0300	[thread overview]
Message-ID: <a25ff51d-d328-43d8-98af-91598c1ef23d@salutedevices.com> (raw)
In-Reply-To: <20240126201433.1830600-1-jan.dakinevich@salutedevices.com>

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@salutedevices.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

  reply	other threads:[~2024-02-20 17:36 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-26 20:14 Jan Dakinevich
2024-02-20 17:34 ` Jan Dakinevich [this message]
2024-02-22 23:20 ` Stephen Boyd
2024-02-23 21:47   ` Jan Dakinevich
2024-02-29  2:16     ` Stephen Boyd
2024-03-09 21:20       ` Jan Dakinevich

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=a25ff51d-d328-43d8-98af-91598c1ef23d@salutedevices.com \
    --to=jan.dakinevich@salutedevices.com \
    --cc=kernel@salutedevices.com \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mturquette@baylibre.com \
    --cc=sboyd@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: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®