All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michael Turquette <mturquette@baylibre.com>
To: Maxime Ripard <maxime.ripard@free-electrons.com>,
Cc: linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org,
	sboyd@codeaurora.org, lee.jones@linaro.org,
	s.hauer@pengutronix.de, geert@linux-m68k.org
Subject: Re: [PATCH RFC RFT 3/3] clk: introduce CLK_ENABLE_HAND_OFF flag
Date: Tue, 18 Aug 2015 09:39:31 -0700	[thread overview]
Message-ID: <20150818163931.31346.78267@quantum> (raw)
In-Reply-To: <20150818155854.GK2547@lukather>

Quoting Maxime Ripard (2015-08-18 08:58:54)
> Hi Mike,
> =

> On Fri, Aug 07, 2015 at 12:09:30PM -0700, Michael Turquette wrote:
> > Some clocks are critical to system operation (e.g. cpu, memory, etc) and
> > should not be gated until a driver that knows best claims such a clock
> > and expressly gates that clock through the normal clk.h api.
> > =

> > The typical way to handle this is for the clk driver or some other early
> > code to call clk_prepare_enable on this important clock as soon as it is
> > registered and before the clk_disable_unused garbage collector kicks in.
> > =

> > This patch introduces a formal way to handle this scenario that is
> > provided by the clk framework. Clk driver authors can set the
> > CLK_ENABLE_HAND_OFF flag in their clk data, which will cause the clk to
> > be enabled in clk_register(). Then when the first clk consumer driver
> > comes along and calls clk_get() & clk_prepare_enable(), the reference
> > counts taken during clk registration are transfered (or handed off) to
> > the clk consumer.
> > =

> > At this point handling the clk is the same as any other clock which as
> > not set the new CLK_ENABLE_HAND_OFF flag. In fact no changes to any
> > clock consumer driver are needed for this to work.
> =

> This looks fine, the only thing I'm not really fond of is the name of
> the flag itself (and it's usually a good thing when we come to that
> kind of bikeshedding).

Agreed on the Bikeshedding Milestone!

I also do not like the name, but I'm struggling to find the right one
(as usual).

> =

> In my mind, the fact that we hand off the clock reference is a direct
> result to the clock being critical (or whatever name we want to call
> it). The hand off is a side effect, but the real information we want
> to carry is that it should not be gated.

I chose the "hand-off" name because I want to set an expectation to
users of this feature. That expectation is that some day they will have
a Linux device driver that claims and manages this "critical clock".
Clearly this is not always the case. Many clocks using this feature will
never have a driver that "owns" them.

But I wanted to avoid any kind of "always on" or "easy hack to avoid
writing proper driver code" naming convention that encourages bad
behavior down the line.

Also, the hand-off thing is sort of a big deal. If driver writers only
thought of this as an "alway on" mechanism then subtle bugs might creep
in where drivers are getting and disabling a clock that the author
incorrectly thought would always be enabled. So I'd like the name to
reflect that somehow.

As always I am open to suggestions.

Regards,
Mike

> =

> And then the framework will know what behaviour it want to have based
> on that information.
> =

> Maxime
> =

> -- =

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

  reply	other threads:[~2015-08-18 16:39 UTC|newest]

