Comment 1 for bug 1171382

Revision history for this message
Chander Mohan Kashyap (chander-kashyap) wrote : Re: exynos4: cpuidle does never enter AFTR state

It is working as per expectations. cpu_suspend never returns in successful scenario. To test it please do the following:
1:
Apply the following patch: By this patch we can see the actual numbers of AFTER state.

diff --git a/arch/arm/mach-exynos/cpuidle.c b/arch/arm/mach-exynos/cpuidle.c
index cff0595..3bcf7c2 100644
--- a/arch/arm/mach-exynos/cpuidle.c
+++ b/arch/arm/mach-exynos/cpuidle.c
@@ -85,9 +85,11 @@ static void restore_cpu_arch_register(void)
        return;
 }

+static int counter;
 static int idle_finisher(unsigned long flags)
 {
        cpu_do_idle();
+ counter --;
        return 1;
 }

@@ -112,6 +114,7 @@ static int exynos4_enter_core0_aftr(struct cpuidle_device *dev,
        tmp &= ~S5P_CENTRAL_LOWPWR_CFG;
        __raw_writel(tmp, S5P_CENTRAL_SEQ_CONFIGURATION);

+ counter ++;
        cpu_pm_enter();
        cpu_suspend(0, idle_finisher);

@@ -119,7 +122,7 @@ static int exynos4_enter_core0_aftr(struct cpuidle_device *dev,
        scu_enable(S5P_VA_SCU);
 #endif
        cpu_pm_exit();
-
+ printk("\n Actual Counter = %d \n", counter);
        restore_cpu_arch_register();

        /*

2:
Applying this patch we can confirm that AFTR works, as system will hang when it enters the AFTR state.

--- a/arch/arm/plat-samsung/s5p-sleep.S
+++ b/arch/arm/plat-samsung/s5p-sleep.S
@@ -71,6 +71,7 @@ ENTRY(s3c_cpu_resume)
        str r2, [r1, #L2X0_CTRL]
 resume_l2on:
 #endif
+ b .
        b cpu_resume
 ENDPROC(s3c_cpu_resume)
 #ifdef CONFIG_CACHE_L2X0