← Back to team overview

linaro-pm-wg team mailing list archive

Re: [Bug 1171382] Re: exynos4: cpuidle does never enter AFTR state

 

On Mon, 2013-04-22 at 18:56 +0530, Amit Kucheria wrote:
> Tixy, Any theories?

Theories:

1. The value of s3c_cpu_resume will have bit 0 set to indicate Thumb
code and the bootloader doesn't cope with that, e.g. when looking for
the magic 0x2bedf00d value before that address.

2. The bootloader calls s3c_cpu_resume in ARM mode, not thumb mode. Not
likely, because in ARMv7 I believe most (all?) methods of branching to
an address now switch from ARM to Thumb mode if bit zero is set. If
s3c_cpu_resume is getting called in ARM mode you could try pinching the
code from the boot entrypoint 'stext' from arch/arm/kernel/head.S. I.e.
replace "ENTRY(s3c_cpu_resume)" in s5p-sleep.S with:

	.arm
ENTRY(s3c_cpu_resume)
 THUMB(	adr	r9, BSYM(1f)	)	@ Kernel is always entered in ARM.
 THUMB(	bx	r9		)	@ If this is a Thumb-2 kernel,
 THUMB(	.thumb			)	@ switch to Thumb now.
 THUMB(1:

The above will also be needed if theory 1. is the problem and you work
around it by clearing bit zero of the address.

3. Another (unlikely) theory is that the "b ." in the code in bug
comment #1 may not do what we expect, you could try:

1:
	b	1b

-- 
Tixy

-- 
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 with
  CONFIG_THUMB2_KERNEL=y

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