summaryrefslogtreecommitdiff
path: root/arch/sh/kernel/idle.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2009-06-23 18:52:16 (GMT)
committerLinus Torvalds <torvalds@linux-foundation.org>2009-06-23 18:52:16 (GMT)
commit626f380d0b264a1e40237f5a2a3dffc5d14f256e (patch)
tree456889d94d219628c225ccef3ad4f2af0475cbf4 /arch/sh/kernel/idle.c
parent32708e8e95265505d9627b3bc9ed16566e0dca1c (diff)
parentbb38c222e07cbe252cfbd99cd6a9c834b0a2639a (diff)
downloadlinux-fsl-qoriq-626f380d0b264a1e40237f5a2a3dffc5d14f256e.tar.xz
Merge git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6: sh: Fix up HAVE_PERF_COUNTERS typo. sh: Fix up more dma-mapping fallout. sh: SH7786 SMP support. sh: Wire up the uncached fixmap on sh64 as well. sh: Use local TLB flush in set_pte_phys(). sh: Provide cpu_idle_wait() to fix up cpuidle/SMP build.
Diffstat (limited to 'arch/sh/kernel/idle.c')
-rw-r--r--arch/sh/kernel/idle.c23
1 files changed, 22 insertions, 1 deletions
diff --git a/arch/sh/kernel/idle.c b/arch/sh/kernel/idle.c
index f35ed03..27ff2dc 100644
--- a/arch/sh/kernel/idle.c
+++ b/arch/sh/kernel/idle.c
@@ -1,7 +1,7 @@
/*
* The idle loop for all SuperH platforms.
*
- * Copyright (C) 2002 - 2008 Paul Mundt
+ * Copyright (C) 2002 - 2009 Paul Mundt
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
@@ -15,6 +15,7 @@
#include <linux/preempt.h>
#include <linux/thread_info.h>
#include <linux/irqflags.h>
+#include <linux/smp.h>
#include <asm/pgalloc.h>
#include <asm/system.h>
#include <asm/atomic.h>
@@ -79,3 +80,23 @@ void cpu_idle(void)
check_pgt_cache();
}
}
+
+static void do_nothing(void *unused)
+{
+}
+
+/*
+ * cpu_idle_wait - Used to ensure that all the CPUs discard old value of
+ * pm_idle and update to new pm_idle value. Required while changing pm_idle
+ * handler on SMP systems.
+ *
+ * Caller must have changed pm_idle to the new value before the call. Old
+ * pm_idle value will not be used by any CPU after the return of this function.
+ */
+void cpu_idle_wait(void)
+{
+ smp_mb();
+ /* kick all the CPUs so that they exit out of pm_idle */
+ smp_call_function(do_nothing, NULL, 1);
+}
+EXPORT_SYMBOL_GPL(cpu_idle_wait);