devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Maxime Ripard <maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
To: Lee Jones <lee.jones-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
Cc: Sascha Hauer <s.hauer-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	kernel-F5mvAk5X5gdBDgjK7y7TUQ@public.gmane.org,
	mturquette-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org,
	sboyd-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org,
	devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	geert-Td1EMuHUCqxL1ZNQvxDV9g@public.gmane.org
Subject: Re: [PATCH v6 4/4] clk: dt: Introduce binding for always-on clock support
Date: Fri, 15 May 2015 16:12:16 +0200	[thread overview]
Message-ID: <20150515141216.GW4004@lukather> (raw)
In-Reply-To: <20150508072246.GH16220@x1>

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

On Fri, May 08, 2015 at 08:22:46AM +0100, Lee Jones wrote:
> On Thu, 07 May 2015, Maxime Ripard wrote:
> 
> > On Fri, May 01, 2015 at 07:44:05AM +0100, Lee Jones wrote:
> > > > > Does Sascha's antidote patch change your opinion?  We can use DT to
> > > > > declare critical clocks, and in the rare case of the introduction of a
> > > > > new DDRFreq-like feature, which doesn't adapt the DT will still be
> > > > > able to unlock the criticalness of the clock and use it as expected?
> > > > 
> > > > Honestly I'm not very fond of declaring these in the device tree, but
> > > 
> > > I know why you guys are saying that, but I'd like you to understand
> > > the reasons for me pushing for this.  Rather than be being deliberately
> > > obtuse, I'm thinking of the mess that not having this stuff in DT will
> > > cause for clock implementations like ours, which describe more of a
> > > framework than a description.
> > 
> > The DT should dictate our implementation, not the other way around. I
> > know that we are pretty bad at doing this, and that there's some clear
> > abstraction violations already widely used, but really, using this
> > kind of argument is pretty bad.
> 
> I guess then you haven't correctly understood my argument, as that's
> exactly what's happened.  We have a DT implementation which accurately
> describes the clock architecture on each of our platforms. The
> associated C code in drivers/clk/ is written to extract the
> information from it, the hardware description and register the clocks
> properly.
> 
> What makes you think differently?
> 
> > The DT can (and is) shared between several OS and bootloaders, what if
> > the *BSDs or barebox, or whatever, guys come up with the exact same
> > argument to make a completely different binding?
> > 
> > We'd end up either in a deadlock, or forcing our solution down the
> > throat to some other system. I'm not sure any of these outcomes is
> > something we want.
> 
> Not sure I understand why this is different from any other binding?

The other bindings don't dictate the OS behaviour, this one does.

> > > The providers in drivers/clock/st are blissfully ignorant of platform
> > > specifics.  Per-platform configuration is described in DT.
> > 
> > Maybe they just need a small amount of education then.
> 
> Easy to say (and implement), but that means duplicating the hardware
> description in DT, which is not a design win.

Except that clock-always-on isn't an hardware information, it's what
you expect the OS to do with this clock. The fact that it's a critical
clock, would be way better, as it gives the OS the information that
this clock should be treated with care, and *possibly* never disable
it, but still leaves the option open to do whatever it needs to do
with it if it knows what it's doing.

> > > So we'd have 2 options to use a C-only based API; 1) duplicate
> > > platform information in drivers/clk/st, or 2) supply a vendor
> > > specific st,critical-clocks binding, pull out those references then
> > > run them though the aforementioned framework.  It is my opinion that
> > > neither of those methods are desirable.
> > 
> > 3) have a generic solution for this in the clock framework, like Mike
> > suggested.
> 
> Did you actually read and understand the points here?  If not, just
> say so and I'll figure out a way to explain the issues better.  3) is
> not an alternative to 1) and 2).  Instead 1) and 2) imply 3).

Ok, I misunderstood what you meant then, my bad.

> I *want* to have a generic solution, and have made several passes at
> writing one.  The question here is; what does that look like?  Some
> people don't like the idea of having it in DT due to possible abuse of
> the property.  But we can't have anything only in C because our clock
> implementation (rightly) doesn't know or (shouldn't have to) care
> about platform specifics.

This is exactly the point I was using in my previous argument. You're
using the state of your code and implementation ("our clock
implementation doesn't know about platform specifics") to push for a
DT binding ("I want to use clock-always-on or st,critical-clocks").

And you *can* have such a description in your code. You just don't
want to.

Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

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

  reply	other threads:[~2015-05-15 14:12 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-07 18:43 [PATCH v6 0/4] clk: Provide support for always-on clocks Lee Jones
2015-04-07 18:43 ` [PATCH v6 1/4] ARM: sti: stih407-family: Supply defines for CLOCKGEN A0 Lee Jones
2015-04-07 18:43 ` [PATCH v6 2/4] ARM: sti: stih410-clocks: Identify critical clocks as always-on Lee Jones
     [not found] ` <1428432239-4114-1-git-send-email-lee.jones-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2015-04-07 18:43   ` [PATCH v6 3/4] clk: Provide always-on clock support Lee Jones
2015-04-08  5:02     ` Stephen Boyd
2015-04-07 18:43 ` [PATCH v6 4/4] clk: dt: Introduce binding for " Lee Jones
2015-04-07 19:17   ` Maxime Ripard
2015-04-08  8:14     ` Lee Jones
2015-04-08  9:43       ` Maxime Ripard
2015-04-08 10:38         ` Lee Jones
2015-04-08 15:57           ` Maxime Ripard
2015-04-08 17:23             ` Lee Jones
2015-04-22  9:34               ` Maxime Ripard
2015-04-29 14:17                 ` Lee Jones
2015-04-29 14:33                   ` Geert Uytterhoeven
2015-04-29 15:11                     ` Lee Jones
2015-04-29 20:27                       ` Maxime Ripard
2015-04-29 14:51                   ` Sascha Hauer
2015-04-29 16:07                     ` Lee Jones
2015-04-29 23:05                       ` Michael Turquette
2015-05-04 13:31                         ` Maxime Ripard
2015-04-29 20:23                   ` Maxime Ripard
2015-04-30  9:57                     ` Lee Jones
2015-05-01  5:34                       ` Sascha Hauer
2015-05-01  6:44                         ` Lee Jones
2015-05-07 21:20                           ` Maxime Ripard
2015-05-08  7:22                             ` Lee Jones
2015-05-15 14:12                               ` Maxime Ripard [this message]
2015-04-07 20:32   ` Rob Herring
     [not found]   ` <1428432239-4114-5-git-send-email-lee.jones-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2015-04-08  5:25     ` Stephen Boyd
2015-04-08  5:28 ` [PATCH v6 0/4] clk: Provide support for always-on clocks 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=20150515141216.GW4004@lukather \
    --to=maxime.ripard-wi1+55scjutkeb57/3fjtnbpr1lh4cv8@public.gmane.org \
    --cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=geert-Td1EMuHUCqxL1ZNQvxDV9g@public.gmane.org \
    --cc=kernel-F5mvAk5X5gdBDgjK7y7TUQ@public.gmane.org \
    --cc=lee.jones-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
    --cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=mturquette-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
    --cc=s.hauer-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org \
    --cc=sboyd-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org \
    /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).