All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mike Turquette <mturquette@linaro.org>
To: Tomi Valkeinen <tomi.valkeinen@ti.com>,
	Tero Kristo <t-kristo@ti.com>,
	linux-omap@vger.kernel.org, Paul Walmsley <paul@pwsan.com>
Cc: Nishanth Menon <nm@ti.com>, Tony Lindgren <tony@atomide.com>,
	Felipe Balbi <balbi@ti.com>
Subject: Re: [PATCH 1/3] clk: ti: add 'ti,round-rate' flag
Date: Wed, 14 May 2014 23:08:34 -0700	[thread overview]
Message-ID: <20140515060834.3084.5199@quantum> (raw)
In-Reply-To: <5370BAFF.9070501@ti.com>

Quoting Tomi Valkeinen (2014-05-12 05:13:51)
> On 12/05/14 15:02, Tero Kristo wrote:
> > On 05/08/2014 12:06 PM, Tomi Valkeinen wrote:
> >> The current DPLL code does not try to round the clock rate, and instead
> >> returns an error if the requested clock rate cannot be produced exactly
> >> by the DPLL.
> >>
> >> It could be argued that this is a bug, but as the current drivers may
> >> depend on that behavior, a new flag 'ti,round-rate' is added which
> >> enables clock rate rounding.
> > 
> > Someone could probably argue that this flag is not a hardware feature,
> 
> I fully agree.
> 
> > but instead is used to describe linux-kernel behavior, and would
> > probably be frowned upon by the DT enthusiasts. Othen than that, I like
> > this approach better than a global setting, but would like second
> > opinions here.
> 
> I think the dpll code should always do rounding. That's what
> round_rate() is supposed to do, afaik. The current behavior of not
> rounding and returning an error is a bug in my opinion.

>From include/linux/clk.h:

/**
 * clk_round_rate - adjust a rate to the exact rate a clock can provide
 * @clk: clock source
 * @rate: desired clock rate in Hz
 *
 * Returns rounded clock rate in Hz, or negative errno.
 */
long clk_round_rate(struct clk *clk, unsigned long rate);

Definitely not rounding the rate is a bug, with respect to the API
definition. Has anyone tried making the new flag as the default behavior
and seeing if anything breaks?

For those users of the omapconf tool I enjoy doing something like the
following:

<boot current, buggy behavior>
omapconf dump prcm > old

<boot with Tomi's flag enabled for all DPLLs by default>
omapconf dump prcm > new

diff -u old new

This should reveal any deltas, assuming the board boots and doesn't let
magic smoke out.

Regards,
Mike

> 
> So, if you ask me, the whole flag is just for the purpose of keeping the
> current drivers working, which could depend on the broken behavior. But
> I think we cannot have such drivers (functional, at least) in any case,
> as the clk-divider driver is broken and doesn't handle the errors the
> dpll code currently returns for non-exact rates.
> 
>  Tomi
> 
> 

  reply	other threads:[~2014-05-15  6:08 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-08  9:06 [PATCH 1/3] clk: ti: add 'ti,round-rate' flag Tomi Valkeinen
2014-05-08  9:06 ` [PATCH 2/3] ARM: OMAP2+: fix dpll round_rate() to actually round Tomi Valkeinen
2014-05-08  9:06 ` [PATCH 3/3] arm: dts: fix display clk rate rounding for am33xx & am43xx Tomi Valkeinen
2014-05-12 12:02 ` [PATCH 1/3] clk: ti: add 'ti,round-rate' flag Tero Kristo
2014-05-12 12:13   ` Tomi Valkeinen
2014-05-15  6:08     ` Mike Turquette [this message]
2014-05-15 11:48       ` Nishanth Menon
2014-05-15 12:25       ` Tomi Valkeinen
2014-05-31  0:02         ` Mike Turquette
2014-06-03 19:35           ` Paul Walmsley
2014-06-03 19:35             ` Paul Walmsley
2014-06-04  6:25             ` Tomi Valkeinen
2014-06-04  6:25               ` Tomi Valkeinen
2014-06-13 19:53               ` Paul Walmsley
2014-06-13 19:53                 ` Paul Walmsley
2014-06-16 12:28                 ` Tomi Valkeinen
2014-06-16 12:28                   ` Tomi Valkeinen
2014-07-01 21:40                 ` Mike Turquette
2014-07-01 21:40                   ` Mike Turquette
2014-07-01 22:34                   ` Russell King - ARM Linux
2014-07-01 22:34                     ` Russell King - ARM Linux

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=20140515060834.3084.5199@quantum \
    --to=mturquette@linaro.org \
    --cc=balbi@ti.com \
    --cc=linux-omap@vger.kernel.org \
    --cc=nm@ti.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.