|
@@ -59,7 +59,7 @@ static int notsc __initdata = 0;
|
|
unsigned int cpu_khz; /* TSC clocks / usec, not used here */
|
|
unsigned int cpu_khz; /* TSC clocks / usec, not used here */
|
|
static unsigned long hpet_period; /* fsecs / HPET clock */
|
|
static unsigned long hpet_period; /* fsecs / HPET clock */
|
|
unsigned long hpet_tick; /* HPET clocks / interrupt */
|
|
unsigned long hpet_tick; /* HPET clocks / interrupt */
|
|
-static int hpet_use_timer; /* Use counter of hpet for time keeping, otherwise PIT */
|
|
|
|
|
|
+int hpet_use_timer; /* Use counter of hpet for time keeping, otherwise PIT */
|
|
unsigned long vxtime_hz = PIT_TICK_RATE;
|
|
unsigned long vxtime_hz = PIT_TICK_RATE;
|
|
int report_lost_ticks; /* command line option */
|
|
int report_lost_ticks; /* command line option */
|
|
unsigned long long monotonic_base;
|
|
unsigned long long monotonic_base;
|
|
@@ -326,7 +326,10 @@ static noinline void handle_lost_ticks(int lost, struct pt_regs *regs)
|
|
print_symbol("rip %s\n", regs->rip);
|
|
print_symbol("rip %s\n", regs->rip);
|
|
if (vxtime.mode == VXTIME_TSC && vxtime.hpet_address) {
|
|
if (vxtime.mode == VXTIME_TSC && vxtime.hpet_address) {
|
|
printk(KERN_WARNING "Falling back to HPET\n");
|
|
printk(KERN_WARNING "Falling back to HPET\n");
|
|
- vxtime.last = hpet_readl(HPET_T0_CMP) - hpet_tick;
|
|
|
|
|
|
+ if (hpet_use_timer)
|
|
|
|
+ vxtime.last = hpet_readl(HPET_T0_CMP) - hpet_tick;
|
|
|
|
+ else
|
|
|
|
+ vxtime.last = hpet_readl(HPET_COUNTER);
|
|
vxtime.mode = VXTIME_HPET;
|
|
vxtime.mode = VXTIME_HPET;
|
|
do_gettimeoffset = do_gettimeoffset_hpet;
|
|
do_gettimeoffset = do_gettimeoffset_hpet;
|
|
}
|
|
}
|
|
@@ -988,7 +991,10 @@ void __init time_init_gtod(void)
|
|
notsc = 1;
|
|
notsc = 1;
|
|
if (vxtime.hpet_address && notsc) {
|
|
if (vxtime.hpet_address && notsc) {
|
|
timetype = hpet_use_timer ? "HPET" : "PIT/HPET";
|
|
timetype = hpet_use_timer ? "HPET" : "PIT/HPET";
|
|
- vxtime.last = hpet_readl(HPET_T0_CMP) - hpet_tick;
|
|
|
|
|
|
+ if (hpet_use_timer)
|
|
|
|
+ vxtime.last = hpet_readl(HPET_T0_CMP) - hpet_tick;
|
|
|
|
+ else
|
|
|
|
+ vxtime.last = hpet_readl(HPET_COUNTER);
|
|
vxtime.mode = VXTIME_HPET;
|
|
vxtime.mode = VXTIME_HPET;
|
|
do_gettimeoffset = do_gettimeoffset_hpet;
|
|
do_gettimeoffset = do_gettimeoffset_hpet;
|
|
#ifdef CONFIG_X86_PM_TIMER
|
|
#ifdef CONFIG_X86_PM_TIMER
|