[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <7fe840af-d56d-4cb6-8d82-d42631409b2a@stanley.mountain>
Date: Fri, 6 Dec 2024 23:28:11 +0300
From: Dan Carpenter <dan.carpenter@...aro.org>
To: Etienne Carriere <etienne.carriere@...s.st.com>
Cc: linux-kernel@...r.kernel.org, Sudeep Holla <sudeep.holla@....com>,
Cristian Marussi <cristian.marussi@....com>,
Michael Turquette <mturquette@...libre.com>,
Stephen Boyd <sboyd@...nel.org>, arm-scmi@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org, linux-clk@...r.kernel.org
Subject: Re: [PATCH v2 2/2] firmware: arm_scmi: round rate bisecting in
discrete rates
On Tue, Dec 03, 2024 at 06:39:08PM +0100, Etienne Carriere wrote:
> diff --git a/drivers/clk/clk-scmi.c b/drivers/clk/clk-scmi.c
> index 09ccd6cea7f2..7bbb2ee55f4f 100644
> --- a/drivers/clk/clk-scmi.c
> +++ b/drivers/clk/clk-scmi.c
> @@ -61,13 +61,20 @@ static long scmi_clk_round_rate(struct clk_hw *hw, unsigned long rate,
> struct scmi_clk *clk = to_scmi_clk(hw);
>
> /*
> - * We can't figure out what rate it will be, so just return the
> + * In case we can't figure out what rate it will be when the clock
> + * describes a list of discrete rates, then just return the
> * rate back to the caller. scmi_clk_recalc_rate() will be called
> * after the rate is set and we'll know what rate the clock is
> * running at then.
> */
> - if (clk->info->rate_discrete)
> + if (clk->info->rate_discrete) {
> + ftmp = rate;
No need for this assignment.
> + if (scmi_proto_clk_ops->round_rate &&
> + !scmi_proto_clk_ops->round_rate(clk->ph, clk->id, &ftmp))
> + return ftmp;
> +
> return rate;
> + }
>
> fmin = clk->info->range.min_rate;
> fmax = clk->info->range.max_rate;
regards,
dan carpenter
Powered by blists - more mailing lists