linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH RFC RFT 0/3] clk: detect per-user enable imbalances and implement hand-off
@ 2015-08-07 19:09 Michael Turquette
  2015-08-07 19:09 ` [PATCH RFC RFT 1/3] clk: per-user clk prepare & enable ref counts Michael Turquette
                   ` (6 more replies)
  0 siblings, 7 replies; 50+ messages in thread
From: Michael Turquette @ 2015-08-07 19:09 UTC (permalink / raw)
  To: linux-kernel, linux-clk
  Cc: sboyd, lee.jones, maxime.ripard, s.hauer, geert, Michael Turquette

This is an alternative solution to Lee's "clk: Provide support for
always-on clocks" series[0].

The first two patches introduce run-time checks to ensure that clock
consumer drivers are respecting the clk.h api. The former patch checks
for prepare and enable imbalances. The latter checks for calls to
clk_put without first disabling and unpreparing the clk.

The third patch introduces a new flag, CLK_ENABLE_HAND_OFF, which
prepares and enables a clk at registration-time. The reference counts
(prepare & enable) are transferred to the first clock consumer driver
that clk_get's the clk with this flag set AND calls clk_prepare or
clk_enable.

The net result is that a clock with this flag set will be enabled at
boot and neither the clk_disable_unused garbage collector or the
"sibling clock disables a shared parent" scenario will cause the flagged
clock to be disabled. The first driver to come along and explicitly
claim, prepare and enable this clock will inherit those reference
counts. No change to clock consumer drivers is required for this to
work. Please continue to use the clk.h api properly.

In time this approach can probably replace the CLK_IGNORE_UNUSED flag
and hopefully reduce the number of users of the clk_ignore_unused boot
parameter.

Finally, a quick note on comparing this series to Lee's. I went with the
simplest approach to solve a real problem: preventing critical clocks
from being spuriously disabled at boot, or before a their parent clock
becomes accidentally disabled by a sibling.

All of the other kitchen sink stuff (DT binding, passing the flag back
to the framework when the clock consumer driver calls clk_put) was left
out because I do not see a real use case for it. If one can demonstrate
a real use case (and not a hypothetical one) then this patch series can
be expanded further.

[0] http://lkml.kernel.org/r/<1437570255-21049-1-git-send-email-lee.jones@linaro.org>

Michael Turquette (3):
  clk: per-user clk prepare & enable ref counts
  clk: clk_put WARNs if user has not disabled clk
  clk: introduce CLK_ENABLE_HAND_OFF flag

 drivers/clk/clk.c            | 79 +++++++++++++++++++++++++++++++++++++++++---
 include/linux/clk-provider.h |  3 ++
 2 files changed, 78 insertions(+), 4 deletions(-)

-- 
1.9.1


^ permalink raw reply	[flat|nested] 50+ messages in thread

end of thread, other threads:[~2016-02-11 21:34 UTC | newest]

Thread overview: 50+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
     [not found]     ` <20151020124000.20687.60752@quantum>
2015-10-20 12:52       ` Russell King - ARM Linux
2015-10-21  9:50       ` Geert Uytterhoeven
2015-10-21 10:59         ` Russell King - ARM Linux
2015-10-21 15:50           ` Michael Turquette
2015-10-21 16:46             ` Geert Uytterhoeven
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
     [not found]     ` <20150810185516.2416.32293@quantum>
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 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 18:20             ` Lee Jones
     [not found]         ` <20150811170904.2416.43354@quantum>
2015-08-11 18:33           ` Lee Jones
     [not found]             ` <20150811185827.31346.68194@quantum>
2015-08-18 15:52               ` Maxime Ripard
     [not found]                 ` <20150818163356.31346.15075@quantum>
2015-08-20 15:11                   ` Maxime Ripard
2015-08-18 15:58   ` Maxime Ripard
     [not found]     ` <20150818163931.31346.78267@quantum>
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
     [not found]   ` <20150810192810.2416.25672@quantum>
2015-08-11  9:11     ` Lee Jones
2015-08-11  9:20 ` Geert Uytterhoeven
     [not found]   ` <20150811164151.2416.33353@quantum>
2015-08-11 17:42     ` Geert Uytterhoeven
2015-08-18 15:45 ` Maxime Ripard
     [not found]   ` <20150818164356.31346.80341@quantum>
2015-08-20 15:15     ` Maxime Ripard
     [not found]       ` <20150825215051.31346.56261@quantum>
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
     [not found]           ` <20150930123649.3201.75689@quantum>
2015-10-01 19:56             ` Maxime Ripard
2015-11-24  9:48 ` Heiko Stübner
2015-12-05  0:46   ` Michael Turquette
2016-02-11 21:33     ` Michael Turquette

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).