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
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 arm/mach- exynos/ cpuidle. c arm/mach- exynos/ cpuidle. c cpu_arch_ register( void)
index cff0595..3bcf7c2 100644
--- a/arch/
+++ b/arch/
@@ -85,9 +85,11 @@ static void restore_
return;
}
+static int counter; unsigned long flags)
cpu_do_ idle();
static int idle_finisher(
{
+ counter --;
return 1;
}
@@ -112,6 +114,7 @@ static int exynos4_ enter_core0_ aftr(struct cpuidle_device *dev, LOWPWR_ CFG;
__raw_ writel( tmp, S5P_CENTRAL_ SEQ_CONFIGURATI ON);
tmp &= ~S5P_CENTRAL_
+ 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);
cpu_pm_ exit();
restore_ cpu_arch_ register( );
#endif
-
+ printk("\n Actual Counter = %d \n", counter);
/*
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 arm/plat- samsung/ s5p-sleep. S cpu_resume) s3c_cpu_ resume)
+++ b/arch/
@@ -71,6 +71,7 @@ ENTRY(s3c_
str r2, [r1, #L2X0_CTRL]
resume_l2on:
#endif
+ b .
b cpu_resume
ENDPROC(
#ifdef CONFIG_CACHE_L2X0