linux/arch/arm
Jon Hunter 29f0667f92 ARM: OMAP4: Fix EMU clock domain always on
Commit d043d87 (ARM: OMAP2+: clockdomain: bypass clockdomain handling
when disabling unused clks) skips the decrementing of a clock-domains
use count if the clocks use count is zero. However, for OMAP4 devices
this is causing the EMU clock-domain to be stuck ON as the use count is
not getting decremented correctly.

The scenario that leads to this problem is described below ...

omap_hwmod_setup_all
--> _setup
    --> clkdm_hwmod_enable
    	--> EMU clock domain usecount = 1
    --> _enable_clocks
        --> clk_enable
	    --> trace_clk_div_div usecount = 1
            --> clkdm_hwmod_enable
    	        --> EMU clock domain usecount = 2
--> _idle
    --> _disable_clocks
	--> clk_disable
            --> trace_clk_div_div usecount = 0
            --> clkdm_hwmod_disable
                --> skips decrement of EMU clock domain usecount
		    because trace_clk_div_div is 0!
    	        --> EMU clock domain usecount = 2
    --> clkdm_hwmod_disable
    	--> EMU clock domain usecount = 1

Hence, due to the order that a clocks use count is decremented and the
clock domain is disabled, it is possible that the clock domain can have
a non-zero use count when the actual clock has a use count of 0.
Therefore, we should only bypass the clock-domain handling when both the
clock-domain and clock in the clock-domain have a use count of 0 and
warn when the clock-domain has a zero use count and the clock has a
non-zero use count.

