diff options
author | Rajendra Nayak <rnayak@ti.com> | 2011-07-10 07:56:55 -0400 |
---|---|---|
committer | Paul Walmsley <paul@pwsan.com> | 2011-07-10 07:56:55 -0400 |
commit | 555e74ea08bfc04a0136f976cbaa200addf1ba87 (patch) | |
tree | afac050a2669fcf1e47d764785f9007c568b9e15 /arch/arm/mach-omap2/clockdomain44xx.c | |
parent | b86cfb52a145d8ddad66b98c39c6764f3883cd5a (diff) |
OMAP2+: clockdomain: Add per clkdm lock to prevent concurrent state programming
Since the clkdm state programming is now done from within the hwmod
framework (which uses a per-hwmod lock) instead of the being done
from the clock framework (which used a global lock), there is now a
need to have per-clkdm locking to prevent races between different
hwmods/modules belonging to the same clock domain concurrently
programming the clkdm state.
Signed-off-by: Rajendra Nayak <rnayak@ti.com>
Signed-off-by: Benoit Cousson <b-cousson@ti.com>
Cc: Paul Walmsley <paul@pwsan.com>
Signed-off-by: Paul Walmsley <paul@pwsan.com>
Diffstat (limited to 'arch/arm/mach-omap2/clockdomain44xx.c')
-rw-r--r-- | arch/arm/mach-omap2/clockdomain44xx.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/arch/arm/mach-omap2/clockdomain44xx.c b/arch/arm/mach-omap2/clockdomain44xx.c index a1a4ecd26544..b43706aa08bd 100644 --- a/arch/arm/mach-omap2/clockdomain44xx.c +++ b/arch/arm/mach-omap2/clockdomain44xx.c | |||
@@ -95,13 +95,8 @@ static void omap4_clkdm_deny_idle(struct clockdomain *clkdm) | |||
95 | 95 | ||
96 | static int omap4_clkdm_clk_enable(struct clockdomain *clkdm) | 96 | static int omap4_clkdm_clk_enable(struct clockdomain *clkdm) |
97 | { | 97 | { |
98 | bool hwsup = false; | 98 | if (clkdm->flags & CLKDM_CAN_FORCE_WAKEUP) |
99 | 99 | return omap4_clkdm_wakeup(clkdm); | |
100 | hwsup = omap4_cminst_is_clkdm_in_hwsup(clkdm->prcm_partition, | ||
101 | clkdm->cm_inst, clkdm->clkdm_offs); | ||
102 | |||
103 | if (!hwsup) | ||
104 | clkdm_wakeup(clkdm); | ||
105 | 100 | ||
106 | return 0; | 101 | return 0; |
107 | } | 102 | } |
@@ -113,8 +108,8 @@ static int omap4_clkdm_clk_disable(struct clockdomain *clkdm) | |||
113 | hwsup = omap4_cminst_is_clkdm_in_hwsup(clkdm->prcm_partition, | 108 | hwsup = omap4_cminst_is_clkdm_in_hwsup(clkdm->prcm_partition, |
114 | clkdm->cm_inst, clkdm->clkdm_offs); | 109 | clkdm->cm_inst, clkdm->clkdm_offs); |
115 | 110 | ||
116 | if (!hwsup) | 111 | if (!hwsup && (clkdm->flags & CLKDM_CAN_FORCE_SLEEP)) |
117 | clkdm_sleep(clkdm); | 112 | omap4_clkdm_sleep(clkdm); |
118 | 113 | ||
119 | return 0; | 114 | return 0; |
120 | } | 115 | } |