[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <79483c95-c376-414a-947e-d7bf836c1e94@oss.qualcomm.com>
Date: Fri, 26 Dec 2025 23:30:23 +0530
From: Taniya Das <taniya.das@....qualcomm.com>
To: Stephen Boyd <sboyd@...nel.org>, Bjorn Andersson <andersson@...nel.org>
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
On 12/25/2025 3:25 AM, Stephen Boyd wrote:
> 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.
Sure Stephen, let me take a look.
--
Thanks,
Taniya Das
Powered by blists - more mailing lists