kernel_optimize_test/arch/arm/mach-imx
Shawn Guo 63288b721a ARM: imx: fix shared gate clock
Let's say clock A and B are two gate clocks that share the same register
bit in hardware.  Therefore they are registered as shared gate clocks
with imx_clk_gate2_shared().

In a scenario that only clock A is enabled by clk_enable(A) while B is
not used, the shared gate will be unexpectedly disabled in hardware.
It happens because clk_enable(A) increments the share_count from 0 to 1,
while clock B is unused to clock core, and therefore the core function
will just disable B by calling clk->ops->disable() directly.  The
consequence of that call is share_count is decremented to 0 and the gate
is disabled in hardware, even though clock A is still in use.

The patch fixes the issue by initializing the share_count per hardware
state and returns enable state per share_count from .is_enabled() hook,
in case it's a shared gate.

While at it, add a check in clk_gate2_disable() to ensure it's never
called with a zero share_count.

Reported-by: Fabio Estevam <fabio.estevam@freescale.com>
Fixes: f9f28cdf21 ("ARM: imx: add shared gate clock support")
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>
2014-07-07 21:21:11 -07:00
..
devices ARM: SoC updates for 3.16 (part 1) 2014-06-02 16:15:12 -07:00
3ds_debugboard.c
3ds_debugboard.h
anatop.c
avic.c
board-mx31lilly.h
board-mx31lite.h
board-mx31moboard.h
board-pcm038.h
clk-busy.c
clk-fixup-div.c
clk-fixup-mux.c
clk-gate2.c ARM: imx: fix shared gate clock 2014-07-07 21:21:11 -07:00
clk-imx1.c
clk-imx6q.c
clk-imx6sl.c ARM: imx6sl: add missing enet clock for imx6sl 2014-06-17 21:11:18 +08:00
clk-imx6sx.c
clk-imx21.c
clk-imx25.c
clk-imx27.c
clk-imx31.c
clk-imx35.c
clk-imx51-imx53.c
clk-pfd.c
clk-pllv1.c
clk-pllv2.c
clk-pllv3.c
clk-vf610.c
clk.c
clk.h
common.h
cpu-imx5.c
cpu-imx25.c
cpu-imx27.c
cpu-imx31.c
cpu-imx35.c
cpu.c
cpuidle-imx5.c
cpuidle-imx6q.c
cpuidle-imx6sl.c
cpuidle.h
crm-regs-imx5.h
crmregs-imx3.h
devices-imx1.h
devices-imx21.h
devices-imx25.h
devices-imx27.h
devices-imx31.h
devices-imx35.h
devices-imx51.h
ehci-imx5.c
ehci-imx25.c
ehci-imx27.c
ehci-imx31.c
ehci-imx35.c
epit.c
eukrea_mbimx27-baseboard.c
eukrea_mbimxsd25-baseboard.c
eukrea_mbimxsd35-baseboard.c
eukrea-baseboards.h
gpc.c
hardware.h
headsmp.S
hotplug.c
iim.h
imx25-dt.c
imx27-dt.c
imx31-dt.c
imx35-dt.c
imx51-dt.c
iomux-imx31.c
iomux-mx1.h
iomux-mx2x.h
iomux-mx3.h
iomux-mx21.h
iomux-mx25.h
iomux-mx27.h
iomux-mx35.h
iomux-mx51.h
iomux-v1.c
iomux-v1.h
iomux-v3.c
iomux-v3.h
irq-common.c
irq-common.h
Kconfig Merge branch 'fixes' of git://ftp.arm.linux.org.uk/~rmk/linux-arm 2014-06-24 13:59:00 -07:00
mach-apf9328.c
mach-armadillo5x0.c
mach-bug.c
mach-cpuimx27.c
mach-cpuimx35.c
mach-eukrea_cpuimx25.c
mach-imx6q.c
mach-imx6sl.c
mach-imx6sx.c
mach-imx27_visstrim_m10.c
mach-imx27ipcam.c
mach-imx27lite.c
mach-imx50.c
mach-imx53.c
mach-kzm_arm11_01.c
mach-mx1ads.c
mach-mx21ads.c
mach-mx25_3ds.c
mach-mx27_3ds.c
mach-mx27ads.c
mach-mx31_3ds.c
mach-mx31ads.c
mach-mx31lilly.c
mach-mx31lite.c
mach-mx31moboard.c
mach-mx35_3ds.c
mach-mxt_td60.c
mach-pca100.c
mach-pcm037_eet.c
mach-pcm037.c
mach-pcm038.c
mach-pcm043.c
mach-qong.c
mach-scb9328.c
mach-vf610.c ARM: l2c: imx vf610: convert to generic l2c OF initialisation 2014-05-30 00:49:28 +01:00
mach-vpr200.c
Makefile
mm-imx1.c
mm-imx3.c
mm-imx5.c
mm-imx21.c
mm-imx25.c
mm-imx27.c
mmdc.c
mx1-camera-fiq-ksym.c
mx1-camera-fiq.S
mx1.h
mx2x.h
mx3x.h
mx21.h
mx25.h
mx27.h
mx31.h
mx31lilly-db.c
mx31lite-db.c
mx31moboard-devboard.c
mx31moboard-marxbot.c
mx31moboard-smartbot.c
mx35.h
mx51.h
mx53.h
mxc.h
pcm037.h
pcm970-baseboard.c
platsmp.c
pm-imx3.c
pm-imx5.c
pm-imx6.c
pm-imx27.c
src.c
ssi-fiq-ksym.c
ssi-fiq.S
suspend-imx6.S ARM: l2c: imx: convert to common l2c310 early resume functionality 2014-05-30 00:49:24 +01:00
system.c ARM: l2c: imx: remove direct write to power control register 2014-05-30 00:49:22 +01:00
time.c
tzic.c
ulpi.h