diff options
Diffstat (limited to 'arch/x86_64/kernel/time.c')
-rw-r--r-- | arch/x86_64/kernel/time.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/arch/x86_64/kernel/time.c b/arch/x86_64/kernel/time.c index 35a896ef4c35..fdaddc4e5284 100644 --- a/arch/x86_64/kernel/time.c +++ b/arch/x86_64/kernel/time.c | |||
@@ -1089,6 +1089,7 @@ static unsigned long PIE_freq = DEFAULT_RTC_INT_FREQ; | |||
1089 | static unsigned long PIE_count; | 1089 | static unsigned long PIE_count; |
1090 | 1090 | ||
1091 | static unsigned long hpet_rtc_int_freq; /* RTC interrupt frequency */ | 1091 | static unsigned long hpet_rtc_int_freq; /* RTC interrupt frequency */ |
1092 | static unsigned int hpet_t1_cmp; /* cached comparator register */ | ||
1092 | 1093 | ||
1093 | int is_hpet_enabled(void) | 1094 | int is_hpet_enabled(void) |
1094 | { | 1095 | { |
@@ -1125,6 +1126,7 @@ int hpet_rtc_timer_init(void) | |||
1125 | cnt = hpet_readl(HPET_COUNTER); | 1126 | cnt = hpet_readl(HPET_COUNTER); |
1126 | cnt += ((hpet_tick*HZ)/hpet_rtc_int_freq); | 1127 | cnt += ((hpet_tick*HZ)/hpet_rtc_int_freq); |
1127 | hpet_writel(cnt, HPET_T1_CMP); | 1128 | hpet_writel(cnt, HPET_T1_CMP); |
1129 | hpet_t1_cmp = cnt; | ||
1128 | local_irq_restore(flags); | 1130 | local_irq_restore(flags); |
1129 | 1131 | ||
1130 | cfg = hpet_readl(HPET_T1_CFG); | 1132 | cfg = hpet_readl(HPET_T1_CFG); |
@@ -1152,9 +1154,10 @@ static void hpet_rtc_timer_reinit(void) | |||
1152 | hpet_rtc_int_freq = DEFAULT_RTC_INT_FREQ; | 1154 | hpet_rtc_int_freq = DEFAULT_RTC_INT_FREQ; |
1153 | 1155 | ||
1154 | /* It is more accurate to use the comparator value than current count.*/ | 1156 | /* It is more accurate to use the comparator value than current count.*/ |
1155 | cnt = hpet_readl(HPET_T1_CMP); | 1157 | cnt = hpet_t1_cmp; |
1156 | cnt += hpet_tick*HZ/hpet_rtc_int_freq; | 1158 | cnt += hpet_tick*HZ/hpet_rtc_int_freq; |
1157 | hpet_writel(cnt, HPET_T1_CMP); | 1159 | hpet_writel(cnt, HPET_T1_CMP); |
1160 | hpet_t1_cmp = cnt; | ||
1158 | } | 1161 | } |
1159 | 1162 | ||
1160 | /* | 1163 | /* |