diff options
author | Kevin Hilman <khilman@ti.com> | 2012-08-07 14:28:06 -0400 |
---|---|---|
committer | Kevin Hilman <khilman@ti.com> | 2012-08-07 18:44:51 -0400 |
commit | e0e29fd74c3c8bd2ef83bbaa73d528d58a944610 (patch) | |
tree | e4c11c5bead94a2dcf579ab2526d6054f8009930 /arch | |
parent | 265a2bc84247c9b9e3bb4fe275f16ba99551a7e7 (diff) |
Revert "ARM: OMAP3: PM: call pre/post transition per powerdomain"
This reverts commit 58f0829b7186150318c79515f0e0850c5e7a9c89.
Converstion to per-pwrdm per/post transition calls was a bit
premature. Only tracking MPU, PER & CORE in the idle path means we
lose the accounting for all the other powerdomains which may also
transition in idle. On OMAP3, due to autodeps, several powerdomains
transition along with MPU (e.g. DSS, USBHOST), and the accounting for
these was lost with this patch. Since the accounting includes the
context loss counters, drivers for devices in those power domains
would never notice context lost, so would likely hang after any
off-mode transitions.
This patch should be revisited when the upcoming clkdm/pwrmdm/voltdm
use-counting seires is merged since then we can properly do accounting
without relying on a call in the idle path.
In addition, the original patch had another bug because the PER
powerdomain accounting was not updated until after the GPIO resume
hook is called. Since gpio_resume_after_idle() checks the context
loss count (which is not yet updated) it would not properly restore
context, leaving the GPIO banks in an undefined state.
Cc: Jean Pihet <jean.pihet@newoldbits.com>
Cc: Tero Kristo <t-kristo@ti.com>
Cc: Rajendra Nayak <rnayak@ti.com>
Reported-by: Paul Walmsley <paul@pwsan.com>
Signed-off-by: Kevin Hilman <khilman@ti.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/mach-omap2/pm34xx.c | 19 |
1 files changed, 4 insertions, 15 deletions
diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c index e4fc88c65dbd..05bd8f02723f 100644 --- a/arch/arm/mach-omap2/pm34xx.c +++ b/arch/arm/mach-omap2/pm34xx.c | |||
@@ -272,21 +272,16 @@ void omap_sram_idle(void) | |||
272 | per_next_state = pwrdm_read_next_pwrst(per_pwrdm); | 272 | per_next_state = pwrdm_read_next_pwrst(per_pwrdm); |
273 | core_next_state = pwrdm_read_next_pwrst(core_pwrdm); | 273 | core_next_state = pwrdm_read_next_pwrst(core_pwrdm); |
274 | 274 | ||
275 | if (mpu_next_state < PWRDM_POWER_ON) { | 275 | pwrdm_pre_transition(NULL); |
276 | pwrdm_pre_transition(mpu_pwrdm); | ||
277 | pwrdm_pre_transition(neon_pwrdm); | ||
278 | } | ||
279 | 276 | ||
280 | /* PER */ | 277 | /* PER */ |
281 | if (per_next_state < PWRDM_POWER_ON) { | 278 | if (per_next_state < PWRDM_POWER_ON) { |
282 | pwrdm_pre_transition(per_pwrdm); | ||
283 | per_going_off = (per_next_state == PWRDM_POWER_OFF) ? 1 : 0; | 279 | per_going_off = (per_next_state == PWRDM_POWER_OFF) ? 1 : 0; |
284 | omap2_gpio_prepare_for_idle(per_going_off); | 280 | omap2_gpio_prepare_for_idle(per_going_off); |
285 | } | 281 | } |
286 | 282 | ||
287 | /* CORE */ | 283 | /* CORE */ |
288 | if (core_next_state < PWRDM_POWER_ON) { | 284 | if (core_next_state < PWRDM_POWER_ON) { |
289 | pwrdm_pre_transition(core_pwrdm); | ||
290 | if (core_next_state == PWRDM_POWER_OFF) { | 285 | if (core_next_state == PWRDM_POWER_OFF) { |
291 | omap3_core_save_context(); | 286 | omap3_core_save_context(); |
292 | omap3_cm_save_context(); | 287 | omap3_cm_save_context(); |
@@ -339,20 +334,14 @@ void omap_sram_idle(void) | |||
339 | omap2_prm_clear_mod_reg_bits(OMAP3430_AUTO_OFF_MASK, | 334 | omap2_prm_clear_mod_reg_bits(OMAP3430_AUTO_OFF_MASK, |
340 | OMAP3430_GR_MOD, | 335 | OMAP3430_GR_MOD, |
341 | OMAP3_PRM_VOLTCTRL_OFFSET); | 336 | OMAP3_PRM_VOLTCTRL_OFFSET); |
342 | pwrdm_post_transition(core_pwrdm); | ||
343 | } | 337 | } |
344 | omap3_intc_resume_idle(); | 338 | omap3_intc_resume_idle(); |
345 | 339 | ||
340 | pwrdm_post_transition(NULL); | ||
341 | |||
346 | /* PER */ | 342 | /* PER */ |
347 | if (per_next_state < PWRDM_POWER_ON) { | 343 | if (per_next_state < PWRDM_POWER_ON) |
348 | omap2_gpio_resume_after_idle(); | 344 | omap2_gpio_resume_after_idle(); |
349 | pwrdm_post_transition(per_pwrdm); | ||
350 | } | ||
351 | |||
352 | if (mpu_next_state < PWRDM_POWER_ON) { | ||
353 | pwrdm_post_transition(mpu_pwrdm); | ||
354 | pwrdm_post_transition(neon_pwrdm); | ||
355 | } | ||
356 | } | 345 | } |
357 | 346 | ||
358 | static void omap3_pm_idle(void) | 347 | static void omap3_pm_idle(void) |