--- /dev/null
+From 4c94cada48f7c660eca582be6032427a5e367117 Mon Sep 17 00:00:00 2001
+From: Frederic Weisbecker <fweisbec@gmail.com>
+Date: Wed, 22 Aug 2012 17:27:34 +0200
+Subject: alpha: Add missing RCU idle APIs on idle loop
+
+From: Frederic Weisbecker <fweisbec@gmail.com>
+
+commit 4c94cada48f7c660eca582be6032427a5e367117 upstream.
+
+In the old times, the whole idle task was considered
+as an RCU quiescent state. But as RCU became more and
+more successful overtime, some RCU read side critical
+section have been added even in the code of some
+architectures idle tasks, for tracing for example.
+
+So nowadays, rcu_idle_enter() and rcu_idle_exit() must
+be called by the architecture to tell RCU about the part
+in the idle loop that doesn't make use of rcu read side
+critical sections, typically the part that puts the CPU
+in low power mode.
+
+This is necessary for RCU to find the quiescent states in
+idle in order to complete grace periods.
+
+Add this missing pair of calls in the Alpha's idle loop.
+
+Reported-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
+Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
+Tested-by: Michael Cree <mcree@orcon.net.nz>
+Cc: Richard Henderson <rth@twiddle.net>
+Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
+Cc: Matt Turner <mattst88@gmail.com>
+Cc: alpha <linux-alpha@vger.kernel.org>
+Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
+Reviewed-by: Josh Triplett <josh@joshtriplett.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ arch/alpha/kernel/process.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+--- a/arch/alpha/kernel/process.c
++++ b/arch/alpha/kernel/process.c
+@@ -28,6 +28,7 @@
+ #include <linux/tty.h>
+ #include <linux/console.h>
+ #include <linux/slab.h>
++#include <linux/rcupdate.h>
+
+ #include <asm/reg.h>
+ #include <asm/uaccess.h>
+@@ -54,8 +55,11 @@ cpu_idle(void)
+ /* FIXME -- EV6 and LCA45 know how to power down
+ the CPU. */
+
++ rcu_idle_enter();
+ while (!need_resched())
+ cpu_relax();
++
++ rcu_idle_exit();
+ schedule();
+ }
+ }
--- /dev/null
+From c633f9e788928e91ad11f44df29b47bbbe9550b0 Mon Sep 17 00:00:00 2001
+From: Frederic Weisbecker <fweisbec@gmail.com>
+Date: Wed, 22 Aug 2012 17:27:34 +0200
+Subject: cris: Add missing RCU idle APIs on idle loop
+
+From: Frederic Weisbecker <fweisbec@gmail.com>
+
+commit c633f9e788928e91ad11f44df29b47bbbe9550b0 upstream.
+
+In the old times, the whole idle task was considered
+as an RCU quiescent state. But as RCU became more and
+more successful overtime, some RCU read side critical
+section have been added even in the code of some
+architectures idle tasks, for tracing for example.
+
+So nowadays, rcu_idle_enter() and rcu_idle_exit() must
+be called by the architecture to tell RCU about the part
+in the idle loop that doesn't make use of rcu read side
+critical sections, typically the part that puts the CPU
+in low power mode.
+
+This is necessary for RCU to find the quiescent states in
+idle in order to complete grace periods.
+
+Add this missing pair of calls in the Cris's idle loop.
+
+Reported-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
+Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
+Cc: Mikael Starvik <starvik@axis.com>
+Cc: Jesper Nilsson <jesper.nilsson@axis.com>
+Cc: Cris <linux-cris-kernel@axis.com>
+Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
+Reviewed-by: Josh Triplett <josh@joshtriplett.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ arch/cris/kernel/process.c | 3 +++
+ 1 file changed, 3 insertions(+)
+
+--- a/arch/cris/kernel/process.c
++++ b/arch/cris/kernel/process.c
+@@ -25,6 +25,7 @@
+ #include <linux/elfcore.h>
+ #include <linux/mqueue.h>
+ #include <linux/reboot.h>
++#include <linux/rcupdate.h>
+
+ //#define DEBUG
+
+@@ -102,6 +103,7 @@ void cpu_idle (void)
+ {
+ /* endless idle loop with no priority at all */
+ while (1) {
++ rcu_idle_enter();
+ while (!need_resched()) {
+ void (*idle)(void);
+ /*
+@@ -114,6 +116,7 @@ void cpu_idle (void)
+ idle = default_idle;
+ idle();
+ }
++ rcu_idle_exit();
+ schedule_preempt_disabled();
+ }
+ }
--- /dev/null
+From 41d8fe5bb3cf91ce2716ac8f43e4b40d802a99c8 Mon Sep 17 00:00:00 2001
+From: Frederic Weisbecker <fweisbec@gmail.com>
+Date: Wed, 22 Aug 2012 17:27:34 +0200
+Subject: frv: Add missing RCU idle APIs on idle loop
+
+From: Frederic Weisbecker <fweisbec@gmail.com>
+
+commit 41d8fe5bb3cf91ce2716ac8f43e4b40d802a99c8 upstream.
+
+In the old times, the whole idle task was considered
+as an RCU quiescent state. But as RCU became more and
+more successful overtime, some RCU read side critical
+section have been added even in the code of some
+architectures idle tasks, for tracing for example.
+
+So nowadays, rcu_idle_enter() and rcu_idle_exit() must
+be called by the architecture to tell RCU about the part
+in the idle loop that doesn't make use of rcu read side
+critical sections, typically the part that puts the CPU
+in low power mode.
+
+This is necessary for RCU to find the quiescent states in
+idle in order to complete grace periods.
+
+Add this missing pair of calls in the Frv's idle loop.
+
+Reported-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
+Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
+Cc: David Howells <dhowells@redhat.com>
+Acked-by: David Howells <dhowells@redhat.com>
+Reviewed-by: Josh Triplett <josh@joshtriplett.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ arch/frv/kernel/process.c | 3 +++
+ 1 file changed, 3 insertions(+)
+
+--- a/arch/frv/kernel/process.c
++++ b/arch/frv/kernel/process.c
+@@ -25,6 +25,7 @@
+ #include <linux/reboot.h>
+ #include <linux/interrupt.h>
+ #include <linux/pagemap.h>
++#include <linux/rcupdate.h>
+
+ #include <asm/asm-offsets.h>
+ #include <asm/uaccess.h>
+@@ -84,12 +85,14 @@ void cpu_idle(void)
+ {
+ /* endless idle loop with no priority at all */
+ while (1) {
++ rcu_idle_enter();
+ while (!need_resched()) {
+ check_pgt_cache();
+
+ if (!frv_dma_inprogress && idle)
+ idle();
+ }
++ rcu_idle_exit();
+
+ schedule_preempt_disabled();
+ }
--- /dev/null
+From b2fe1430d4115c74d007c825cb9dc3317f28bb16 Mon Sep 17 00:00:00 2001
+From: Frederic Weisbecker <fweisbec@gmail.com>
+Date: Wed, 22 Aug 2012 17:27:34 +0200
+Subject: h8300: Add missing RCU idle APIs on idle loop
+
+From: Frederic Weisbecker <fweisbec@gmail.com>
+
+commit b2fe1430d4115c74d007c825cb9dc3317f28bb16 upstream.
+
+In the old times, the whole idle task was considered
+as an RCU quiescent state. But as RCU became more and
+more successful overtime, some RCU read side critical
+section have been added even in the code of some
+architectures idle tasks, for tracing for example.
+
+So nowadays, rcu_idle_enter() and rcu_idle_exit() must
+be called by the architecture to tell RCU about the part
+in the idle loop that doesn't make use of rcu read side
+critical sections, typically the part that puts the CPU
+in low power mode.
+
+This is necessary for RCU to find the quiescent states in
+idle in order to complete grace periods.
+
+Add this missing pair of calls in the h8300's idle loop.
+
+Reported-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
+Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
+Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
+Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
+Reviewed-by: Josh Triplett <josh@joshtriplett.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ arch/h8300/kernel/process.c | 3 +++
+ 1 file changed, 3 insertions(+)
+
+--- a/arch/h8300/kernel/process.c
++++ b/arch/h8300/kernel/process.c
+@@ -36,6 +36,7 @@
+ #include <linux/reboot.h>
+ #include <linux/fs.h>
+ #include <linux/slab.h>
++#include <linux/rcupdate.h>
+
+ #include <asm/uaccess.h>
+ #include <asm/traps.h>
+@@ -78,8 +79,10 @@ void (*idle)(void) = default_idle;
+ void cpu_idle(void)
+ {
+ while (1) {
++ rcu_idle_enter();
+ while (!need_resched())
+ idle();
++ rcu_idle_exit();
+ schedule_preempt_disabled();
+ }
+ }
--- /dev/null
+From 93482f4ef1093f5961a63359a34612183d6beea0 Mon Sep 17 00:00:00 2001
+From: "Paul E. McKenney" <paul.mckenney@linaro.org>
+Date: Fri, 24 Aug 2012 13:22:13 -0700
+Subject: ia64: Add missing RCU idle APIs on idle loop
+
+From: "Paul E. McKenney" <paul.mckenney@linaro.org>
+
+commit 93482f4ef1093f5961a63359a34612183d6beea0 upstream.
+
+Traditionally, the entire idle task served as an RCU quiescent state.
+But when RCU read side critical sections started appearing within the
+idle loop, this traditional strategy became untenable. The fix was to
+create new RCU APIs named rcu_idle_enter() and rcu_idle_exit(), which
+must be called by each architecture's idle loop so that RCU can tell
+when it is safe to ignore a given idle CPU.
+
+Unfortunately, this fix was never applied to ia64, a shortcoming remedied
+by this commit.
+
+Reported by: Tony Luck <tony.luck@intel.com>
+Signed-off-by: Paul E. McKenney <paul.mckenney@linaro.org>
+Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
+Tested by: Tony Luck <tony.luck@intel.com>
+Reviewed-by: Josh Triplett <josh@joshtriplett.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ arch/ia64/kernel/process.c | 3 +++
+ 1 file changed, 3 insertions(+)
+
+--- a/arch/ia64/kernel/process.c
++++ b/arch/ia64/kernel/process.c
+@@ -29,6 +29,7 @@
+ #include <linux/kdebug.h>
+ #include <linux/utsname.h>
+ #include <linux/tracehook.h>
++#include <linux/rcupdate.h>
+
+ #include <asm/cpu.h>
+ #include <asm/delay.h>
+@@ -301,6 +302,7 @@ cpu_idle (void)
+
+ /* endless idle loop with no priority at all */
+ while (1) {
++ rcu_idle_enter();
+ if (can_do_pal_halt) {
+ current_thread_info()->status &= ~TS_POLLING;
+ /*
+@@ -331,6 +333,7 @@ cpu_idle (void)
+ normal_xtp();
+ #endif
+ }
++ rcu_idle_exit();
+ schedule_preempt_disabled();
+ check_pgt_cache();
+ if (cpu_is_offline(cpu))
--- /dev/null
+From 48ae077cfce72591b8fc80e1dcc87806f86fed7f Mon Sep 17 00:00:00 2001
+From: Frederic Weisbecker <fweisbec@gmail.com>
+Date: Wed, 22 Aug 2012 17:27:34 +0200
+Subject: m32r: Add missing RCU idle APIs on idle loop
+
+From: Frederic Weisbecker <fweisbec@gmail.com>
+
+commit 48ae077cfce72591b8fc80e1dcc87806f86fed7f upstream.
+
+In the old times, the whole idle task was considered
+as an RCU quiescent state. But as RCU became more and
+more successful overtime, some RCU read side critical
+section have been added even in the code of some
+architectures idle tasks, for tracing for example.
+
+So nowadays, rcu_idle_enter() and rcu_idle_exit() must
+be called by the architecture to tell RCU about the part
+in the idle loop that doesn't make use of rcu read side
+critical sections, typically the part that puts the CPU
+in low power mode.
+
+This is necessary for RCU to find the quiescent states in
+idle in order to complete grace periods.
+
+Add this missing pair of calls in the m32r's idle loop.
+
+Reported-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
+Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
+Cc: Hirokazu Takata <takata@linux-m32r.org>
+Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
+Reviewed-by: Josh Triplett <josh@joshtriplett.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ arch/m32r/kernel/process.c | 3 +++
+ 1 file changed, 3 insertions(+)
+
+--- a/arch/m32r/kernel/process.c
++++ b/arch/m32r/kernel/process.c
+@@ -26,6 +26,7 @@
+ #include <linux/ptrace.h>
+ #include <linux/unistd.h>
+ #include <linux/hardirq.h>
++#include <linux/rcupdate.h>
+
+ #include <asm/io.h>
+ #include <asm/uaccess.h>
+@@ -82,6 +83,7 @@ void cpu_idle (void)
+ {
+ /* endless idle loop with no priority at all */
+ while (1) {
++ rcu_idle_enter();
+ while (!need_resched()) {
+ void (*idle)(void) = pm_idle;
+
+@@ -90,6 +92,7 @@ void cpu_idle (void)
+
+ idle();
+ }
++ rcu_idle_exit();
+ schedule_preempt_disabled();
+ }
+ }
--- /dev/null
+From 5b57ba37e82a15f345a6a2eb8c01a2b2d94c5eeb Mon Sep 17 00:00:00 2001
+From: Frederic Weisbecker <fweisbec@gmail.com>
+Date: Wed, 22 Aug 2012 17:27:34 +0200
+Subject: m68k: Add missing RCU idle APIs on idle loop
+
+From: Frederic Weisbecker <fweisbec@gmail.com>
+
+commit 5b57ba37e82a15f345a6a2eb8c01a2b2d94c5eeb upstream.
+
+In the old times, the whole idle task was considered
+as an RCU quiescent state. But as RCU became more and
+more successful overtime, some RCU read side critical
+section have been added even in the code of some
+architectures idle tasks, for tracing for example.
+
+So nowadays, rcu_idle_enter() and rcu_idle_exit() must
+be called by the architecture to tell RCU about the part
+in the idle loop that doesn't make use of rcu read side
+critical sections, typically the part that puts the CPU
+in low power mode.
+
+This is necessary for RCU to find the quiescent states in
+idle in order to complete grace periods.
+
+Add this missing pair of calls in the m68k's idle loop.
+
+Reported-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
+Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
+Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>
+Cc: m68k <linux-m68k@lists.linux-m68k.org>
+Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
+Reviewed-by: Josh Triplett <josh@joshtriplett.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ arch/m68k/kernel/process.c | 3 +++
+ 1 file changed, 3 insertions(+)
+
+--- a/arch/m68k/kernel/process.c
++++ b/arch/m68k/kernel/process.c
+@@ -25,6 +25,7 @@
+ #include <linux/reboot.h>
+ #include <linux/init_task.h>
+ #include <linux/mqueue.h>
++#include <linux/rcupdate.h>
+
+ #include <asm/uaccess.h>
+ #include <asm/traps.h>
+@@ -75,8 +76,10 @@ void cpu_idle(void)
+ {
+ /* endless idle loop with no priority at all */
+ while (1) {
++ rcu_idle_enter();
+ while (!need_resched())
+ idle();
++ rcu_idle_exit();
+ schedule_preempt_disabled();
+ }
+ }
--- /dev/null
+From 5b0753a90b7a98bc613c3767e9263a1a76d4f900 Mon Sep 17 00:00:00 2001
+From: Frederic Weisbecker <fweisbec@gmail.com>
+Date: Wed, 22 Aug 2012 17:27:34 +0200
+Subject: mn10300: Add missing RCU idle APIs on idle loop
+
+From: Frederic Weisbecker <fweisbec@gmail.com>
+
+commit 5b0753a90b7a98bc613c3767e9263a1a76d4f900 upstream.
+
+In the old times, the whole idle task was considered
+as an RCU quiescent state. But as RCU became more and
+more successful overtime, some RCU read side critical
+section have been added even in the code of some
+architectures idle tasks, for tracing for example.
+
+So nowadays, rcu_idle_enter() and rcu_idle_exit() must
+be called by the architecture to tell RCU about the part
+in the idle loop that doesn't make use of rcu read side
+critical sections, typically the part that puts the CPU
+in low power mode.
+
+This is necessary for RCU to find the quiescent states in
+idle in order to complete grace periods.
+
+Add this missing pair of calls in the mn10300's idle loop.
+
+Reported-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
+Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
+Cc: David Howells <dhowells@redhat.com>
+Cc: Koichi Yasutake <yasutake.koichi@jp.panasonic.com>
+Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
+Acked-by: David Howells <dhowells@redhat.com>
+Reviewed-by: Josh Triplett <josh@joshtriplett.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ arch/mn10300/kernel/process.c | 3 +++
+ 1 file changed, 3 insertions(+)
+
+--- a/arch/mn10300/kernel/process.c
++++ b/arch/mn10300/kernel/process.c
+@@ -25,6 +25,7 @@
+ #include <linux/err.h>
+ #include <linux/fs.h>
+ #include <linux/slab.h>
++#include <linux/rcupdate.h>
+ #include <asm/uaccess.h>
+ #include <asm/pgtable.h>
+ #include <asm/io.h>
+@@ -107,6 +108,7 @@ void cpu_idle(void)
+ {
+ /* endless idle loop with no priority at all */
+ for (;;) {
++ rcu_idle_enter();
+ while (!need_resched()) {
+ void (*idle)(void);
+
+@@ -121,6 +123,7 @@ void cpu_idle(void)
+ }
+ idle();
+ }
++ rcu_idle_exit();
+
+ schedule_preempt_disabled();
+ }
--- /dev/null
+From fbe752188d5589e7fcbb8e79824e560f77dccc92 Mon Sep 17 00:00:00 2001
+From: Frederic Weisbecker <fweisbec@gmail.com>
+Date: Wed, 22 Aug 2012 17:27:34 +0200
+Subject: parisc: Add missing RCU idle APIs on idle loop
+
+From: Frederic Weisbecker <fweisbec@gmail.com>
+
+commit fbe752188d5589e7fcbb8e79824e560f77dccc92 upstream.
+
+In the old times, the whole idle task was considered
+as an RCU quiescent state. But as RCU became more and
+more successful overtime, some RCU read side critical
+section have been added even in the code of some
+architectures idle tasks, for tracing for example.
+
+So nowadays, rcu_idle_enter() and rcu_idle_exit() must
+be called by the architecture to tell RCU about the part
+in the idle loop that doesn't make use of rcu read side
+critical sections, typically the part that puts the CPU
+in low power mode.
+
+This is necessary for RCU to find the quiescent states in
+idle in order to complete grace periods.
+
+Add this missing pair of calls in the parisc's idle loop.
+
+Reported-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
+Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
+Cc: James E.J. Bottomley <jejb@parisc-linux.org>
+Cc: Helge Deller <deller@gmx.de>
+Cc: Parisc <linux-parisc@vger.kernel.org>
+Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
+Reviewed-by: Josh Triplett <josh@joshtriplett.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ arch/parisc/kernel/process.c | 3 +++
+ 1 file changed, 3 insertions(+)
+
+--- a/arch/parisc/kernel/process.c
++++ b/arch/parisc/kernel/process.c
+@@ -48,6 +48,7 @@
+ #include <linux/unistd.h>
+ #include <linux/kallsyms.h>
+ #include <linux/uaccess.h>
++#include <linux/rcupdate.h>
+
+ #include <asm/io.h>
+ #include <asm/asm-offsets.h>
+@@ -69,8 +70,10 @@ void cpu_idle(void)
+
+ /* endless idle loop with no priority at all */
+ while (1) {
++ rcu_idle_enter();
+ while (!need_resched())
+ barrier();
++ rcu_idle_exit();
+ schedule_preempt_disabled();
+ check_pgt_cache();
+ }
--- /dev/null
+From a10d206ef1a83121ab7430cb196e0376a7145b22 Mon Sep 17 00:00:00 2001
+From: "Paul E. McKenney" <paul.mckenney@linaro.org>
+Date: Sat, 22 Sep 2012 13:55:30 -0700
+Subject: rcu: Fix day-one dyntick-idle stall-warning bug
+
+From: "Paul E. McKenney" <paul.mckenney@linaro.org>
+
+commit a10d206ef1a83121ab7430cb196e0376a7145b22 upstream.
+
+Each grace period is supposed to have at least one callback waiting
+for that grace period to complete. However, if CONFIG_NO_HZ=n, an
+extra callback-free grace period is no big problem -- it will chew up
+a tiny bit of CPU time, but it will complete normally. In contrast,
+CONFIG_NO_HZ=y kernels have the potential for all the CPUs to go to
+sleep indefinitely, in turn indefinitely delaying completion of the
+callback-free grace period. Given that nothing is waiting on this grace
+period, this is also not a problem.
+
+That is, unless RCU CPU stall warnings are also enabled, as they are
+in recent kernels. In this case, if a CPU wakes up after at least one
+minute of inactivity, an RCU CPU stall warning will result. The reason
+that no one noticed until quite recently is that most systems have enough
+OS noise that they will never remain absolutely idle for a full minute.
+But there are some embedded systems with cut-down userspace configurations
+that consistently get into this situation.
+
+All this begs the question of exactly how a callback-free grace period
+gets started in the first place. This can happen due to the fact that
+CPUs do not necessarily agree on which grace period is in progress.
+If a CPU still believes that the grace period that just completed is
+still ongoing, it will believe that it has callbacks that need to wait for
+another grace period, never mind the fact that the grace period that they
+were waiting for just completed. This CPU can therefore erroneously
+decide to start a new grace period. Note that this can happen in
+TREE_RCU and TREE_PREEMPT_RCU even on a single-CPU system: Deadlock
+considerations mean that the CPU that detected the end of the grace
+period is not necessarily officially informed of this fact for some time.
+
+Once this CPU notices that the earlier grace period completed, it will
+invoke its callbacks. It then won't have any callbacks left. If no
+other CPU has any callbacks, we now have a callback-free grace period.
+
+This commit therefore makes CPUs check more carefully before starting a
+new grace period. This new check relies on an array of tail pointers
+into each CPU's list of callbacks. If the CPU is up to date on which
+grace periods have completed, it checks to see if any callbacks follow
+the RCU_DONE_TAIL segment, otherwise it checks to see if any callbacks
+follow the RCU_WAIT_TAIL segment. The reason that this works is that
+the RCU_WAIT_TAIL segment will be promoted to the RCU_DONE_TAIL segment
+as soon as the CPU is officially notified that the old grace period
+has ended.
+
+This change is to cpu_needs_another_gp(), which is called in a number
+of places. The only one that really matters is in rcu_start_gp(), where
+the root rcu_node structure's ->lock is held, which prevents any
+other CPU from starting or completing a grace period, so that the
+comparison that determines whether the CPU is missing the completion
+of a grace period is stable.
+
+Reported-by: Becky Bruce <bgillbruce@gmail.com>
+Reported-by: Subodh Nijsure <snijsure@grid-net.com>
+Reported-by: Paul Walmsley <paul@pwsan.com>
+Signed-off-by: Paul E. McKenney <paul.mckenney@linaro.org>
+Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
+Tested-by: Paul Walmsley <paul@pwsan.com> # OMAP3730, OMAP4430
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ kernel/rcutree.c | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+--- a/kernel/rcutree.c
++++ b/kernel/rcutree.c
+@@ -295,7 +295,9 @@ cpu_has_callbacks_ready_to_invoke(struct
+ static int
+ cpu_needs_another_gp(struct rcu_state *rsp, struct rcu_data *rdp)
+ {
+- return *rdp->nxttail[RCU_DONE_TAIL] && !rcu_gp_in_progress(rsp);
++ return *rdp->nxttail[RCU_DONE_TAIL +
++ ACCESS_ONCE(rsp->completed) != rdp->completed] &&
++ !rcu_gp_in_progress(rsp);
+ }
+
+ /*
--- /dev/null
+From 0ee23fda59740767324b4340247ca41a2f498ca6 Mon Sep 17 00:00:00 2001
+From: Frederic Weisbecker <fweisbec@gmail.com>
+Date: Wed, 22 Aug 2012 17:27:34 +0200
+Subject: score: Add missing RCU idle APIs on idle loop
+
+From: Frederic Weisbecker <fweisbec@gmail.com>
+
+commit 0ee23fda59740767324b4340247ca41a2f498ca6 upstream.
+
+In the old times, the whole idle task was considered
+as an RCU quiescent state. But as RCU became more and
+more successful overtime, some RCU read side critical
+section have been added even in the code of some
+architectures idle tasks, for tracing for example.
+
+So nowadays, rcu_idle_enter() and rcu_idle_exit() must
+be called by the architecture to tell RCU about the part
+in the idle loop that doesn't make use of rcu read side
+critical sections, typically the part that puts the CPU
+in low power mode.
+
+This is necessary for RCU to find the quiescent states in
+idle in order to complete grace periods.
+
+Add this missing pair of calls in scores's idle loop.
+
+Reported-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
+Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
+Cc: Chen Liqin <liqin.chen@sunplusct.com>
+Cc: Lennox Wu <lennox.wu@gmail.com>
+Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
+Reviewed-by: Josh Triplett <josh@joshtriplett.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ arch/score/kernel/process.c | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+--- a/arch/score/kernel/process.c
++++ b/arch/score/kernel/process.c
+@@ -27,6 +27,7 @@
+ #include <linux/reboot.h>
+ #include <linux/elfcore.h>
+ #include <linux/pm.h>
++#include <linux/rcupdate.h>
+
+ void (*pm_power_off)(void);
+ EXPORT_SYMBOL(pm_power_off);
+@@ -50,9 +51,10 @@ void __noreturn cpu_idle(void)
+ {
+ /* endless idle loop with no priority at all */
+ while (1) {
++ rcu_idle_enter();
+ while (!need_resched())
+ barrier();
+-
++ rcu_idle_exit();
+ schedule_preempt_disabled();
+ }
+ }
drm-radeon-only-adjust-default-clocks-on-ni-gpus.patch
drm-radeon-add-msi-quirk-for-gateway-rs690.patch
drm-radeon-force-msis-on-rs690-asics.patch
+ia64-add-missing-rcu-idle-apis-on-idle-loop.patch
+h8300-add-missing-rcu-idle-apis-on-idle-loop.patch
+parisc-add-missing-rcu-idle-apis-on-idle-loop.patch
+xtensa-add-missing-rcu-idle-apis-on-idle-loop.patch
+frv-add-missing-rcu-idle-apis-on-idle-loop.patch
+mn10300-add-missing-rcu-idle-apis-on-idle-loop.patch
+m68k-add-missing-rcu-idle-apis-on-idle-loop.patch
+alpha-add-missing-rcu-idle-apis-on-idle-loop.patch
+cris-add-missing-rcu-idle-apis-on-idle-loop.patch
+m32r-add-missing-rcu-idle-apis-on-idle-loop.patch
+score-add-missing-rcu-idle-apis-on-idle-loop.patch
+rcu-fix-day-one-dyntick-idle-stall-warning-bug.patch
--- /dev/null
+From 11ad47a0edbd62bfc0547cfcdf227a911433f207 Mon Sep 17 00:00:00 2001
+From: Frederic Weisbecker <fweisbec@gmail.com>
+Date: Wed, 22 Aug 2012 17:27:34 +0200
+Subject: xtensa: Add missing RCU idle APIs on idle loop
+
+From: Frederic Weisbecker <fweisbec@gmail.com>
+
+commit 11ad47a0edbd62bfc0547cfcdf227a911433f207 upstream.
+
+In the old times, the whole idle task was considered
+as an RCU quiescent state. But as RCU became more and
+more successful overtime, some RCU read side critical
+section have been added even in the code of some
+architectures idle tasks, for tracing for example.
+
+So nowadays, rcu_idle_enter() and rcu_idle_exit() must
+be called by the architecture to tell RCU about the part
+in the idle loop that doesn't make use of rcu read side
+critical sections, typically the part that puts the CPU
+in low power mode.
+
+This is necessary for RCU to find the quiescent states in
+idle in order to complete grace periods.
+
+Add this missing pair of calls in the xtensa's idle loop.
+
+Reported-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
+Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
+Cc: Chris Zankel <chris@zankel.net>
+Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
+Reviewed-by: Josh Triplett <josh@joshtriplett.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ arch/xtensa/kernel/process.c | 3 +++
+ 1 file changed, 3 insertions(+)
+
+--- a/arch/xtensa/kernel/process.c
++++ b/arch/xtensa/kernel/process.c
+@@ -31,6 +31,7 @@
+ #include <linux/mqueue.h>
+ #include <linux/fs.h>
+ #include <linux/slab.h>
++#include <linux/rcupdate.h>
+
+ #include <asm/pgtable.h>
+ #include <asm/uaccess.h>
+@@ -110,8 +111,10 @@ void cpu_idle(void)
+
+ /* endless idle loop with no priority at all */
+ while (1) {
++ rcu_idle_enter();
+ while (!need_resched())
+ platform_idle();
++ rcu_idle_exit();
+ schedule_preempt_disabled();
+ }
+ }