kernel-ark/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
mach-bcm2835 ARM: arm-soc: SoC updates for 3.8 2012-12-12 12:05:15 -08:00
mach-clps711x
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
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
mach-mmp
mach-msm
mach-mv78xx0
mach-mvebu
mach-mxs
mach-netx
mach-nomadik
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
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
mach-s5pv210 Sound updates for 3.8-rc1 2012-12-13 11:51:23 -08:00
mach-sa1100
mach-shark
mach-shmobile ARM: arm-soc: SoC updates, take 2 2012-12-14 14:38:28 -08:00
mach-socfpga
mach-spear3xx
mach-spear6xx
mach-spear13xx
mach-sunxi
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
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
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
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
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
plat-versatile ARM: arm-soc: SoC updates for 3.8 2012-12-12 12:05:15 -08:00
tools
vfp
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