aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/time
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/time')
-rw-r--r--kernel/time/clocksource.c6
-rw-r--r--kernel/time/timekeeping.c5
2 files changed, 6 insertions, 5 deletions
diff --git a/kernel/time/clocksource.c b/kernel/time/clocksource.c
index dda5c7130d93..1923a340bd91 100644
--- a/kernel/time/clocksource.c
+++ b/kernel/time/clocksource.c
@@ -611,10 +611,10 @@ static void clocksource_select(void)
611 best = cs; 611 best = cs;
612 break; 612 break;
613 } 613 }
614 if (curr_clocksource != best) { 614
615 printk(KERN_INFO "Switching to clocksource %s\n", best->name); 615 if (curr_clocksource != best && !timekeeping_notify(best)) {
616 pr_info("Switched to clocksource %s\n", best->name);
616 curr_clocksource = best; 617 curr_clocksource = best;
617 timekeeping_notify(curr_clocksource);
618 } 618 }
619} 619}
620 620
diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c
index 98cd470bbe49..da6e10c7a378 100644
--- a/kernel/time/timekeeping.c
+++ b/kernel/time/timekeeping.c
@@ -648,14 +648,15 @@ static int change_clocksource(void *data)
648 * This function is called from clocksource.c after a new, better clock 648 * This function is called from clocksource.c after a new, better clock
649 * source has been registered. The caller holds the clocksource_mutex. 649 * source has been registered. The caller holds the clocksource_mutex.
650 */ 650 */
651void timekeeping_notify(struct clocksource *clock) 651int timekeeping_notify(struct clocksource *clock)
652{ 652{
653 struct timekeeper *tk = &timekeeper; 653 struct timekeeper *tk = &timekeeper;
654 654
655 if (tk->clock == clock) 655 if (tk->clock == clock)
656 return; 656 return 0;
657 stop_machine(change_clocksource, clock, NULL); 657 stop_machine(change_clocksource, clock, NULL);
658 tick_clock_notify(); 658 tick_clock_notify();
659 return tk->clock == clock ? 0 : -1;
659} 660}
660 661
661/** 662/**