← Back to team overview

linaro-pm-wg team mailing list archive

[Bug 1171382] 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

-- 
You received this bug notification because you are a member of Linaro
Power Management Working Group, which is subscribed to Linaro PMWG
Kernel.
https://bugs.launchpad.net/bugs/1171382

Title:
  exynos4: cpuidle does never enter AFTR state

Status in Kernel related development for Power Management Working Group:
  New

Bug description:
  Despite the cpuidle framework choose the state1 for exynos which is
  the AFTR state, the cpu_suspend returns always true, meaning the AFTR
  shutdown sequence has been aborted and the cpu0 was never off.

  How to reproduce ?

  Go to the tag: tracking-mainline-linux-linaro-core-3.7-20130103.0

  Add a trace in the cpuidle driver:

  diff --git a/arch/arm/mach-exynos/cpuidle.c b/arch/arm/mach-exynos/cpuidle.c
  index cff0595..73b3d17 100644
  --- a/arch/arm/mach-exynos/cpuidle.c
  +++ b/arch/arm/mach-exynos/cpuidle.c
  @@ -113,7 +113,8 @@ static int exynos4_enter_core0_aftr(struct cpuidle_device *dev,
          __raw_writel(tmp, S5P_CENTRAL_SEQ_CONFIGURATION);
   
          cpu_pm_enter();
  -       cpu_suspend(0, idle_finisher);
  +       if (!cpu_suspend(0, idle_finisher))
  +               printk(KERN_ERR "cpu_suspend succeed\n");
   
   #ifdef CONFIG_SMP
          scu_enable(S5P_VA_SCU);

  Offline cpu1 and wait for this trace, it will never come.

To manage notifications about this bug go to:
https://bugs.launchpad.net/linaro-power-kernel/+bug/1171382/+subscriptions


References