aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/platforms/pseries/setup.c
diff options
context:
space:
mode:
authorNicolas Pitre <nicolas.pitre@linaro.org>2014-01-29 12:45:10 -0500
committerIngo Molnar <mingo@kernel.org>2014-02-11 03:58:24 -0500
commitd8c6ad3184ca6516a5cf457af1afaa293d8f09c0 (patch)
treedd7c96a0808480aac612746a7747725794c11e24 /arch/powerpc/platforms/pseries/setup.c
parentad68cc7a777948b77f15a3dc3510918ff87ed0c0 (diff)
sched/idle, PPC: Remove redundant cpuidle_idle_call()
The core idle loop now takes care of it. However a few things need checking: - Invocation of cpuidle_idle_call() in pseries_lpar_idle() happened through arch_cpu_idle() and was therefore always preceded by a call to ppc64_runlatch_off(). To preserve this property now that cpuidle_idle_call() is invoked directly from core code, a call to ppc64_runlatch_off() has been added to idle_loop_prolog() in platforms/pseries/processor_idle.c. - Similarly, cpuidle_idle_call() was followed by ppc64_runlatch_off() so a call to the later has been added to idle_loop_epilog(). - And since arch_cpu_idle() always made sure to re-enable IRQs if they were not enabled, this is now done in idle_loop_epilog() as well. The above was made in order to keep the execution flow close to the original. I don't know if that was strictly necessary. Someone well aquainted with the platform details might find some room for possible optimizations. Signed-off-by: Nicolas Pitre <nico@linaro.org> Reviewed-by: Preeti U Murthy <preeti@linux.vnet.ibm.com> Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net> Cc: Daniel Lezcano <daniel.lezcano@linaro.org> Cc: linux-arm-kernel@lists.infradead.org Cc: linuxppc-dev@lists.ozlabs.org Cc: linux-sh@vger.kernel.org Cc: linux-pm@vger.kernel.org Cc: Russell King <linux@arm.linux.org.uk> Cc: linaro-kernel@lists.linaro.org Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Paul Mundt <lethal@linux-sh.org> Signed-off-by: Peter Zijlstra <peterz@infradead.org> Link: http://lkml.kernel.org/n/tip-47o4m03citrfg9y1vxic5asb@git.kernel.org Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'arch/powerpc/platforms/pseries/setup.c')
-rw-r--r--arch/powerpc/platforms/pseries/setup.c34
1 files changed, 14 insertions, 20 deletions
diff --git a/arch/powerpc/platforms/pseries/setup.c b/arch/powerpc/platforms/pseries/setup.c
index 8e639d7cbda7..c737d554571a 100644
--- a/arch/powerpc/platforms/pseries/setup.c
+++ b/arch/powerpc/platforms/pseries/setup.c
@@ -39,7 +39,6 @@
39#include <linux/irq.h> 39#include <linux/irq.h>
40#include <linux/seq_file.h> 40#include <linux/seq_file.h>
41#include <linux/root_dev.h> 41#include <linux/root_dev.h>
42#include <linux/cpuidle.h>
43#include <linux/of.h> 42#include <linux/of.h>
44#include <linux/kexec.h> 43#include <linux/kexec.h>
45 44
@@ -356,29 +355,24 @@ early_initcall(alloc_dispatch_log_kmem_cache);
356 355
357static void pseries_lpar_idle(void) 356static void pseries_lpar_idle(void)
358{ 357{
359 /* This would call on the cpuidle framework, and the back-end pseries 358 /*
360 * driver to go to idle states 359 * Default handler to go into low thread priority and possibly
360 * low power mode by cedeing processor to hypervisor
361 */ 361 */
362 if (cpuidle_idle_call()) {
363 /* On error, execute default handler
364 * to go into low thread priority and possibly
365 * low power mode by cedeing processor to hypervisor
366 */
367 362
368 /* Indicate to hypervisor that we are idle. */ 363 /* Indicate to hypervisor that we are idle. */
369 get_lppaca()->idle = 1; 364 get_lppaca()->idle = 1;
370 365
371 /* 366 /*
372 * Yield the processor to the hypervisor. We return if 367 * Yield the processor to the hypervisor. We return if
373 * an external interrupt occurs (which are driven prior 368 * an external interrupt occurs (which are driven prior
374 * to returning here) or if a prod occurs from another 369 * to returning here) or if a prod occurs from another
375 * processor. When returning here, external interrupts 370 * processor. When returning here, external interrupts
376 * are enabled. 371 * are enabled.
377 */ 372 */
378 cede_processor(); 373 cede_processor();
379 374
380 get_lppaca()->idle = 0; 375 get_lppaca()->idle = 0;
381 }
382} 376}
383 377
384/* 378/*