arm64: kernel: add CPU idle call
authorLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Wed, 17 Jul 2013 09:12:24 +0000 (10:12 +0100)
committerGreg Hackmann <ghackmann@google.com>
Tue, 29 Jul 2014 19:47:29 +0000 (12:47 -0700)
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 57bd961f29176002dd911e8991d462da924e1ec6..4e1cfd0f132b167983789df149c224cca2c22227 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>
@@ -107,8 +108,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