aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/time/tick-common.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/time/tick-common.c')
-rw-r--r--kernel/time/tick-common.c26
1 files changed, 23 insertions, 3 deletions
diff --git a/kernel/time/tick-common.c b/kernel/time/tick-common.c
index a5b877130ae9..1a60c2ae96a8 100644
--- a/kernel/time/tick-common.c
+++ b/kernel/time/tick-common.c
@@ -373,18 +373,39 @@ void tick_shutdown(unsigned int *cpup)
373 } 373 }
374} 374}
375 375
376/**
377 * tick_suspend - Suspend the tick and the broadcast device
378 *
379 * Called from syscore_suspend() via timekeeping_suspend with only one
380 * CPU online and interrupts disabled or from tick_unfreeze() under
381 * tick_freeze_lock.
382 *
383 * No locks required. Nothing can change the per cpu device.
384 */
376void tick_suspend(void) 385void tick_suspend(void)
377{ 386{
378 struct tick_device *td = this_cpu_ptr(&tick_cpu_device); 387 struct tick_device *td = this_cpu_ptr(&tick_cpu_device);
379 388
380 clockevents_shutdown(td->evtdev); 389 clockevents_shutdown(td->evtdev);
390 tick_suspend_broadcast();
381} 391}
382 392
393/**
394 * tick_resume - Resume the tick and the broadcast device
395 *
396 * Called from syscore_resume() via timekeeping_resume with only one
397 * CPU online and interrupts disabled or from tick_unfreeze() under
398 * tick_freeze_lock.
399 *
400 * No locks required. Nothing can change the per cpu device.
401 */
383void tick_resume(void) 402void tick_resume(void)
384{ 403{
385 struct tick_device *td = this_cpu_ptr(&tick_cpu_device); 404 struct tick_device *td;
386 int broadcast = tick_resume_broadcast(); 405 int broadcast;
387 406
407 broadcast = tick_resume_broadcast();
408 td = this_cpu_ptr(&tick_cpu_device);
388 clockevents_tick_resume(td->evtdev); 409 clockevents_tick_resume(td->evtdev);
389 410
390 if (!broadcast) { 411 if (!broadcast) {
@@ -416,7 +437,6 @@ void tick_freeze(void)
416 timekeeping_suspend(); 437 timekeeping_suspend();
417 } else { 438 } else {
418 tick_suspend(); 439 tick_suspend();
419 tick_suspend_broadcast();
420 } 440 }
421 441
422 raw_spin_unlock(&tick_freeze_lock); 442 raw_spin_unlock(&tick_freeze_lock);