Skip to content

Commit fa35e42

Browse files
committed
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>
1 parent d166991 commit fa35e42

3 files changed

Lines changed: 3 additions & 27 deletions

File tree

‎arch/arc/Kconfig‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ config ARC
1414
select GENERIC_ATOMIC64
1515
select GENERIC_CLOCKEVENTS
1616
select GENERIC_FIND_FIRST_BIT
17+
select GENERIC_IDLE_LOOP
1718
# for now, we don't need GENERIC_IRQ_PROBE, CONFIG_GENERIC_IRQ_CHIP
1819
select GENERIC_IRQ_SHOW
1920
select GENERIC_KERNEL_EXECVE

‎arch/arc/kernel/process.c‎

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -41,37 +41,12 @@ SYSCALL_DEFINE0(arc_gettls)
4141
return task_thread_info(current)->thr_ptr;
4242
}
4343

44-
static inline void arch_idle(void)
44+
void arch_cpu_idle(void)
4545
{
4646
/* sleep, but enable all interrupts before committing */
4747
__asm__("sleep 0x3");
4848
}
4949

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-
7550
asmlinkage void ret_from_fork(void);
7651

7752
/* Layout of Child kernel mode stack as setup at the end of this function is

‎arch/arc/kernel/smp.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ void __cpuinit start_kernel_secondary(void)
141141

142142
local_irq_enable();
143143
preempt_disable();
144-
cpu_idle();
144+
cpu_startup_entry(CPUHP_ONLINE);
145145
}
146146

147147
/*

0 commit comments

Comments
 (0)