]> git.karo-electronics.de Git - karo-tx-linux.git/commit
ARM: imx: fix .is_enabled() of shared gate clock
authorShawn Guo <shawn.guo@freescale.com>
Tue, 16 Sep 2014 01:35:33 +0000 (09:35 +0800)
committerNitin Garg <nitin.garg@freescale.com>
Fri, 16 Jan 2015 03:18:04 +0000 (21:18 -0600)
commit48539074e43ad307e77b324037deb4562397a364
tree751a16059bcec6f7afbd3954d9bdb6fa4626e179
parentc91733eb21c8033d5db3667316ba1960cf617855
ARM: imx: fix .is_enabled() of shared gate clock

Commit 63288b721a80 ("ARM: imx: fix shared gate clock") attempted to fix
an issue with particular enable/disable sequence from two shared gate
clocks.  But unfortunately, while it partially fixed the issue, it also
did something wrong in .is_enabled() function hook.  In case of shared
gate, the function shouldn't really query the hardware state via
share_count, because the function is trying to query the enabling state
of the clock in question, not the hardware state which is shared by
multiple clocks.

Fix the issue by returning the enable_count of the clock itself which is
maintained by clock core, in case it's a clock sharing hardware gate
with others.  As the result, the initialization of share_count per
hardware state is not needed now.  So remove it.

shawn.guo: cherry-pick commit 9e1ac462b982 from upstream

Reported-by: Fabio Estevam <fabio.estevam@freescale.com>
Fixes: 63288b721a80 ("ARM: imx: fix shared gate clock")
Cc: <stable@vger.kernel.org>
Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
Tested-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Olof Johansson <olof@lixom.net>
arch/arm/mach-imx/clk-gate2.c