From: Tomasz Figa <tomasz.figa@gmail.com>
To: Humberto Naves <hsnaves@gmail.com>
Cc: linux-samsung-soc <linux-samsung-soc@vger.kernel.org>,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org,
devicetree@vger.kernel.org, Kukjin Kim <kgene.kim@samsung.com>,
Tomasz Figa <t.figa@samsung.com>,
Thomas Abraham <ta.omasab@gmail.com>,
Andreas Farber <afaerber@suse.de>,
Randy Dunlap <rdunlap@infradead.org>,
Ian Campbell <ijc+devicetree@hellion.org.uk>
Subject: Re: [PATCHv2 5/5] clk: samsung: exynos5410: Added clocks DPLL, EPLL, IPLL, and VPLL
Date: Thu, 31 Jul 2014 17:19:26 +0200 [thread overview]
Message-ID: <53DA5E7E.9010607@gmail.com> (raw)
In-Reply-To: <CAEe5pB9Rj9rdzk-fjyNcdWyhQCfLtwxt+nAZdb4xuKDO9OpzUA@mail.gmail.com>
On 31.07.2014 15:37, Humberto Naves wrote:
> Hi Tomasz,
>
> I remember checking these rates on my calculator. You might notice the
> odd frequency of 45158401Hz (no pun intended) in the EPLL clock. This
> particular clock frequency was giving me a big headache in a previous
> project, since it was wrongly listed as 45158400. At first it seems
> innocuous, but whenever I would ask for one of the child clocks to
> change the rate, the driver would miscalculate the correct frequencies
> and errors would propagate up and down the clock tree.
>
> Anyway, I would double check these tables. And if you want, I can
> write a separate patch for the rate table validation. I presume that
> you would like to add a new field, such as default_base_freq, to the
> structure samsung_pll_clock, and if that field is non-zero, you
> perform the validation of the table in _samsung_clk_register_pll?
I'm not sure I get the idea of the field you're suggesting. If I
understand correctly, your intention would be to provide a default
frequency if there is no table provided. I don't think there is a need
for it, because current code can read back current settings from
registers and calculate current rate.
As for the validation itself, one more thing that needs to be considered
is that the rate table must be sorted.
We once decided to rely on the fact that tables in SoC drivers have
rates explicitly specified and are correctly sorted, but now I'm
inclined to reconsider this, based on the fact that those rates often
are already incorrectly calculated in vendor code or even datasheets,
which are main information sources for patch authors.
Before mainlining PLL drivers (which was quite some time ago), we had a
bit different implementation in our internal tree, which did not use
explicitly specified rates at all (they could have been considered just
comments to improve table readability) and the _register_pll() function
simply calculated rates for all entries creating new table for internal
use of the PLL driver that was in addition explicitly sorted to make
sure that the order is correct. This kind of implementation is what I
would lean toward today.
Best regards,
Tomasz
next prev parent reply other threads:[~2014-07-31 15:19 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-31 11:22 [PATCHv2 0/5] clk: samsung: exynos5410: Implementation of the PLL clocks Humberto Silva Naves
2014-07-31 11:22 ` [PATCHv2 1/5] clk: samsung: exynos5410: Add NULL pointer checks in clock init Humberto Silva Naves
2014-07-31 12:34 ` Tomasz Figa
2014-07-31 13:13 ` Humberto Naves
2014-07-31 13:20 ` Tomasz Figa
2014-07-31 11:22 ` [PATCHv2 2/5] clk: samsung: exynos5410: Organize register offset constants Humberto Silva Naves
2014-07-31 12:49 ` Tomasz Figa
2014-07-31 11:22 ` [PATCHv2 3/5] clk: samsung: exynos5410: Add suspend/resume handling Humberto Silva Naves
2014-07-31 13:09 ` Tomasz Figa
2014-07-31 11:22 ` [PATCHv2 4/5] clk: samsung: exynos5410: Add fixed rate clocks Humberto Silva Naves
2014-07-31 11:45 ` Sylwester Nawrocki
2014-07-31 21:01 ` Humberto Naves
2014-07-31 21:08 ` Tomasz Figa
2014-07-31 12:53 ` Tomasz Figa
2014-07-31 13:23 ` Humberto Naves
2014-07-31 13:37 ` Tomasz Figa
2014-07-31 11:22 ` [PATCHv2 5/5] clk: samsung: exynos5410: Added clocks DPLL, EPLL, IPLL, and VPLL Humberto Silva Naves
2014-07-31 13:07 ` Tomasz Figa
2014-07-31 13:37 ` Humberto Naves
2014-07-31 15:19 ` Tomasz Figa [this message]
2014-07-31 21:19 ` Humberto Naves
2014-07-31 22:17 ` Tomasz Figa
2014-07-31 22:51 ` Mike Turquette
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=53DA5E7E.9010607@gmail.com \
--to=tomasz.figa@gmail.com \
--cc=afaerber@suse.de \
--cc=devicetree@vger.kernel.org \
--cc=hsnaves@gmail.com \
--cc=ijc+devicetree@hellion.org.uk \
--cc=kgene.kim@samsung.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-samsung-soc@vger.kernel.org \
--cc=rdunlap@infradead.org \
--cc=t.figa@samsung.com \
--cc=ta.omasab@gmail.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