From b0c673e40d40428a9bd05101d15d773cd4f4720c Mon Sep 17 00:00:00 2001
From: Ranjith Lohithakshan <unknown@ti.com>
Date: Sat, 22 May 2010 18:32:24 +0200
Subject: [PATCH 46/48] attemp to fix serial console corruption during cpuidle

---
 arch/arm/mach-omap2/cpuidle34xx.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/arch/arm/mach-omap2/cpuidle34xx.c b/arch/arm/mach-omap2/cpuidle34xx.c
index f8aea56..35d1c3e 100644
--- a/arch/arm/mach-omap2/cpuidle34xx.c
+++ b/arch/arm/mach-omap2/cpuidle34xx.c
@@ -60,7 +60,7 @@ struct omap3_processor_cx {
 
 struct omap3_processor_cx omap3_power_states[OMAP3_MAX_STATES];
 struct omap3_processor_cx current_cx_state;
-struct powerdomain *mpu_pd, *core_pd;
+struct powerdomain *mpu_pd, *per_pd, *core_pd;
 
 /*
  * The latencies/thresholds for various C states have
@@ -131,6 +131,7 @@ static int omap3_enter_idle(struct cpuidle_device *dev,
 	local_fiq_disable();
 
 	pwrdm_set_next_pwrst(mpu_pd, mpu_state);
+	pwrdm_set_next_pwrst(per_pd, mpu_state);
 	pwrdm_set_next_pwrst(core_pd, core_state);
 
 	if (omap_irq_pending() || need_resched())
@@ -138,6 +139,7 @@ static int omap3_enter_idle(struct cpuidle_device *dev,
 
 	if (cx->type == OMAP3_STATE_C1) {
 		pwrdm_for_each_clkdm(mpu_pd, _cpuidle_deny_idle);
+		pwrdm_for_each_clkdm(per_pd, _cpuidle_deny_idle);
 		pwrdm_for_each_clkdm(core_pd, _cpuidle_deny_idle);
 	}
 
@@ -146,6 +148,7 @@ static int omap3_enter_idle(struct cpuidle_device *dev,
 
 	if (cx->type == OMAP3_STATE_C1) {
 		pwrdm_for_each_clkdm(mpu_pd, _cpuidle_allow_idle);
+		pwrdm_for_each_clkdm(per_pd, _cpuidle_allow_idle);
 		pwrdm_for_each_clkdm(core_pd, _cpuidle_allow_idle);
 	}
 
@@ -425,6 +428,7 @@ int __init omap3_idle_init(void)
 	struct cpuidle_device *dev;
 
 	mpu_pd = pwrdm_lookup("mpu_pwrdm");
+	per_pd = pwrdm_lookup("per_pwrdm");
 	core_pd = pwrdm_lookup("core_pwrdm");
 
 	omap_init_power_states();
-- 
1.6.6.1

