aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/tsc.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/kernel/tsc.c')
-rw-r--r--arch/x86/kernel/tsc.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/arch/x86/kernel/tsc.c b/arch/x86/kernel/tsc.c
index 71f4368b357e..fc3672a303d6 100644
--- a/arch/x86/kernel/tsc.c
+++ b/arch/x86/kernel/tsc.c
@@ -744,10 +744,16 @@ static cycle_t __vsyscall_fn vread_tsc(void)
744} 744}
745#endif 745#endif
746 746
747static void resume_tsc(void)
748{
749 clocksource_tsc.cycle_last = 0;
750}
751
747static struct clocksource clocksource_tsc = { 752static struct clocksource clocksource_tsc = {
748 .name = "tsc", 753 .name = "tsc",
749 .rating = 300, 754 .rating = 300,
750 .read = read_tsc, 755 .read = read_tsc,
756 .resume = resume_tsc,
751 .mask = CLOCKSOURCE_MASK(64), 757 .mask = CLOCKSOURCE_MASK(64),
752 .shift = 22, 758 .shift = 22,
753 .flags = CLOCK_SOURCE_IS_CONTINUOUS | 759 .flags = CLOCK_SOURCE_IS_CONTINUOUS |
@@ -761,12 +767,14 @@ void mark_tsc_unstable(char *reason)
761{ 767{
762 if (!tsc_unstable) { 768 if (!tsc_unstable) {
763 tsc_unstable = 1; 769 tsc_unstable = 1;
764 printk("Marking TSC unstable due to %s\n", reason); 770 printk(KERN_INFO "Marking TSC unstable due to %s\n", reason);
765 /* Change only the rating, when not registered */ 771 /* Change only the rating, when not registered */
766 if (clocksource_tsc.mult) 772 if (clocksource_tsc.mult)
767 clocksource_change_rating(&clocksource_tsc, 0); 773 clocksource_mark_unstable(&clocksource_tsc);
768 else 774 else {
775 clocksource_tsc.flags |= CLOCK_SOURCE_UNSTABLE;
769 clocksource_tsc.rating = 0; 776 clocksource_tsc.rating = 0;
777 }
770 } 778 }
771} 779}
772 780