aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2013-03-21 17:49:51 -0400
committerThomas Gleixner <tglx@linutronix.de>2013-04-08 11:39:26 -0400
commite962bb9e9cf73b8c8893c95903e791dd5ec19fb4 (patch)
tree820b06626ef6a0614fc10aa30073949df28fae6e
parentd1dba0fcd3e62f32d5925bcb91eba8757951464c (diff)
microblaze: Use generic idle loop
The microblaze idle loop provides a polling and a non polling version, which are suprisingly both polling, just with slightly different instrumentation. Remove them and use the generic poller. 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> Cc: Michal Simek <monstr@monstr.eu> Link: http://lkml.kernel.org/r/20130321215234.687590459@linutronix.de Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
-rw-r--r--arch/microblaze/Kconfig2
-rw-r--r--arch/microblaze/include/asm/processor.h3
-rw-r--r--arch/microblaze/kernel/process.c53
3 files changed, 2 insertions, 56 deletions
diff --git a/arch/microblaze/Kconfig b/arch/microblaze/Kconfig
index 1323fa2530eb..0bb0d519a233 100644
--- a/arch/microblaze/Kconfig
+++ b/arch/microblaze/Kconfig
@@ -26,6 +26,8 @@ config MICROBLAZE
26 select GENERIC_CPU_DEVICES 26 select GENERIC_CPU_DEVICES
27 select GENERIC_ATOMIC64 27 select GENERIC_ATOMIC64
28 select GENERIC_CLOCKEVENTS 28 select GENERIC_CLOCKEVENTS
29 select GENERIC_IDLE_LOOP
30 select GENERIC_IDLE_POLL_SETUP
29 select MODULES_USE_ELF_RELA 31 select MODULES_USE_ELF_RELA
30 select CLONE_BACKWARDS 32 select CLONE_BACKWARDS
31 33
diff --git a/arch/microblaze/include/asm/processor.h b/arch/microblaze/include/asm/processor.h
index f576fe018e5a..d6e0ffea28b6 100644
--- a/arch/microblaze/include/asm/processor.h
+++ b/arch/microblaze/include/asm/processor.h
@@ -22,7 +22,6 @@
22extern const struct seq_operations cpuinfo_op; 22extern const struct seq_operations cpuinfo_op;
23 23
24# define cpu_relax() barrier() 24# define cpu_relax() barrier()
25# define cpu_sleep() do {} while (0)
26 25
27#define task_pt_regs(tsk) \ 26#define task_pt_regs(tsk) \
28 (((struct pt_regs *)(THREAD_SIZE + task_stack_page(tsk))) - 1) 27 (((struct pt_regs *)(THREAD_SIZE + task_stack_page(tsk))) - 1)
@@ -160,8 +159,6 @@ unsigned long get_wchan(struct task_struct *p);
160# define STACK_TOP TASK_SIZE 159# define STACK_TOP TASK_SIZE
161# define STACK_TOP_MAX STACK_TOP 160# define STACK_TOP_MAX STACK_TOP
162 161
163void default_idle(void);
164
165#ifdef CONFIG_DEBUG_FS 162#ifdef CONFIG_DEBUG_FS
166extern struct dentry *of_debugfs_root; 163extern struct dentry *of_debugfs_root;
167#endif 164#endif
diff --git a/arch/microblaze/kernel/process.c b/arch/microblaze/kernel/process.c
index 7c36171771f2..7cce2e9c1719 100644
--- a/arch/microblaze/kernel/process.c
+++ b/arch/microblaze/kernel/process.c
@@ -44,59 +44,6 @@ void show_regs(struct pt_regs *regs)
44void (*pm_power_off)(void) = NULL; 44void (*pm_power_off)(void) = NULL;
45EXPORT_SYMBOL(pm_power_off); 45EXPORT_SYMBOL(pm_power_off);
46 46
47static int hlt_counter = 1;
48
49static int __init nohlt_setup(char *__unused)
50{
51 hlt_counter = 1;
52 return 1;
53}
54__setup("nohlt", nohlt_setup);
55
56static int __init hlt_setup(char *__unused)
57{
58 hlt_counter = 0;
59 return 1;
60}
61__setup("hlt", hlt_setup);
62
63void default_idle(void)
64{
65 if (likely(hlt_counter)) {
66 local_irq_disable();
67 stop_critical_timings();
68 cpu_relax();
69 start_critical_timings();
70 local_irq_enable();
71 } else {
72 clear_thread_flag(TIF_POLLING_NRFLAG);
73 smp_mb__after_clear_bit();
74 local_irq_disable();
75 while (!need_resched())
76 cpu_sleep();
77 local_irq_enable();
78 set_thread_flag(TIF_POLLING_NRFLAG);
79 }
80}
81
82void cpu_idle(void)
83{
84 set_thread_flag(TIF_POLLING_NRFLAG);
85
86 /* endless idle loop with no priority at all */
87 while (1) {
88 tick_nohz_idle_enter();
89 rcu_idle_enter();
90 while (!need_resched())
91 default_idle();
92 rcu_idle_exit();
93 tick_nohz_idle_exit();
94
95 schedule_preempt_disabled();
96 check_pgt_cache();
97 }
98}
99
100void flush_thread(void) 47void flush_thread(void)
101{ 48{
102} 49}