[PATCH 4/5] ARM: imx: clk-gate2: Use post decrement for share_count

Shawn Guo shawn.guo at freescale.com
Thu Jul 3 00:56:47 PDT 2014


On Thu, Jul 03, 2014 at 03:46:00PM +0800, Shawn Guo wrote:
> > Scenario 2:
> > 
> > clk1 is enabled -> clock gate bit is set to 1
> > clk2 is disabled -> clock gate bit cannot be set to 0 because clk1 is enabled
> 
> This never happens.  If clk2 is disabled by clk_disable() without being
> enabled by clk_enable() beforehand, it returns from __clk_disable()
> immediately due to hitting of the WARN below.
> 
> 	if (WARN_ON(clk->enable_count == 0))
> 		return;

Well, it only happens in case that clock core calls clk->ops->disable()
directly from clk_disable_unused_subtree() in order to disable unused
clocks.

Shawn



More information about the linux-arm-kernel mailing list