diff options
Diffstat (limited to 'arch/sh/kernel/time_64.c')
-rw-r--r-- | arch/sh/kernel/time_64.c | 31 |
1 files changed, 17 insertions, 14 deletions
diff --git a/arch/sh/kernel/time_64.c b/arch/sh/kernel/time_64.c index f819ba38a6ce..898977ee2030 100644 --- a/arch/sh/kernel/time_64.c +++ b/arch/sh/kernel/time_64.c | |||
@@ -229,15 +229,22 @@ static long last_rtc_update; | |||
229 | static inline void do_timer_interrupt(void) | 229 | static inline void do_timer_interrupt(void) |
230 | { | 230 | { |
231 | unsigned long long current_ctc; | 231 | unsigned long long current_ctc; |
232 | |||
233 | if (current->pid) | ||
234 | profile_tick(CPU_PROFILING); | ||
235 | |||
236 | /* | ||
237 | * Here we are in the timer irq handler. We just have irqs locally | ||
238 | * disabled but we don't know if the timer_bh is running on the other | ||
239 | * CPU. We need to avoid to SMP race with it. NOTE: we don' t need | ||
240 | * the irq version of write_lock because as just said we have irq | ||
241 | * locally disabled. -arca | ||
242 | */ | ||
243 | write_lock(&xtime_lock); | ||
232 | asm ("getcon cr62, %0" : "=r" (current_ctc)); | 244 | asm ("getcon cr62, %0" : "=r" (current_ctc)); |
233 | ctc_last_interrupt = (unsigned long) current_ctc; | 245 | ctc_last_interrupt = (unsigned long) current_ctc; |
234 | 246 | ||
235 | do_timer(1); | 247 | do_timer(1); |
236 | #ifndef CONFIG_SMP | ||
237 | update_process_times(user_mode(get_irq_regs())); | ||
238 | #endif | ||
239 | if (current->pid) | ||
240 | profile_tick(CPU_PROFILING); | ||
241 | 248 | ||
242 | #ifdef CONFIG_HEARTBEAT | 249 | #ifdef CONFIG_HEARTBEAT |
243 | if (sh_mv.mv_heartbeat != NULL) | 250 | if (sh_mv.mv_heartbeat != NULL) |
@@ -259,6 +266,11 @@ static inline void do_timer_interrupt(void) | |||
259 | /* do it again in 60 s */ | 266 | /* do it again in 60 s */ |
260 | last_rtc_update = xtime.tv_sec - 600; | 267 | last_rtc_update = xtime.tv_sec - 600; |
261 | } | 268 | } |
269 | write_unlock(&xtime_lock); | ||
270 | |||
271 | #ifndef CONFIG_SMP | ||
272 | update_process_times(user_mode(get_irq_regs())); | ||
273 | #endif | ||
262 | } | 274 | } |
263 | 275 | ||
264 | /* | 276 | /* |
@@ -275,16 +287,7 @@ static irqreturn_t timer_interrupt(int irq, void *dev_id) | |||
275 | timer_status &= ~0x100; | 287 | timer_status &= ~0x100; |
276 | ctrl_outw(timer_status, TMU0_TCR); | 288 | ctrl_outw(timer_status, TMU0_TCR); |
277 | 289 | ||
278 | /* | ||
279 | * Here we are in the timer irq handler. We just have irqs locally | ||
280 | * disabled but we don't know if the timer_bh is running on the other | ||
281 | * CPU. We need to avoid to SMP race with it. NOTE: we don' t need | ||
282 | * the irq version of write_lock because as just said we have irq | ||
283 | * locally disabled. -arca | ||
284 | */ | ||
285 | write_lock(&xtime_lock); | ||
286 | do_timer_interrupt(); | 290 | do_timer_interrupt(); |
287 | write_unlock(&xtime_lock); | ||
288 | 291 | ||
289 | return IRQ_HANDLED; | 292 | return IRQ_HANDLED; |
290 | } | 293 | } |