arm64: kernel: add CPU idle call
authorLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Wed, 17 Jul 2013 09:12:24 +0000 (10:12 +0100)
committerLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Mon, 16 Dec 2013 17:17:35 +0000 (17:17 +0000)
When CPU idle is enabled, the architectural idle call should go through
the idle subsystem to allow CPUs to enter idle states defined
by the platform CPU idle back-end operations.

This patch, mirroring other archs behaviour, adds the CPU idle call to the
architectural arch_cpu_idle implementation for arm64.

Acked-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
arch/arm64/kernel/process.c

index de17c89985dbe6c69aecbb8248155f439fc41c11..50491ec4de34a5f291a04ed5cde3b3b47220bc66 100644 (file)
@@ -33,6 +33,7 @@
 #include <linux/kallsyms.h>
 #include <linux/init.h>
 #include <linux/cpu.h>
+#include <linux/cpuidle.h>
 #include <linux/elfcore.h>
 #include <linux/pm.h>
 #include <linux/tick.h>
@@ -98,8 +99,10 @@ void arch_cpu_idle(void)
         * This should do all the clock switching and wait for interrupt
         * tricks
         */
-       cpu_do_idle();
-       local_irq_enable();
+       if (cpuidle_idle_call()) {
+               cpu_do_idle();
+               local_irq_enable();
+       }
 }
 
 #ifdef CONFIG_HOTPLUG_CPU