Signed-off-by: Jon Hunter <jon-hunter@ti.com>
[paul@pwsan.com: fixed checkpatch warning]
Signed-off-by: Paul Walmsley <paul@pwsan.com>
2012-12-15 01:35:54 -07:00
..
boot ARM: arm-soc: Updates for Marvell mvebu/kirkwood 2012-12-14 14:54:26 -08:00
common Merge branch 'devel-stable' into for-linus 2012-12-11 10:01:53 +00:00
configs ARM: arm-soc: Updates for Marvell mvebu/kirkwood 2012-12-14 14:54:26 -08:00
crypto
include ARM: arm-soc: Updates for Marvell mvebu/kirkwood 2012-12-14 14:54:26 -08:00
kernel Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial 2012-12-13 12:00:02 -08:00
lib
mach-at91 Sound updates for 3.8-rc1 2012-12-13 11:51:23 -08:00
mach-bcm Add support for generic BCM SoC chipsets 2012-11-19 22:39:07 -08:00
mach-bcm2835 ARM: arm-soc: SoC updates for 3.8 2012-12-12 12:05:15 -08:00
mach-clps711x ARM: clps711x: Rename board files to match functionality 2012-11-21 09:57:46 -08:00
mach-cns3xxx ARM: arm-soc: Non-critical bug fixes 2012-12-12 11:32:16 -08:00
mach-davinci Sound updates for 3.8-rc1 2012-12-13 11:51:23 -08:00
mach-dove ARM: arm-soc: Updates for Marvell mvebu/kirkwood 2012-12-14 14:54:26 -08:00
mach-ebsa110
mach-ep93xx
mach-exynos ARM: arm-soc: SoC updates, take 2 2012-12-14 14:38:28 -08:00
mach-footbridge
mach-gemini
mach-h720x
mach-highbank Merge branch 'next/cam-samsung' of git://git.kernel.org/pub/scm/linux/kernel/git/kgene/linux-samsung into next/soc 2012-11-30 09:27:57 -08:00
mach-imx ARM: arm-soc: device tree conversions and enablement 2012-12-13 10:39:26 -08:00
mach-integrator ARM: arm-soc: SoC updates for 3.8 2012-12-12 12:05:15 -08:00
mach-iop13xx
mach-iop32x
mach-iop33x
mach-ixp4xx Merge branch 'for-linus' of git://git.linaro.org/people/rmk/linux-arm 2012-12-12 11:30:02 -08:00
mach-kirkwood ARM: arm-soc: Updates for Marvell mvebu/kirkwood 2012-12-14 14:54:26 -08:00
mach-ks8695
mach-l7200/include/mach
mach-lpc32xx ARM: LPC32xx: Add the motor PWM clock 2012-11-12 11:27:40 +01:00
mach-mmp ARM: mmp: select pinctrl driver 2012-11-21 13:18:04 +08:00
mach-msm
mach-mv78xx0
mach-mvebu arm: mvebu: add L2 cache support 2012-11-27 15:35:05 +00:00
mach-mxs ARM: mxs: Add SchulerControl SPS1 DTS file 2012-11-20 22:09:05 +08:00
mach-netx treewide: Fix typos in various drivers 2012-12-03 11:05:04 +01:00
mach-nomadik ARM: plat-nomadik: convert platforms to SPARSE_IRQ 2012-11-05 09:55:34 +01:00
mach-omap1 ARM: arm-soc: power management and clock changes 2012-12-13 10:58:20 -08:00
mach-omap2 ARM: OMAP4: Fix EMU clock domain always on 2012-12-15 01:35:54 -07:00
mach-orion5x arm: orion5x: convert 'LaCie Ethernet Disk mini v2' to Device Tree 2012-11-21 21:00:51 +00:00
mach-picoxcell
mach-prima2
mach-pxa Merge branch 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media 2012-12-13 19:22:22 -08:00
mach-realview ARM: 7594/1: Add .smp entry for REALVIEW_EB 2012-12-11 00:19:30 +00:00
mach-rpc
mach-s3c24xx Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial 2012-12-13 12:00:02 -08:00
mach-s3c64xx Sound updates for 3.8-rc1 2012-12-13 11:51:23 -08:00
mach-s3c2410
mach-s3c2412
mach-s3c2440
mach-s5p64x0 Sound updates for 3.8-rc1 2012-12-13 11:51:23 -08:00
mach-s5pc100 Merge remote-tracking branch 'asoc/topic/samsung' into asoc-next 2012-12-10 00:22:17 +09:00
mach-s5pv210 Sound updates for 3.8-rc1 2012-12-13 11:51:23 -08:00
mach-sa1100 ARM: move serial_sa1100.h header file to linux/platform_data 2012-11-16 11:35:29 +00:00
mach-shark
mach-shmobile ARM: arm-soc: SoC updates, take 2 2012-12-14 14:38:28 -08:00
mach-socfpga ARM: socfpga: mark secondary_trampoline as cpuinit 2012-11-06 23:14:49 +01:00
mach-spear3xx ARM: SPEAr3xx: Shirq: Move shirq controller out of plat/ 2012-11-26 16:55:33 +05:30
mach-spear6xx
mach-spear13xx ARM: SPEAr1310: Fix AUXDATA for compact flash controller 2012-11-26 16:55:31 +05:30
mach-sunxi ARM: sunxi: add missing include for mdelay() 2012-11-30 09:56:33 -08:00
mach-tegra Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial 2012-12-13 12:00:02 -08:00
mach-u300 ARM: arm-soc: Cleanups on various subarchitectures 2012-12-12 11:51:39 -08:00
mach-ux500 ARM: arm-soc: driver specific changes 2012-12-13 10:59:11 -08:00
mach-versatile ARM: plat-versatile: move FPGA irq driver to drivers/irqchip 2012-11-04 18:09:12 +01:00
mach-vexpress ARM: arm-soc: driver specific changes 2012-12-13 10:59:11 -08:00
mach-vt8500 ARM: arm-soc: multiplatform conversion patches 2012-12-13 10:57:16 -08:00
mach-w90x900
mach-zynq ARM: zynq: Remove all unused mach headers 2012-11-21 10:52:21 +01:00
mm ARM: arm-soc: Updates for Marvell mvebu/kirkwood 2012-12-14 14:54:26 -08:00
net Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2012-12-12 18:07:07 -08:00
nwfpe
oprofile
plat-iop
plat-mxc/devices ARM : i.MX27 : split code for allocation of ressources of camera and eMMA 2012-11-16 16:21:48 +01:00
plat-omap ARM: arm-soc: power management and clock changes 2012-12-13 10:58:20 -08:00
plat-orion ARM: arm-soc: Updates for Marvell mvebu/kirkwood 2012-12-14 14:54:26 -08:00
plat-pxa ARM: pxa: remove pxa95x support 2012-11-15 13:50:13 +01:00
plat-s3c24xx Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial 2012-12-13 12:00:02 -08:00
plat-samsung ARM: arm-soc: SoC updates, take 2 2012-12-14 14:38:28 -08:00
plat-spear ARM: SPEAr3xx: Shirq: Move shirq controller out of plat/ 2012-11-26 16:55:33 +05:30
plat-versatile ARM: arm-soc: SoC updates for 3.8 2012-12-12 12:05:15 -08:00
tools ARM: boot: Fix usage of kecho 2012-11-12 23:22:54 +01:00
vfp ARM: 7566/1: vfp: fix save and restore when running on pre-VFPv3 and CONFIG_VFPv3 set 2012-10-29 10:04:05 +00:00
xen Features: 2012-12-13 14:29:16 -08:00
Kconfig ARM: arm-soc: Updates for Marvell mvebu/kirkwood 2012-12-14 14:54:26 -08:00
Kconfig-nommu
Kconfig.debug ARM: arm-soc: multiplatform conversion patches 2012-12-13 10:57:16 -08:00
Makefile ARM: arm-soc: multiplatform conversion patches 2012-12-13 10:57:16 -08:00