Skip to content

Commit

Permalink
cris: Use generic idle loop
Browse files Browse the repository at this point in the history
Signed-off-by: Thomas Gleixner <[email protected]>
Cc: Linus Torvalds <[email protected]>
Cc: Rusty Russell <[email protected]>
Cc: Paul McKenney <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Reviewed-by: Cc: Srivatsa S. Bhat <[email protected]>
Cc: Magnus Damm <[email protected]>
Acked-by: Jesper Nilsson <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Thomas Gleixner <[email protected]>
  • Loading branch information
KAGA-KOKO committed Apr 8, 2013
1 parent e46746c commit 8dc7c5e
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 33 deletions.
1 change: 1 addition & 0 deletions arch/cris/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ config CRIS
select GENERIC_IRQ_SHOW
select GENERIC_IOMAP
select GENERIC_SMP_IDLE_THREAD if ETRAX_ARCH_V32
select GENERIC_IDLE_LOOP
select GENERIC_CMOS_UPDATE
select MODULES_USE_ELF_RELA
select CLONE_BACKWARDS2
Expand Down
3 changes: 2 additions & 1 deletion arch/cris/arch-v10/kernel/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,9 @@ void etrax_gpio_wake_up_check(void); /* drivers/gpio.c */
void default_idle(void)
{
#ifdef CONFIG_ETRAX_GPIO
etrax_gpio_wake_up_check();
etrax_gpio_wake_up_check();
#endif
local_irq_enable();
}

/*
Expand Down
10 changes: 3 additions & 7 deletions arch/cris/arch-v32/kernel/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,9 @@ extern void stop_watchdog(void);
/* We use this if we don't have any better idle routine. */
void default_idle(void)
{
local_irq_disable();
if (!need_resched()) {
/* Halt until exception. */
__asm__ volatile("ei \n\t"
"halt ");
}
local_irq_enable();
/* Halt until exception. */
__asm__ volatile("ei \n\t"
"halt ");
}

/*
Expand Down
4 changes: 1 addition & 3 deletions arch/cris/arch-v32/kernel/smp.c
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,6 @@ smp_boot_one_cpu(int cpuid, struct task_struct idle)
* specific stuff such as the local timer and the MMU. */
void __init smp_callin(void)
{
extern void cpu_idle(void);

int cpu = cpu_now_booting;
reg_intr_vect_rw_mask vect_mask = {0};

Expand All @@ -170,7 +168,7 @@ void __init smp_callin(void)
local_irq_enable();

set_cpu_online(cpu, true);
cpu_idle();
cpu_startup_entry(CPUHP_ONLINE);
}

/* Stop execution on this CPU.*/
Expand Down
24 changes: 2 additions & 22 deletions arch/cris/kernel/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,29 +34,9 @@ extern void default_idle(void);
void (*pm_power_off)(void);
EXPORT_SYMBOL(pm_power_off);

/*
* The idle thread. There's no useful work to be
* done, so just try to conserve power and have a
* low exit latency (ie sit in a loop waiting for
* somebody to say that they'd like to reschedule)
*/

void cpu_idle (void)
void arch_cpu_idle(void)
{
/* endless idle loop with no priority at all */
while (1) {
rcu_idle_enter();
while (!need_resched()) {
/*
* Mark this as an RCU critical section so that
* synchronize_kernel() in the unload path waits
* for our completion.
*/
default_idle();
}
rcu_idle_exit();
schedule_preempt_disabled();
}
default_idle();
}

void hard_reset_now (void);
Expand Down

0 comments on commit 8dc7c5e

Please sign in to comment.