linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/4] ARM: exynos: cpuidle: Fallback to WFI, when AFTR is selected
@ 2013-07-18 12:54 Daniel Lezcano
  2013-07-18 12:54 ` [PATCH 2/4] ARM: exynos: cpuidle: Use the common cpuidle register routine Daniel Lezcano
                   ` (3 more replies)
  0 siblings, 4 replies; 12+ messages in thread
From: Daniel Lezcano @ 2013-07-18 12:54 UTC (permalink / raw)
  To: linux-arm-kernel

When there are several cpus online, the AFTR state does not work.

The AFTR must be selected only when there is one cpu online.

The previous code was already handling this case.

Simplified the code, especially the init routine to have the same init
pattern than the other drivers.

Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 arch/arm/mach-exynos/cpuidle.c |   13 ++-----------
 1 file changed, 2 insertions(+), 11 deletions(-)

diff --git a/arch/arm/mach-exynos/cpuidle.c b/arch/arm/mach-exynos/cpuidle.c
index 17a18ff..cc4b097 100644
--- a/arch/arm/mach-exynos/cpuidle.c
+++ b/arch/arm/mach-exynos/cpuidle.c
@@ -147,16 +147,11 @@ static int exynos4_enter_lowpower(struct cpuidle_device *dev,
 				struct cpuidle_driver *drv,
 				int index)
 {
-	int new_index = index;
-
 	/* This mode only can be entered when other core's are offline */
 	if (num_online_cpus() > 1)
-		new_index = drv->safe_state_index;
+		return drv->states[0].enter(dev, drv, 0);
 
-	if (new_index == 0)
-		return arm_cpuidle_simple_enter(dev, drv, new_index);
-	else
-		return exynos4_enter_core0_aftr(dev, drv, new_index);
+	return exynos4_enter_core0_aftr(dev, drv, index);
 }
 
 static void __init exynos5_core_down_clk(void)
@@ -209,10 +204,6 @@ static int __init exynos4_init_cpuidle(void)
 		device = &per_cpu(exynos4_cpuidle_device, cpu_id);
 		device->cpu = cpu_id;
 
-		/* Support IDLE only */
-		if (cpu_id != 0)
-			device->state_count = 1;
-
 		ret = cpuidle_register_device(device);
 		if (ret) {
 			printk(KERN_ERR "CPUidle register device failed\n");
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2013-07-24 15:16 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-07-18 12:54 [PATCH 1/4] ARM: exynos: cpuidle: Fallback to WFI, when AFTR is selected Daniel Lezcano
2013-07-18 12:54 ` [PATCH 2/4] ARM: exynos: cpuidle: Use the common cpuidle register routine Daniel Lezcano
2013-07-19 16:03   ` Bartlomiej Zolnierkiewicz
2013-07-22  4:36     ` Daniel Lezcano
2013-07-22  9:35       ` Bartlomiej Zolnierkiewicz
2013-07-24  8:36   ` Tomasz Figa
2013-07-18 12:54 ` [PATCH 3/4] ARM: exynos: cpuidle: Move exynos4_idle_driver declaration below in the code Daniel Lezcano
2013-07-24  8:34   ` Tomasz Figa
2013-07-18 12:54 ` [PATCH 4/4] ARM: exynos: cpuidle: Remove useless headers Daniel Lezcano
2013-07-24  8:35   ` Tomasz Figa
2013-07-24  8:32 ` [PATCH 1/4] ARM: exynos: cpuidle: Fallback to WFI, when AFTR is selected Tomasz Figa
2013-07-24 15:16   ` Bartlomiej Zolnierkiewicz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).