[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <176661333774.4169.12534802903262524563@lazor>
Date: Wed, 24 Dec 2025 11:55:37 -1000
From: Stephen Boyd <sboyd@...nel.org>
To: Bjorn Andersson <andersson@...nel.org>, Taniya Das <taniya.das@....qualcomm.com>
Cc: Michael Turquette <mturquette@...libre.com>, Taniya Das <quic_tdas@...cinc.com>, Ajit Pandey <ajit.pandey@....qualcomm.com>, Imran Shaik <imran.shaik@....qualcomm.com>, Jagadeesh Kona <jagadeesh.kona@....qualcomm.com>, linux-arm-msm@...r.kernel.org, linux-clk@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] clk: qcom: rcg2: compute 2d using duty fraction directly
Quoting Bjorn Andersson (2025-12-22 09:09:54)
> On Mon, Dec 22, 2025 at 10:38:14PM +0530, Taniya Das wrote:
> > @@ -774,10 +774,8 @@ static int clk_rcg2_set_duty_cycle(struct clk_hw *hw, struct clk_duty *duty)
> >
> > n = (~(notn_m) + m) & mask;
> >
> > - duty_per = (duty->num * 100) / duty->den;
> > -
> > /* Calculate 2d value */
> > - d = DIV_ROUND_CLOSEST(n * duty_per * 2, 100);
> > + d = DIV_ROUND_CLOSEST(n * duty->num * 2, duty->den);
>
> This looks better/cleaner. But for my understanding, can you share some
> example numbers that shows the problem?
>
Even better would be to add some KUnit tests for the qcom clk driver
functions like this so we know they're still working.
Powered by blists - more mailing lists