OMAP clockdomains: add usecounting for wakeup and sleep dependencies
authorPaul Walmsley <paul@pwsan.com>
Wed, 27 Jan 2010 03:13:01 +0000 (20:13 -0700)
committerPaul Walmsley <paul@pwsan.com>
Wed, 27 Jan 2010 03:13:01 +0000 (20:13 -0700)
commit369d5614457384edcf62c5f39b03dd20be6ea1df
tree4ad04d48f3049ff2d88e8ddca35fb0ad8597d12c
parente909d62a8afda7a224a7e322cf2f387d69ca771f
OMAP clockdomains: add usecounting for wakeup and sleep dependencies

Add usecounting for wakeup and sleep dependencies.  In the current
situation, if several functions add dependencies on the same
clockdomains, when the first dependency removal function is called,
the dependency will be incorrectly removed from the hardware.

Add clkdm_clear_all_wkdeps() and clkdm_clear_all_sleepdeps(), which
provide a fast and usecounting-consistent way to clear all hardware
clockdomain dependencies, since accesses to these registers can be
quite slow.  pm{2,3}4xx.c has been updated to use these new functions.
The original version of this patch did not touch these files, which
previously wrote directly to the wkdep registers, and thus confused
the usecounting code.  This problem was found by Kevin Hilman
<khilman@deeprootsystems.com>.

N.B.: This patch introduces one significant functional difference over
the previous pm34xx.c code: sleepdeps are now cleared during
clockdomain initialization, whereas previously they were left
untouched.  This has been tested by Kevin and confirmed to work.

The original version of this patch also did not take into
consideration that some clockdomains do not have sleep or wakeup
dependency sources, which caused NULL pointer dereferences.  This
problem was debugged and fixed by Kevin Hilman
<khilman@deeprootsystems.com>.

Signed-off-by: Paul Walmsley <paul@pwsan.com>
Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
Cc: Jouni Högander <jouni.hogander@nokia.com>
arch/arm/mach-omap2/clockdomain.c
arch/arm/mach-omap2/pm24xx.c
arch/arm/mach-omap2/pm34xx.c
arch/arm/plat-omap/include/plat/clockdomain.h
This page took 0.025328 seconds and 5 git commands to generate.