linux-omap.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Felipe Balbi <balbi@ti.com>
To: Tomi Valkeinen <tomi.valkeinen@ti.com>
Cc: Paul Walmsley <paul@pwsan.com>, Tero Kristo <t-kristo@ti.com>,
	Tony Lindgren <tony@atomide.com>,
	linux-arm-kernel@lists.infradead.org, linux-omap@vger.kernel.org,
	Mike Turquette <mturquette@linaro.org>
Subject: Re: [PATCH 2/2] ARM: OMAP2+: fix dpll round_rate() to actually round
Date: Thu, 24 Apr 2014 13:34:21 -0500	[thread overview]
Message-ID: <20140424183420.GE4659@saruman.home> (raw)
In-Reply-To: <530DD33A.20005@ti.com>

[-- Attachment #1: Type: text/plain, Size: 3580 bytes --]

On Wed, Feb 26, 2014 at 01:42:50PM +0200, Tomi Valkeinen wrote:
> On 19/02/14 21:49, Paul Walmsley wrote:
> > On Fri, 17 Jan 2014, Tomi Valkeinen wrote:
> > 
> >> omap2_dpll_round_rate() doesn't actually round the given rate, even if
> >> the name and the description so hints. Instead it only tries to find an
> >> exact rate match, or if that fails, return ~0 as an error.
> > 
> > In the past, we had "rate tolerance" code, which allowed the clock code to 
> > return an approximate rate within some margin.  See for example commit 
> > 241d3a8dca239610d3d991bf58d4fe38c2d86fd5 ("OMAP2+: clock: remove the DPLL 
> > rate tolerance code").  The rate tolerance was set at compile-time, but it 
> > was set on a per-PLL basis, which in theory allowed PLLs responsible for 
> > audio, etc. to have a very low rate tolerance, but PLLs that only drove 
> > internal functional blocks to have a high rate tolerance.  
> > 
> > Part of the reason why this was removed is because some of the TI hardware 
> > guys didn't want any PLL rates used that were not explicitly 
> > characterized.
> 
> Ok.
> 
> >> What this basically means is that the user of the clock needs to know
> >> what rates the dpll can support, which obviously isn't right.
> > 
> > In principle I agree with you, but I'm not sure that this rate rounding 
> > function is the solution.
> > 
> >> This patch adds a simple method of rounding: during the iteration, the 
> >> code keeps track of the closest rate match. If no exact match is found, 
> >> the closest is returned.
> > 
> > So that's one possible rounding policy; maybe it works fine for a display 
> > interface PLL, at least for some values of "closest rate".  But another 
> > might be "only allow a selection from a set of pre-determined rates 
> > characterized by the silicon validation team".  Or another rounding 
> > function might need to select a more distant rate that minimizes jitter, 
> > EMI, or power consumption.  
> > 
> > Seems to me that there needs to be some way for a clock user to 
> > communicate its requirements along these lines to the clock framework for 
> > use by the rate rounding code.  At the very least, some kind of [min, max] 
> > interval seems appropriate.
> > 
> > Also I've often thought that it would be useful for your purposes to be 
> > able to query a clock to return a list or some other parametric 
> > description of the rates that it can provide.
> 
> I fully agree with all you said above.
> 
> However, I'm not trying to fix the omap clock framework here =). I just
> want the displays to work properly in mainline kernel.
> 
> So, presuming this was merged, and gets display working, how would it
> affect other users compared to the current state? The patched version
> returns the same rate than before, if an exact match is found. Rounded
> rate is only returned as a last option, instead of an error.
> 
> Do we have drivers that handle that error somehow, and then do something
> (what?) to get some other rate?
> 
> If the clock path in question also has a divider component after the
> pll, using clk-divider.c (which I guess is used in all/most of the
> DPLLs?), things would go badly wrong if there's an error, as
> clk-divider.c doesn't handle it.
> 
> So I can make no guarantees, but I have a hunch that all current users
> ask for an exact clock, in which case this patch doesn't change their
> behavior, except for display which it fixes.

no further updates here ? Display is still broken on BBB :-(

-- 
balbi

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

  reply	other threads:[~2014-04-24 18:38 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-17  7:44 [PATCH 0/2] ARM: OMAP2+: Fix dpll rounding Tomi Valkeinen
2014-01-17  7:44 ` [PATCH 1/2] ARM: OMAP2+: fix rate prints Tomi Valkeinen
2014-02-19 19:25   ` Paul Walmsley
2014-01-17  7:44 ` [PATCH 2/2] ARM: OMAP2+: fix dpll round_rate() to actually round Tomi Valkeinen
2014-02-13 23:00   ` Tony Lindgren
2014-02-14 13:32     ` Tero Kristo
2014-02-19 19:49   ` Paul Walmsley
2014-02-20 19:30     ` Paul Walmsley
2014-02-26 11:48       ` Tomi Valkeinen
2014-03-05 13:50       ` Tomi Valkeinen
2014-04-30 15:38         ` Felipe Balbi
2014-04-30 15:40         ` Nishanth Menon
2014-02-26 11:42     ` Tomi Valkeinen
2014-04-24 18:34       ` Felipe Balbi [this message]
2014-04-24 18:29   ` Felipe Balbi
2014-04-24 18:44     ` Tony Lindgren
2014-04-29 15:51       ` Felipe Balbi
2014-04-29 16:27         ` Tomi Valkeinen
2014-05-07 22:16           ` Paul Walmsley
2014-05-12 12:11             ` Tomi Valkeinen

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=20140424183420.GE4659@saruman.home \
    --to=balbi@ti.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=mturquette@linaro.org \
    --cc=paul@pwsan.com \
    --cc=t-kristo@ti.com \
    --cc=tomi.valkeinen@ti.com \
    --cc=tony@atomide.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).