Thread overview: 83+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-07 19:09 [PATCH RFC RFT 0/3] clk: detect per-user enable imbalances and implement hand-off Michael Turquette
2015-08-07 19:09 ` [PATCH RFC RFT 1/3] clk: per-user clk prepare & enable ref counts Michael Turquette
2015-08-10 13:47   ` Maxime Coquelin
2015-08-10 19:31     ` Michael Turquette
2015-08-07 19:09 ` [PATCH RFC RFT 2/3] clk: clk_put WARNs if user has not disabled clk Michael Turquette
2015-09-30 15:38   ` Geert Uytterhoeven
2015-09-30 15:38     ` Geert Uytterhoeven
2015-09-30 15:38     ` Geert Uytterhoeven
2015-10-20 12:40     ` Michael Turquette
2015-10-20 12:40       ` Michael Turquette
2015-10-20 12:40       ` Michael Turquette
2015-10-20 12:52       ` Russell King - ARM Linux
2015-10-20 12:52         ` Russell King - ARM Linux
2015-10-20 12:52         ` Russell King - ARM Linux
2015-10-21  9:50       ` Geert Uytterhoeven
2015-10-21  9:50         ` Geert Uytterhoeven
2015-10-21  9:50         ` Geert Uytterhoeven
2015-10-21 10:59         ` Russell King - ARM Linux
2015-10-21 10:59           ` Russell King - ARM Linux
2015-10-21 10:59           ` Russell King - ARM Linux
2015-10-21 15:50           ` Michael Turquette
2015-10-21 15:50             ` Michael Turquette
2015-10-21 15:50             ` Michael Turquette
2015-10-21 15:50             ` Michael Turquette
2015-10-21 16:46             ` Geert Uytterhoeven
2015-10-21 16:46               ` Geert Uytterhoeven
2015-10-21 16:46               ` Geert Uytterhoeven
2015-10-22  9:57               ` Michael Turquette
2015-10-22  9:57                 ` Michael Turquette
2015-10-22  9:57                 ` Michael Turquette
2015-08-07 19:09 ` [PATCH RFC RFT 3/3] clk: introduce CLK_ENABLE_HAND_OFF flag Michael Turquette
2015-08-10 14:48   ` Lee Jones
2015-08-10 18:55     ` Michael Turquette
2015-08-11  8:43       ` Lee Jones
2015-08-11 10:02         ` Maxime Coquelin
2015-08-11 10:11           ` Geert Uytterhoeven
2015-08-11 11:36             ` Maxime Coquelin
2015-08-11 11:41               ` Maxime Coquelin
2015-08-11 11:49                 ` Geert Uytterhoeven
2015-08-11 12:03                   ` Maxime Coquelin
2015-08-11 12:34                     ` Geert Uytterhoeven
2015-08-11 12:03                   ` Lee Jones
2015-08-11 17:09             ` Michael Turquette
2015-08-11 17:09               ` Michael Turquette
2015-08-11 18:17               ` Lee Jones
2015-08-12  7:27                 ` Geert Uytterhoeven
2015-08-12  7:51                   ` Lee Jones
2015-08-11 17:09           ` Michael Turquette
2015-08-11 17:09             ` Michael Turquette
2015-08-11 18:20             ` Lee Jones
2015-08-11 17:09         ` Michael Turquette
2015-08-11 18:33           ` Lee Jones
2015-08-11 18:58             ` Michael Turquette
2015-08-18 15:52               ` Maxime Ripard
2015-08-18 16:33                 ` Michael Turquette
2015-08-20 15:11                   ` Maxime Ripard
2015-08-18 15:58   ` Maxime Ripard
2015-08-18 16:39     ` Michael Turquette [this message]
2015-08-20 15:39       ` Maxime Ripard
2015-08-10 15:36 ` [PATCH RFC RFT 0/3] clk: detect per-user enable imbalances and implement hand-off Lee Jones
2015-08-10 19:28   ` Michael Turquette
2015-08-11  9:11     ` Lee Jones
2015-08-11  9:20 ` Geert Uytterhoeven
2015-08-11 16:41   ` Michael Turquette
2015-08-11 17:42     ` Geert Uytterhoeven
2015-08-18 15:45 ` Maxime Ripard
2015-08-18 16:43   ` Michael Turquette
2015-08-20 15:15     ` Maxime Ripard
2015-08-25 21:50       ` Michael Turquette
2015-08-26  6:54         ` Lee Jones
2015-08-26  8:42           ` Maxime Coquelin
2015-08-26  9:09             ` Lee Jones
2015-08-26  9:37               ` Maxime Coquelin
2015-08-26 20:41                 ` Lee Jones
2015-08-29  3:49           ` Maxime Ripard
2015-08-29  3:55         ` Maxime Ripard
2015-09-30 12:36           ` Michael Turquette
2015-10-01 19:56             ` Maxime Ripard
2015-11-24  9:48 ` Heiko Stübner
2015-12-05  0:46   ` Michael Turquette
2015-12-05  0:46     ` Michael Turquette
2016-02-11 21:33     ` Michael Turquette
2016-02-11 21:33       ` Michael 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=20150818163931.31346.78267@quantum \
    --to=mturquette@baylibre.com \
    --cc=geert@linux-m68k.org \
    --cc=lee.jones@linaro.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maxime.ripard@free-electrons.com \
    --cc=s.hauer@pengutronix.de \
    --cc=sboyd@codeaurora.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 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.