linux-clk.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] clk: disable unused clk if enable_count == 0
@ 2016-04-07  9:15 Jun Nie
  2016-04-08  0:14 ` Stephen Boyd
  0 siblings, 1 reply; 4+ messages in thread
From: Jun Nie @ 2016-04-07  9:15 UTC (permalink / raw)
  To: mturquette, sboyd, linux-clk; +Cc: shawn.guo, jason.liu, Jun Nie

If .is_enabled callback is not implemented, clk_core_is_enabled
will take software enable_count as enable status. If enable_count
is zero, .disable will not be called as software assume clock
is not enabled though clock may be booted with  free running state.
Disable the clock in this situation.

Signed-off-by: Jun Nie <jun.nie@linaro.org>
---
 drivers/clk/clk.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
index b4db67a..49c5934 100644
--- a/drivers/clk/clk.c
+++ b/drivers/clk/clk.c
@@ -220,7 +220,7 @@ static void clk_disable_unused_subtree(struct clk_core *core)
 	 * sequence.  call .disable_unused if available, otherwise fall
 	 * back to .disable
 	 */
-	if (clk_core_is_enabled(core)) {
+	if (clk_core_is_enabled(core) || !clk->enable_count) {
 		trace_clk_disable(core);
 		if (core->ops->disable_unused)
 			core->ops->disable_unused(core->hw);
-- 
1.9.1

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

end of thread, other threads:[~2016-04-14  0:37 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-07  9:15 [PATCH] clk: disable unused clk if enable_count == 0 Jun Nie
2016-04-08  0:14 ` Stephen Boyd
2016-04-08  0:46   ` Jun Nie
2016-04-14  0:37     ` Stephen Boyd

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