aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHeiko Carstens <heiko.carstens@de.ibm.com>2008-07-14 03:59:06 -0400
committerHeiko Carstens <heiko.carstens@de.ibm.com>2008-07-14 04:02:13 -0400
commit773922e1dab93a62e60cfb34afadb0f66d5f12e9 (patch)
treef13ea310c22080a90dcbc9580b678cbd91c44838
parent9d92a7e1b0d095c8be96ce5e592c6c5541684631 (diff)
[S390] idle: remove idle notifier chain.
The idle notifier chain consists of at most one element. So there's no point in having a notifier chain. Remove it and directly call the function. Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
-rw-r--r--arch/s390/kernel/process.c32
-rw-r--r--arch/s390/kernel/vtime.c25
-rw-r--r--include/asm-s390/processor.h10
-rw-r--r--include/asm-s390/timer.h12
4 files changed, 16 insertions, 63 deletions
diff --git a/arch/s390/kernel/process.c b/arch/s390/kernel/process.c
index 7920861109d2..85defd01d293 100644
--- a/arch/s390/kernel/process.c
+++ b/arch/s390/kernel/process.c
@@ -75,46 +75,19 @@ unsigned long thread_saved_pc(struct task_struct *tsk)
75 return sf->gprs[8]; 75 return sf->gprs[8];
76} 76}
77 77
78/*
79 * Need to know about CPUs going idle?
80 */
81static ATOMIC_NOTIFIER_HEAD(idle_chain);
82DEFINE_PER_CPU(struct s390_idle_data, s390_idle); 78DEFINE_PER_CPU(struct s390_idle_data, s390_idle);
83 79
84int register_idle_notifier(struct notifier_block *nb)
85{
86 return atomic_notifier_chain_register(&idle_chain, nb);
87}
88EXPORT_SYMBOL(register_idle_notifier);
89
90int unregister_idle_notifier(struct notifier_block *nb)
91{
92 return atomic_notifier_chain_unregister(&idle_chain, nb);
93}
94EXPORT_SYMBOL(unregister_idle_notifier);
95
96static int s390_idle_enter(void) 80static int s390_idle_enter(void)
97{ 81{
98 struct s390_idle_data *idle; 82 struct s390_idle_data *idle;
99 int nr_calls = 0;
100 void *hcpu;
101 int rc;
102 83
103 hcpu = (void *)(long)smp_processor_id();
104 rc = __atomic_notifier_call_chain(&idle_chain, S390_CPU_IDLE, hcpu, -1,
105 &nr_calls);
106 if (rc == NOTIFY_BAD) {
107 nr_calls--;
108 __atomic_notifier_call_chain(&idle_chain, S390_CPU_NOT_IDLE,
109 hcpu, nr_calls, NULL);
110 return rc;
111 }
112 idle = &__get_cpu_var(s390_idle); 84 idle = &__get_cpu_var(s390_idle);
113 spin_lock(&idle->lock); 85 spin_lock(&idle->lock);
114 idle->idle_count++; 86 idle->idle_count++;
115 idle->in_idle = 1; 87 idle->in_idle = 1;
116 idle->idle_enter = get_clock(); 88 idle->idle_enter = get_clock();
117 spin_unlock(&idle->lock); 89 spin_unlock(&idle->lock);
90 vtime_stop_cpu_timer();
118 return NOTIFY_OK; 91 return NOTIFY_OK;
119} 92}
120 93
@@ -122,13 +95,12 @@ void s390_idle_leave(void)
122{ 95{
123 struct s390_idle_data *idle; 96 struct s390_idle_data *idle;
124 97
98 vtime_start_cpu_timer();
125 idle = &__get_cpu_var(s390_idle); 99 idle = &__get_cpu_var(s390_idle);
126 spin_lock(&idle->lock); 100 spin_lock(&idle->lock);
127 idle->idle_time += get_clock() - idle->idle_enter; 101 idle->idle_time += get_clock() - idle->idle_enter;
128 idle->in_idle = 0; 102 idle->in_idle = 0;
129 spin_unlock(&idle->lock); 103 spin_unlock(&idle->lock);
130 atomic_notifier_call_chain(&idle_chain, S390_CPU_NOT_IDLE,
131 (void *)(long) smp_processor_id());
132} 104}
133 105
134extern void s390_handle_mcck(void); 106extern void s390_handle_mcck(void);
diff --git a/arch/s390/kernel/vtime.c b/arch/s390/kernel/vtime.c
index ca90ee3f930e..eb08d04bc1ec 100644
--- a/arch/s390/kernel/vtime.c
+++ b/arch/s390/kernel/vtime.c
@@ -136,7 +136,7 @@ static inline void set_vtimer(__u64 expires)
136} 136}
137#endif 137#endif
138 138
139static void start_cpu_timer(void) 139void vtime_start_cpu_timer(void)
140{ 140{
141 struct vtimer_queue *vt_list; 141 struct vtimer_queue *vt_list;
142 142
@@ -150,7 +150,7 @@ static void start_cpu_timer(void)
150 set_vtimer(vt_list->idle); 150 set_vtimer(vt_list->idle);
151} 151}
152 152
153static void stop_cpu_timer(void) 153void vtime_stop_cpu_timer(void)
154{ 154{
155 struct vtimer_queue *vt_list; 155 struct vtimer_queue *vt_list;
156 156
@@ -536,24 +536,6 @@ void init_cpu_vtimer(void)
536 536
537} 537}
538 538
539static int vtimer_idle_notify(struct notifier_block *self,
540 unsigned long action, void *hcpu)
541{
542 switch (action) {
543 case S390_CPU_IDLE:
544 stop_cpu_timer();
545 break;
546 case S390_CPU_NOT_IDLE:
547 start_cpu_timer();
548 break;
549 }
550 return NOTIFY_OK;
551}
552
553static struct notifier_block vtimer_idle_nb = {
554 .notifier_call = vtimer_idle_notify,
555};
556
557void __init vtime_init(void) 539void __init vtime_init(void)
558{ 540{
559 /* request the cpu timer external interrupt */ 541 /* request the cpu timer external interrupt */
@@ -561,9 +543,6 @@ void __init vtime_init(void)
561 &ext_int_info_timer) != 0) 543 &ext_int_info_timer) != 0)
562 panic("Couldn't request external interrupt 0x1005"); 544 panic("Couldn't request external interrupt 0x1005");
563 545
564 if (register_idle_notifier(&vtimer_idle_nb))
565 panic("Couldn't register idle notifier");
566
567 /* Enable cpu timer interrupts on the boot cpu. */ 546 /* Enable cpu timer interrupts on the boot cpu. */
568 init_cpu_vtimer(); 547 init_cpu_vtimer();
569} 548}
diff --git a/include/asm-s390/processor.h b/include/asm-s390/processor.h
index 5483c28b8bc3..4af80af2a88f 100644
--- a/include/asm-s390/processor.h
+++ b/include/asm-s390/processor.h
@@ -336,16 +336,6 @@ extern void (*s390_base_mcck_handler_fn)(void);
336extern void (*s390_base_pgm_handler_fn)(void); 336extern void (*s390_base_pgm_handler_fn)(void);
337extern void (*s390_base_ext_handler_fn)(void); 337extern void (*s390_base_ext_handler_fn)(void);
338 338
339/*
340 * CPU idle notifier chain.
341 */
342#define S390_CPU_IDLE 0
343#define S390_CPU_NOT_IDLE 1
344
345struct notifier_block;
346int register_idle_notifier(struct notifier_block *nb);
347int unregister_idle_notifier(struct notifier_block *nb);
348
349#define ARCH_LOW_ADDRESS_LIMIT 0x7fffffffUL 339#define ARCH_LOW_ADDRESS_LIMIT 0x7fffffffUL
350 340
351#endif 341#endif
diff --git a/include/asm-s390/timer.h b/include/asm-s390/timer.h
index adb34860a543..d98d79e35cd6 100644
--- a/include/asm-s390/timer.h
+++ b/include/asm-s390/timer.h
@@ -48,6 +48,18 @@ extern int del_virt_timer(struct vtimer_list *timer);
48extern void init_cpu_vtimer(void); 48extern void init_cpu_vtimer(void);
49extern void vtime_init(void); 49extern void vtime_init(void);
50 50
51#ifdef CONFIG_VIRT_TIMER
52
53extern void vtime_start_cpu_timer(void);
54extern void vtime_stop_cpu_timer(void);
55
56#else
57
58static inline void vtime_start_cpu_timer(void) { }
59static inline void vtime_stop_cpu_timer(void) { }
60
61#endif /* CONFIG_VIRT_TIMER */
62
51#endif /* __KERNEL__ */ 63#endif /* __KERNEL__ */
52 64
53#endif /* _ASM_S390_TIMER_H */ 65#endif /* _ASM_S390_TIMER_H */