diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2013-03-21 17:49:36 -0400 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2013-04-08 11:39:23 -0400 |
commit | fa35e42a00ec0120db2b5128753206efb288e789 (patch) | |
tree | 9327391650b78e260cc2f16d6c1c676584a77425 | |
parent | d166991234347215dc23fc9dc15a63a83a1a54e1 (diff) |
arc: Use generic idle loop
The generic idle loop implements all functionality. Aside of that it
allows arc to implement the tsk_is_polling() functionality correctly,
despite the patently (now gone) comment in the original arc cpu_idle()
function:
/* Since we SLEEP in idle loop, TIF_POLLING_NRFLAG can't be set */
See kernel/cpu/idle.c
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Cc: Paul McKenney <paulmck@linux.vnet.ibm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Reviewed-by: Cc: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
Cc: Magnus Damm <magnus.damm@gmail.com>
Acked-by: Vineet Gupta <vgupta@synopsys.com>
Tested-by: Vineet Gupta <vgupta@synopsys.com>
Link: http://lkml.kernel.org/r/20130321215233.711253792@linutronix.de
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
-rw-r--r-- | arch/arc/Kconfig | 1 | ||||
-rw-r--r-- | arch/arc/kernel/process.c | 27 | ||||
-rw-r--r-- | arch/arc/kernel/smp.c | 2 |
3 files changed, 3 insertions, 27 deletions
diff --git a/arch/arc/Kconfig b/arch/arc/Kconfig index e6f4eca09ee3..b006977a1516 100644 --- a/arch/arc/Kconfig +++ b/arch/arc/Kconfig | |||
@@ -14,6 +14,7 @@ config ARC | |||
14 | select GENERIC_ATOMIC64 | 14 | select GENERIC_ATOMIC64 |
15 | select GENERIC_CLOCKEVENTS | 15 | select GENERIC_CLOCKEVENTS |
16 | select GENERIC_FIND_FIRST_BIT | 16 | select GENERIC_FIND_FIRST_BIT |
17 | select GENERIC_IDLE_LOOP | ||
17 | # for now, we don't need GENERIC_IRQ_PROBE, CONFIG_GENERIC_IRQ_CHIP | 18 | # for now, we don't need GENERIC_IRQ_PROBE, CONFIG_GENERIC_IRQ_CHIP |
18 | select GENERIC_IRQ_SHOW | 19 | select GENERIC_IRQ_SHOW |
19 | select GENERIC_KERNEL_EXECVE | 20 | select GENERIC_KERNEL_EXECVE |
diff --git a/arch/arc/kernel/process.c b/arch/arc/kernel/process.c index 0a7531d99294..cad66851e0c4 100644 --- a/arch/arc/kernel/process.c +++ b/arch/arc/kernel/process.c | |||
@@ -41,37 +41,12 @@ SYSCALL_DEFINE0(arc_gettls) | |||
41 | return task_thread_info(current)->thr_ptr; | 41 | return task_thread_info(current)->thr_ptr; |
42 | } | 42 | } |
43 | 43 | ||
44 | static inline void arch_idle(void) | 44 | void arch_cpu_idle(void) |
45 | { | 45 | { |
46 | /* sleep, but enable all interrupts before committing */ | 46 | /* sleep, but enable all interrupts before committing */ |
47 | __asm__("sleep 0x3"); | 47 | __asm__("sleep 0x3"); |
48 | } | 48 | } |
49 | 49 | ||
50 | void cpu_idle(void) | ||
51 | { | ||
52 | /* Since we SLEEP in idle loop, TIF_POLLING_NRFLAG can't be set */ | ||
53 | |||
54 | /* endless idle loop with no priority at all */ | ||
55 | while (1) { | ||
56 | tick_nohz_idle_enter(); | ||
57 | rcu_idle_enter(); | ||
58 | |||
59 | doze: | ||
60 | local_irq_disable(); | ||
61 | if (!need_resched()) { | ||
62 | arch_idle(); | ||
63 | goto doze; | ||
64 | } else { | ||
65 | local_irq_enable(); | ||
66 | } | ||
67 | |||
68 | rcu_idle_exit(); | ||
69 | tick_nohz_idle_exit(); | ||
70 | |||
71 | schedule_preempt_disabled(); | ||
72 | } | ||
73 | } | ||
74 | |||
75 | asmlinkage void ret_from_fork(void); | 50 | asmlinkage void ret_from_fork(void); |
76 | 51 | ||
77 | /* Layout of Child kernel mode stack as setup at the end of this function is | 52 | /* Layout of Child kernel mode stack as setup at the end of this function is |
diff --git a/arch/arc/kernel/smp.c b/arch/arc/kernel/smp.c index 3af3e06dcf02..5c7fd603d216 100644 --- a/arch/arc/kernel/smp.c +++ b/arch/arc/kernel/smp.c | |||
@@ -141,7 +141,7 @@ void __cpuinit start_kernel_secondary(void) | |||
141 | 141 | ||
142 | local_irq_enable(); | 142 | local_irq_enable(); |
143 | preempt_disable(); | 143 | preempt_disable(); |
144 | cpu_idle(); | 144 | cpu_startup_entry(CPUHP_ONLINE); |
145 | } | 145 | } |
146 | 146 | ||
147 | /* | 147 | /* |