diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2013-03-21 17:49:43 -0400 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2013-04-08 11:39:25 -0400 |
commit | 8dc7c5ecd8d0f739728d844ee794c4fae169f9c2 (patch) | |
tree | 744664a4cb45793ff43853acf591eb2980dc87d9 /arch/cris | |
parent | e46746cd5542b74f1e34bb1b8a997c5c0a6e69ea (diff) |
cris: Use generic idle loop
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: Jesper Nilsson <jesper.nilsson@axis.com>
Link: http://lkml.kernel.org/r/20130321215234.148829489@linutronix.de
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'arch/cris')
-rw-r--r-- | arch/cris/Kconfig | 1 | ||||
-rw-r--r-- | arch/cris/arch-v10/kernel/process.c | 3 | ||||
-rw-r--r-- | arch/cris/arch-v32/kernel/process.c | 10 | ||||
-rw-r--r-- | arch/cris/arch-v32/kernel/smp.c | 4 | ||||
-rw-r--r-- | arch/cris/kernel/process.c | 24 |
5 files changed, 9 insertions, 33 deletions
diff --git a/arch/cris/Kconfig b/arch/cris/Kconfig index 06dd026533e3..1dd36355a3cd 100644 --- a/arch/cris/Kconfig +++ b/arch/cris/Kconfig | |||
@@ -48,6 +48,7 @@ config CRIS | |||
48 | select GENERIC_IRQ_SHOW | 48 | select GENERIC_IRQ_SHOW |
49 | select GENERIC_IOMAP | 49 | select GENERIC_IOMAP |
50 | select GENERIC_SMP_IDLE_THREAD if ETRAX_ARCH_V32 | 50 | select GENERIC_SMP_IDLE_THREAD if ETRAX_ARCH_V32 |
51 | select GENERIC_IDLE_LOOP | ||
51 | select GENERIC_CMOS_UPDATE | 52 | select GENERIC_CMOS_UPDATE |
52 | select MODULES_USE_ELF_RELA | 53 | select MODULES_USE_ELF_RELA |
53 | select CLONE_BACKWARDS2 | 54 | select CLONE_BACKWARDS2 |
diff --git a/arch/cris/arch-v10/kernel/process.c b/arch/cris/arch-v10/kernel/process.c index b1018750cffb..2ba23c13df68 100644 --- a/arch/cris/arch-v10/kernel/process.c +++ b/arch/cris/arch-v10/kernel/process.c | |||
@@ -30,8 +30,9 @@ void etrax_gpio_wake_up_check(void); /* drivers/gpio.c */ | |||
30 | void default_idle(void) | 30 | void default_idle(void) |
31 | { | 31 | { |
32 | #ifdef CONFIG_ETRAX_GPIO | 32 | #ifdef CONFIG_ETRAX_GPIO |
33 | etrax_gpio_wake_up_check(); | 33 | etrax_gpio_wake_up_check(); |
34 | #endif | 34 | #endif |
35 | local_irq_enable(); | ||
35 | } | 36 | } |
36 | 37 | ||
37 | /* | 38 | /* |
diff --git a/arch/cris/arch-v32/kernel/process.c b/arch/cris/arch-v32/kernel/process.c index 4857933d59f4..57451faa9b20 100644 --- a/arch/cris/arch-v32/kernel/process.c +++ b/arch/cris/arch-v32/kernel/process.c | |||
@@ -23,13 +23,9 @@ extern void stop_watchdog(void); | |||
23 | /* We use this if we don't have any better idle routine. */ | 23 | /* We use this if we don't have any better idle routine. */ |
24 | void default_idle(void) | 24 | void default_idle(void) |
25 | { | 25 | { |
26 | local_irq_disable(); | 26 | /* Halt until exception. */ |
27 | if (!need_resched()) { | 27 | __asm__ volatile("ei \n\t" |
28 | /* Halt until exception. */ | 28 | "halt "); |
29 | __asm__ volatile("ei \n\t" | ||
30 | "halt "); | ||
31 | } | ||
32 | local_irq_enable(); | ||
33 | } | 29 | } |
34 | 30 | ||
35 | /* | 31 | /* |
diff --git a/arch/cris/arch-v32/kernel/smp.c b/arch/cris/arch-v32/kernel/smp.c index 04a16edd5401..cdd12028de0c 100644 --- a/arch/cris/arch-v32/kernel/smp.c +++ b/arch/cris/arch-v32/kernel/smp.c | |||
@@ -145,8 +145,6 @@ smp_boot_one_cpu(int cpuid, struct task_struct idle) | |||
145 | * specific stuff such as the local timer and the MMU. */ | 145 | * specific stuff such as the local timer and the MMU. */ |
146 | void __init smp_callin(void) | 146 | void __init smp_callin(void) |
147 | { | 147 | { |
148 | extern void cpu_idle(void); | ||
149 | |||
150 | int cpu = cpu_now_booting; | 148 | int cpu = cpu_now_booting; |
151 | reg_intr_vect_rw_mask vect_mask = {0}; | 149 | reg_intr_vect_rw_mask vect_mask = {0}; |
152 | 150 | ||
@@ -170,7 +168,7 @@ void __init smp_callin(void) | |||
170 | local_irq_enable(); | 168 | local_irq_enable(); |
171 | 169 | ||
172 | set_cpu_online(cpu, true); | 170 | set_cpu_online(cpu, true); |
173 | cpu_idle(); | 171 | cpu_startup_entry(CPUHP_ONLINE); |
174 | } | 172 | } |
175 | 173 | ||
176 | /* Stop execution on this CPU.*/ | 174 | /* Stop execution on this CPU.*/ |
diff --git a/arch/cris/kernel/process.c b/arch/cris/kernel/process.c index 508c9cdacc7b..b78498eb079b 100644 --- a/arch/cris/kernel/process.c +++ b/arch/cris/kernel/process.c | |||
@@ -34,29 +34,9 @@ extern void default_idle(void); | |||
34 | void (*pm_power_off)(void); | 34 | void (*pm_power_off)(void); |
35 | EXPORT_SYMBOL(pm_power_off); | 35 | EXPORT_SYMBOL(pm_power_off); |
36 | 36 | ||
37 | /* | 37 | void arch_cpu_idle(void) |
38 | * The idle thread. There's no useful work to be | ||
39 | * done, so just try to conserve power and have a | ||
40 | * low exit latency (ie sit in a loop waiting for | ||
41 | * somebody to say that they'd like to reschedule) | ||
42 | */ | ||
43 | |||
44 | void cpu_idle (void) | ||
45 | { | 38 | { |
46 | /* endless idle loop with no priority at all */ | 39 | default_idle(); |
47 | while (1) { | ||
48 | rcu_idle_enter(); | ||
49 | while (!need_resched()) { | ||
50 | /* | ||
51 | * Mark this as an RCU critical section so that | ||
52 | * synchronize_kernel() in the unload path waits | ||
53 | * for our completion. | ||
54 | */ | ||
55 | default_idle(); | ||
56 | } | ||
57 | rcu_idle_exit(); | ||
58 | schedule_preempt_disabled(); | ||
59 | } | ||
60 | } | 40 | } |
61 | 41 | ||
62 | void hard_reset_now (void); | 42 | void hard_reset_now (void); |