Skip to content

Commit 8dc7c5e

Browse files
committed
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>
1 parent e46746c commit 8dc7c5e

5 files changed

Lines changed: 9 additions & 33 deletions

File tree

‎arch/cris/Kconfig‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ config CRIS
4848
select GENERIC_IRQ_SHOW
4949
select GENERIC_IOMAP
5050
select GENERIC_SMP_IDLE_THREAD if ETRAX_ARCH_V32
51+
select GENERIC_IDLE_LOOP
5152
select GENERIC_CMOS_UPDATE
5253
select MODULES_USE_ELF_RELA
5354
select CLONE_BACKWARDS2

‎arch/cris/arch-v10/kernel/process.c‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,9 @@ void etrax_gpio_wake_up_check(void); /* drivers/gpio.c */
3030
void default_idle(void)
3131
{
3232
#ifdef CONFIG_ETRAX_GPIO
33-
etrax_gpio_wake_up_check();
33+
etrax_gpio_wake_up_check();
3434
#endif
35+
local_irq_enable();
3536
}
3637

3738
/*

‎arch/cris/arch-v32/kernel/process.c‎

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,9 @@ extern void stop_watchdog(void);
2323
/* We use this if we don't have any better idle routine. */
2424
void default_idle(void)
2525
{
26-
local_irq_disable();
27-
if (!need_resched()) {
28-
/* Halt until exception. */
29-
__asm__ volatile("ei \n\t"
30-
"halt ");
31-
}
32-
local_irq_enable();
26+
/* Halt until exception. */
27+
__asm__ volatile("ei \n\t"
28+
"halt ");
3329
}
3430

3531
/*

‎arch/cris/arch-v32/kernel/smp.c‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -145,8 +145,6 @@ smp_boot_one_cpu(int cpuid, struct task_struct idle)
145145
* specific stuff such as the local timer and the MMU. */
146146
void __init smp_callin(void)
147147
{
148-
extern void cpu_idle(void);
149-
150148
int cpu = cpu_now_booting;
151149
reg_intr_vect_rw_mask vect_mask = {0};
152150

@@ -170,7 +168,7 @@ void __init smp_callin(void)
170168
local_irq_enable();
171169

172170
set_cpu_online(cpu, true);
173-
cpu_idle();
171+
cpu_startup_entry(CPUHP_ONLINE);
174172
}
175173

176174
/* Stop execution on this CPU.*/

‎arch/cris/kernel/process.c‎

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -34,29 +34,9 @@ extern void default_idle(void);
3434
void (*pm_power_off)(void);
3535
EXPORT_SYMBOL(pm_power_off);
3636

37-
/*
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)
37+
void arch_cpu_idle(void)
4538
{
46-
/* endless idle loop with no priority at all */
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-
}
39+
default_idle();
6040
}
6141

6242
void hard_reset_now (void);

0 commit comments

Comments
 (0)