diff options
Diffstat (limited to 'arch/alpha/kernel/time.c')
-rw-r--r-- | arch/alpha/kernel/time.c | 44 |
1 files changed, 20 insertions, 24 deletions
diff --git a/arch/alpha/kernel/time.c b/arch/alpha/kernel/time.c index 396af1799ea4..818e74ed45dc 100644 --- a/arch/alpha/kernel/time.c +++ b/arch/alpha/kernel/time.c | |||
@@ -41,7 +41,7 @@ | |||
41 | #include <linux/init.h> | 41 | #include <linux/init.h> |
42 | #include <linux/bcd.h> | 42 | #include <linux/bcd.h> |
43 | #include <linux/profile.h> | 43 | #include <linux/profile.h> |
44 | #include <linux/perf_event.h> | 44 | #include <linux/irq_work.h> |
45 | 45 | ||
46 | #include <asm/uaccess.h> | 46 | #include <asm/uaccess.h> |
47 | #include <asm/io.h> | 47 | #include <asm/io.h> |
@@ -83,25 +83,25 @@ static struct { | |||
83 | 83 | ||
84 | unsigned long est_cycle_freq; | 84 | unsigned long est_cycle_freq; |
85 | 85 | ||
86 | #ifdef CONFIG_PERF_EVENTS | 86 | #ifdef CONFIG_IRQ_WORK |
87 | 87 | ||
88 | DEFINE_PER_CPU(u8, perf_event_pending); | 88 | DEFINE_PER_CPU(u8, irq_work_pending); |
89 | 89 | ||
90 | #define set_perf_event_pending_flag() __get_cpu_var(perf_event_pending) = 1 | 90 | #define set_irq_work_pending_flag() __get_cpu_var(irq_work_pending) = 1 |
91 | #define test_perf_event_pending() __get_cpu_var(perf_event_pending) | 91 | #define test_irq_work_pending() __get_cpu_var(irq_work_pending) |
92 | #define clear_perf_event_pending() __get_cpu_var(perf_event_pending) = 0 | 92 | #define clear_irq_work_pending() __get_cpu_var(irq_work_pending) = 0 |
93 | 93 | ||
94 | void set_perf_event_pending(void) | 94 | void set_irq_work_pending(void) |
95 | { | 95 | { |
96 | set_perf_event_pending_flag(); | 96 | set_irq_work_pending_flag(); |
97 | } | 97 | } |
98 | 98 | ||
99 | #else /* CONFIG_PERF_EVENTS */ | 99 | #else /* CONFIG_IRQ_WORK */ |
100 | 100 | ||
101 | #define test_perf_event_pending() 0 | 101 | #define test_irq_work_pending() 0 |
102 | #define clear_perf_event_pending() | 102 | #define clear_irq_work_pending() |
103 | 103 | ||
104 | #endif /* CONFIG_PERF_EVENTS */ | 104 | #endif /* CONFIG_IRQ_WORK */ |
105 | 105 | ||
106 | 106 | ||
107 | static inline __u32 rpcc(void) | 107 | static inline __u32 rpcc(void) |
@@ -153,13 +153,14 @@ void read_persistent_clock(struct timespec *ts) | |||
153 | year += 100; | 153 | year += 100; |
154 | 154 | ||
155 | ts->tv_sec = mktime(year, mon, day, hour, min, sec); | 155 | ts->tv_sec = mktime(year, mon, day, hour, min, sec); |
156 | ts->tv_nsec = 0; | ||
156 | } | 157 | } |
157 | 158 | ||
158 | 159 | ||
159 | 160 | ||
160 | /* | 161 | /* |
161 | * timer_interrupt() needs to keep up the real-time clock, | 162 | * timer_interrupt() needs to keep up the real-time clock, |
162 | * as well as call the "do_timer()" routine every clocktick | 163 | * as well as call the "xtime_update()" routine every clocktick |
163 | */ | 164 | */ |
164 | irqreturn_t timer_interrupt(int irq, void *dev) | 165 | irqreturn_t timer_interrupt(int irq, void *dev) |
165 | { | 166 | { |
@@ -172,8 +173,6 @@ irqreturn_t timer_interrupt(int irq, void *dev) | |||
172 | profile_tick(CPU_PROFILING); | 173 | profile_tick(CPU_PROFILING); |
173 | #endif | 174 | #endif |
174 | 175 | ||
175 | write_seqlock(&xtime_lock); | ||
176 | |||
177 | /* | 176 | /* |
178 | * Calculate how many ticks have passed since the last update, | 177 | * Calculate how many ticks have passed since the last update, |
179 | * including any previous partial leftover. Save any resulting | 178 | * including any previous partial leftover. Save any resulting |
@@ -187,13 +186,11 @@ irqreturn_t timer_interrupt(int irq, void *dev) | |||
187 | nticks = delta >> FIX_SHIFT; | 186 | nticks = delta >> FIX_SHIFT; |
188 | 187 | ||
189 | if (nticks) | 188 | if (nticks) |
190 | do_timer(nticks); | 189 | xtime_update(nticks); |
191 | |||
192 | write_sequnlock(&xtime_lock); | ||
193 | 190 | ||
194 | if (test_perf_event_pending()) { | 191 | if (test_irq_work_pending()) { |
195 | clear_perf_event_pending(); | 192 | clear_irq_work_pending(); |
196 | perf_event_do_pending(); | 193 | irq_work_run(); |
197 | } | 194 | } |
198 | 195 | ||
199 | #ifndef CONFIG_SMP | 196 | #ifndef CONFIG_SMP |
@@ -378,8 +375,7 @@ static struct clocksource clocksource_rpcc = { | |||
378 | 375 | ||
379 | static inline void register_rpcc_clocksource(long cycle_freq) | 376 | static inline void register_rpcc_clocksource(long cycle_freq) |
380 | { | 377 | { |
381 | clocksource_calc_mult_shift(&clocksource_rpcc, cycle_freq, 4); | 378 | clocksource_register_hz(&clocksource_rpcc, cycle_freq); |
382 | clocksource_register(&clocksource_rpcc); | ||
383 | } | 379 | } |
384 | #else /* !CONFIG_SMP */ | 380 | #else /* !CONFIG_SMP */ |
385 | static inline void register_rpcc_clocksource(long cycle_freq) | 381 | static inline void register_rpcc_clocksource(long cycle_freq) |
@@ -506,7 +502,7 @@ set_rtc_mmss(unsigned long nowtime) | |||
506 | CMOS_WRITE(real_seconds,RTC_SECONDS); | 502 | CMOS_WRITE(real_seconds,RTC_SECONDS); |
507 | CMOS_WRITE(real_minutes,RTC_MINUTES); | 503 | CMOS_WRITE(real_minutes,RTC_MINUTES); |
508 | } else { | 504 | } else { |
509 | printk(KERN_WARNING | 505 | printk_once(KERN_NOTICE |
510 | "set_rtc_mmss: can't update from %d to %d\n", | 506 | "set_rtc_mmss: can't update from %d to %d\n", |
511 | cmos_minutes, real_minutes); | 507 | cmos_minutes, real_minutes); |
512 | retval = -1; | 508 | retval = -1; |