From: Amit Daniel Kachhap <amit.kachhap@arm.com>
To: Stephen Boyd <sboyd@kernel.org>
Cc: LAK <linux-arm-kernel@lists.infradead.org>,
Sudeep Holla <sudeep.holla@arm.com>,
Michael Turquette <mturquette@baylibre.com>,
linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] clk: scmi: Fix the rounding of clock rate
Date: Mon, 30 Jul 2018 11:03:51 +0530 [thread overview]
Message-ID: <CADGdYn5T2-B2UE9DX3wFHdvqfF85n0NAbKDBf2KHOQreRi=H+g@mail.gmail.com> (raw)
In-Reply-To: <153270946725.48062.11195853363758024681@swboyd.mtv.corp.google.com>
Hi,
On Fri, Jul 27, 2018 at 10:07 PM, Stephen Boyd <sboyd@kernel.org> wrote:
> Quoting Amit Daniel Kachhap (2018-07-27 07:01:52)
>> This fix rounds the clock rate properly by using quotient and not
>> remainder in the calculation. This issue was found while testing HDMI
>> in the Juno platform.
>>
>> Signed-off-by: Amit Daniel Kachhap <amit.kachhap@arm.com>
>
> Any Fixes: tag here?
Yes, This patch is tested with Linux v4.18-rc6 tag.
>
>> ---
>> drivers/clk/clk-scmi.c | 5 ++---
>> 1 file changed, 2 insertions(+), 3 deletions(-)
>>
>> diff --git a/drivers/clk/clk-scmi.c b/drivers/clk/clk-scmi.c
>> index bb2a6f2..a985bf5 100644
>> --- a/drivers/clk/clk-scmi.c
>> +++ b/drivers/clk/clk-scmi.c
>> @@ -60,9 +59,9 @@ static long scmi_clk_round_rate(struct clk_hw *hw, unsigned long rate,
>>
>> ftmp = rate - fmin;
>> ftmp += clk->info->range.step_size - 1; /* to round up */
>> - step = do_div(ftmp, clk->info->range.step_size);
>> + do_div(ftmp, clk->info->range.step_size);
>>
>> - return step * clk->info->range.step_size + fmin;
>> + return ftmp * clk->info->range.step_size + fmin;
>
> Good catch.
Thanks.
>
Regards,
Amit
next prev parent reply other threads:[~2018-07-30 5:33 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-27 14:01 [PATCH] clk: scmi: Fix the rounding of clock rate Amit Daniel Kachhap
2018-07-27 16:37 ` Stephen Boyd
2018-07-30 5:33 ` Amit Daniel Kachhap [this message]
2018-07-30 11:40 ` Sudeep Holla
2018-07-30 16:26 ` Stephen Boyd
2018-07-31 5:55 ` Amit Daniel Kachhap
2018-08-02 20:50 ` Stephen Boyd
2018-07-31 5:21 ` Amit Daniel Kachhap
2018-07-30 11:36 ` Sudeep Holla
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='CADGdYn5T2-B2UE9DX3wFHdvqfF85n0NAbKDBf2KHOQreRi=H+g@mail.gmail.com' \
--to=amit.kachhap@arm.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-clk@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mturquette@baylibre.com \
--cc=sboyd@kernel.org \
--cc=sudeep.holla@arm.com \
/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;
as well as URLs for NNTP newsgroup(s).