From: Stephen Boyd <sboyd@kernel.org>
To: Mike Looijmans <mike.looijmans@topic.nl>, linux-clk@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, mturquette@baylibre.com,
Mike Looijmans <mike.looijmans@topic.nl>
Subject: Re: [PATCH] clk-si544: Properly round requested frequency to nearest match
Date: Thu, 31 May 2018 08:34:31 -0700 [thread overview]
Message-ID: <152778087117.144038.3582001993053198941@swboyd.mtv.corp.google.com> (raw)
In-Reply-To: <1527775435-5017-1-git-send-email-mike.looijmans@topic.nl>
Quoting Mike Looijmans (2018-05-31 07:03:55)
> The si544 driver had a rounding problem that using the result of clk_round_rate
> may set the clock to yet another rate, for example:
> clk_round_rate(195000000) = 194999999
> clk_round_rate(194999999) = 194999998
>
> Clients would expect that after clk_set_rate(clk, freq2=clk_round_rate(clk, freq)) the
> chip will be running at exactly freq2.
>
> The problem was in the calculation of the feedback divider, it was always rounded
> down instead of to the nearest possible VCO value.
>
> After this change, the following holds true for any supported frequency:
> actual_freq = clk_round_rate(clk, freq);
> clk_set_rate(clk, actual_freq);
> clk_round_rate(clk, actual_freq) == actual_freq && clk_get_rate(clk) == actual_freq
>
> Signed-off-by: Mike Looijmans <mike.looijmans@topic.nl>
Any fixes tag? I can slap
Fixes: 953cc3e81170 ("clk: Add driver for the si544 clock generator chip")
on to the patch here.
next prev parent reply other threads:[~2018-05-31 15:34 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-31 14:03 [PATCH] clk-si544: Properly round requested frequency to nearest match Mike Looijmans
2018-05-31 15:34 ` Stephen Boyd [this message]
2018-06-01 5:05 ` Mike Looijmans
2018-06-02 6:25 ` Stephen Boyd
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=152778087117.144038.3582001993053198941@swboyd.mtv.corp.google.com \
--to=sboyd@kernel.org \
--cc=linux-clk@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mike.looijmans@topic.nl \
--cc=mturquette@baylibre.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).