]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/3.6.2/h8300-add-missing-rcu-idle-apis-on-idle-loop.patch
4.9-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 3.6.2 / h8300-add-missing-rcu-idle-apis-on-idle-loop.patch
1 From b2fe1430d4115c74d007c825cb9dc3317f28bb16 Mon Sep 17 00:00:00 2001
2 From: Frederic Weisbecker <fweisbec@gmail.com>
3 Date: Wed, 22 Aug 2012 17:27:34 +0200
4 Subject: h8300: Add missing RCU idle APIs on idle loop
5
6 From: Frederic Weisbecker <fweisbec@gmail.com>
7
8 commit b2fe1430d4115c74d007c825cb9dc3317f28bb16 upstream.
9
10 In the old times, the whole idle task was considered
11 as an RCU quiescent state. But as RCU became more and
12 more successful overtime, some RCU read side critical
13 section have been added even in the code of some
14 architectures idle tasks, for tracing for example.
15
16 So nowadays, rcu_idle_enter() and rcu_idle_exit() must
17 be called by the architecture to tell RCU about the part
18 in the idle loop that doesn't make use of rcu read side
19 critical sections, typically the part that puts the CPU
20 in low power mode.
21
22 This is necessary for RCU to find the quiescent states in
23 idle in order to complete grace periods.
24
25 Add this missing pair of calls in the h8300's idle loop.
26
27 Reported-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
28 Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
29 Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
30 Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
31 Reviewed-by: Josh Triplett <josh@joshtriplett.org>
32 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
33
34 ---
35 arch/h8300/kernel/process.c | 3 +++
36 1 file changed, 3 insertions(+)
37
38 --- a/arch/h8300/kernel/process.c
39 +++ b/arch/h8300/kernel/process.c
40 @@ -36,6 +36,7 @@
41 #include <linux/reboot.h>
42 #include <linux/fs.h>
43 #include <linux/slab.h>
44 +#include <linux/rcupdate.h>
45
46 #include <asm/uaccess.h>
47 #include <asm/traps.h>
48 @@ -78,8 +79,10 @@ void (*idle)(void) = default_idle;
49 void cpu_idle(void)
50 {
51 while (1) {
52 + rcu_idle_enter();
53 while (!need_resched())
54 idle();
55 + rcu_idle_exit();
56 schedule_preempt_disabled();
57 }
58 }