aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/time
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/time')
-rw-r--r--kernel/time/clockevents.c28
-rw-r--r--kernel/time/tick-common.c50
-rw-r--r--kernel/time/tick-internal.h5
3 files changed, 35 insertions, 48 deletions
diff --git a/kernel/time/clockevents.c b/kernel/time/clockevents.c
index dd70b4842c62..0e3a8448e115 100644
--- a/kernel/time/clockevents.c
+++ b/kernel/time/clockevents.c
@@ -404,10 +404,36 @@ void clockevents_notify(unsigned long reason, void *arg)
404 int cpu; 404 int cpu;
405 405
406 raw_spin_lock_irqsave(&clockevents_lock, flags); 406 raw_spin_lock_irqsave(&clockevents_lock, flags);
407 tick_notify(reason, arg);
408 407
409 switch (reason) { 408 switch (reason) {
409 case CLOCK_EVT_NOTIFY_BROADCAST_ON:
410 case CLOCK_EVT_NOTIFY_BROADCAST_OFF:
411 case CLOCK_EVT_NOTIFY_BROADCAST_FORCE:
412 tick_broadcast_on_off(reason, arg);
413 break;
414
415 case CLOCK_EVT_NOTIFY_BROADCAST_ENTER:
416 case CLOCK_EVT_NOTIFY_BROADCAST_EXIT:
417 tick_broadcast_oneshot_control(reason);
418 break;
419
420 case CLOCK_EVT_NOTIFY_CPU_DYING:
421 tick_handover_do_timer(arg);
422 break;
423
424 case CLOCK_EVT_NOTIFY_SUSPEND:
425 tick_suspend();
426 tick_suspend_broadcast();
427 break;
428
429 case CLOCK_EVT_NOTIFY_RESUME:
430 tick_resume();
431 break;
432
410 case CLOCK_EVT_NOTIFY_CPU_DEAD: 433 case CLOCK_EVT_NOTIFY_CPU_DEAD:
434 tick_shutdown_broadcast_oneshot(arg);
435 tick_shutdown_broadcast(arg);
436 tick_shutdown(arg);
411 /* 437 /*
412 * Unregister the clock event devices which were 438 * Unregister the clock event devices which were
413 * released from the users in the notify chain. 439 * released from the users in the notify chain.
diff --git a/kernel/time/tick-common.c b/kernel/time/tick-common.c
index 170a4bdfa99e..84c7cfca4d7d 100644
--- a/kernel/time/tick-common.c
+++ b/kernel/time/tick-common.c
@@ -284,7 +284,7 @@ out_bc:
284 * 284 *
285 * Called with interrupts disabled. 285 * Called with interrupts disabled.
286 */ 286 */
287static void tick_handover_do_timer(int *cpup) 287void tick_handover_do_timer(int *cpup)
288{ 288{
289 if (*cpup == tick_do_timer_cpu) { 289 if (*cpup == tick_do_timer_cpu) {
290 int cpu = cpumask_first(cpu_online_mask); 290 int cpu = cpumask_first(cpu_online_mask);
@@ -301,7 +301,7 @@ static void tick_handover_do_timer(int *cpup)
301 * access the hardware device itself. 301 * access the hardware device itself.
302 * We just set the mode and remove it from the lists. 302 * We just set the mode and remove it from the lists.
303 */ 303 */
304static void tick_shutdown(unsigned int *cpup) 304void tick_shutdown(unsigned int *cpup)
305{ 305{
306 struct tick_device *td = &per_cpu(tick_cpu_device, *cpup); 306 struct tick_device *td = &per_cpu(tick_cpu_device, *cpup);
307 struct clock_event_device *dev = td->evtdev; 307 struct clock_event_device *dev = td->evtdev;
@@ -319,14 +319,14 @@ static void tick_shutdown(unsigned int *cpup)
319 } 319 }
320} 320}
321 321
322static void tick_suspend(void) 322void tick_suspend(void)
323{ 323{
324 struct tick_device *td = &__get_cpu_var(tick_cpu_device); 324 struct tick_device *td = &__get_cpu_var(tick_cpu_device);
325 325
326 clockevents_shutdown(td->evtdev); 326 clockevents_shutdown(td->evtdev);
327} 327}
328 328
329static void tick_resume(void) 329void tick_resume(void)
330{ 330{
331 struct tick_device *td = &__get_cpu_var(tick_cpu_device); 331 struct tick_device *td = &__get_cpu_var(tick_cpu_device);
332 int broadcast = tick_resume_broadcast(); 332 int broadcast = tick_resume_broadcast();
@@ -341,48 +341,6 @@ static void tick_resume(void)
341 } 341 }
342} 342}
343 343
344/*
345 * Called with clockevents_lock held and interrupts disabled
346 */
347void tick_notify(unsigned long reason, void *dev)
348{
349 switch (reason) {
350
351 case CLOCK_EVT_NOTIFY_BROADCAST_ON:
352 case CLOCK_EVT_NOTIFY_BROADCAST_OFF:
353 case CLOCK_EVT_NOTIFY_BROADCAST_FORCE:
354 tick_broadcast_on_off(reason, dev);
355 break;
356
357 case CLOCK_EVT_NOTIFY_BROADCAST_ENTER:
358 case CLOCK_EVT_NOTIFY_BROADCAST_EXIT:
359 tick_broadcast_oneshot_control(reason);
360 break;
361
362 case CLOCK_EVT_NOTIFY_CPU_DYING:
363 tick_handover_do_timer(dev);
364 break;
365
366 case CLOCK_EVT_NOTIFY_CPU_DEAD:
367 tick_shutdown_broadcast_oneshot(dev);
368 tick_shutdown_broadcast(dev);
369 tick_shutdown(dev);
370 break;
371
372 case CLOCK_EVT_NOTIFY_SUSPEND:
373 tick_suspend();
374 tick_suspend_broadcast();
375 break;
376
377 case CLOCK_EVT_NOTIFY_RESUME:
378 tick_resume();
379 break;
380
381 default:
382 break;
383 }
384}
385
386/** 344/**
387 * tick_init - initialize the tick control 345 * tick_init - initialize the tick control
388 */ 346 */
diff --git a/kernel/time/tick-internal.h b/kernel/time/tick-internal.h
index 60742fe6f63d..06bfc8802dfb 100644
--- a/kernel/time/tick-internal.h
+++ b/kernel/time/tick-internal.h
@@ -18,8 +18,11 @@ extern int tick_do_timer_cpu __read_mostly;
18 18
19extern void tick_setup_periodic(struct clock_event_device *dev, int broadcast); 19extern void tick_setup_periodic(struct clock_event_device *dev, int broadcast);
20extern void tick_handle_periodic(struct clock_event_device *dev); 20extern void tick_handle_periodic(struct clock_event_device *dev);
21extern void tick_notify(unsigned long reason, void *dev);
22extern void tick_check_new_device(struct clock_event_device *dev); 21extern void tick_check_new_device(struct clock_event_device *dev);
22extern void tick_handover_do_timer(int *cpup);
23extern void tick_shutdown(unsigned int *cpup);
24extern void tick_suspend(void);
25extern void tick_resume(void);
23 26
24extern void clockevents_shutdown(struct clock_event_device *dev); 27extern void clockevents_shutdown(struct clock_event_device *dev);
25 28