diff options
-rw-r--r-- | arch/x86_64/kernel/apic.c | 2 | ||||
-rw-r--r-- | arch/x86_64/kernel/time.c | 12 | ||||
-rw-r--r-- | include/asm-x86_64/hpet.h | 2 |
3 files changed, 12 insertions, 4 deletions
diff --git a/arch/x86_64/kernel/apic.c b/arch/x86_64/kernel/apic.c index 6147770b4347..7a0a3e8d5d72 100644 --- a/arch/x86_64/kernel/apic.c +++ b/arch/x86_64/kernel/apic.c | |||
@@ -708,7 +708,7 @@ static void setup_APIC_timer(unsigned int clocks) | |||
708 | local_irq_save(flags); | 708 | local_irq_save(flags); |
709 | 709 | ||
710 | /* wait for irq slice */ | 710 | /* wait for irq slice */ |
711 | if (vxtime.hpet_address) { | 711 | if (vxtime.hpet_address && hpet_use_timer) { |
712 | int trigger = hpet_readl(HPET_T0_CMP); | 712 | int trigger = hpet_readl(HPET_T0_CMP); |
713 | while (hpet_readl(HPET_COUNTER) >= trigger) | 713 | while (hpet_readl(HPET_COUNTER) >= trigger) |
714 | /* do nothing */ ; | 714 | /* do nothing */ ; |
diff --git a/arch/x86_64/kernel/time.c b/arch/x86_64/kernel/time.c index dba7237be5c1..3c58c30506a1 100644 --- a/arch/x86_64/kernel/time.c +++ b/arch/x86_64/kernel/time.c | |||
@@ -59,7 +59,7 @@ static int notsc __initdata = 0; | |||
59 | unsigned int cpu_khz; /* TSC clocks / usec, not used here */ | 59 | unsigned int cpu_khz; /* TSC clocks / usec, not used here */ |
60 | static unsigned long hpet_period; /* fsecs / HPET clock */ | 60 | static unsigned long hpet_period; /* fsecs / HPET clock */ |
61 | unsigned long hpet_tick; /* HPET clocks / interrupt */ | 61 | unsigned long hpet_tick; /* HPET clocks / interrupt */ |
62 | static int hpet_use_timer; /* Use counter of hpet for time keeping, otherwise PIT */ | 62 | int hpet_use_timer; /* Use counter of hpet for time keeping, otherwise PIT */ |
63 | unsigned long vxtime_hz = PIT_TICK_RATE; | 63 | unsigned long vxtime_hz = PIT_TICK_RATE; |
64 | int report_lost_ticks; /* command line option */ | 64 | int report_lost_ticks; /* command line option */ |
65 | unsigned long long monotonic_base; | 65 | unsigned long long monotonic_base; |
@@ -326,7 +326,10 @@ static noinline void handle_lost_ticks(int lost, struct pt_regs *regs) | |||
326 | print_symbol("rip %s\n", regs->rip); | 326 | print_symbol("rip %s\n", regs->rip); |
327 | if (vxtime.mode == VXTIME_TSC && vxtime.hpet_address) { | 327 | if (vxtime.mode == VXTIME_TSC && vxtime.hpet_address) { |
328 | printk(KERN_WARNING "Falling back to HPET\n"); | 328 | printk(KERN_WARNING "Falling back to HPET\n"); |
329 | vxtime.last = hpet_readl(HPET_T0_CMP) - hpet_tick; | 329 | if (hpet_use_timer) |
330 | vxtime.last = hpet_readl(HPET_T0_CMP) - hpet_tick; | ||
331 | else | ||
332 | vxtime.last = hpet_readl(HPET_COUNTER); | ||
330 | vxtime.mode = VXTIME_HPET; | 333 | vxtime.mode = VXTIME_HPET; |
331 | do_gettimeoffset = do_gettimeoffset_hpet; | 334 | do_gettimeoffset = do_gettimeoffset_hpet; |
332 | } | 335 | } |
@@ -988,7 +991,10 @@ void __init time_init_gtod(void) | |||
988 | notsc = 1; | 991 | notsc = 1; |
989 | if (vxtime.hpet_address && notsc) { | 992 | if (vxtime.hpet_address && notsc) { |
990 | timetype = hpet_use_timer ? "HPET" : "PIT/HPET"; | 993 | timetype = hpet_use_timer ? "HPET" : "PIT/HPET"; |
991 | vxtime.last = hpet_readl(HPET_T0_CMP) - hpet_tick; | 994 | if (hpet_use_timer) |
995 | vxtime.last = hpet_readl(HPET_T0_CMP) - hpet_tick; | ||
996 | else | ||
997 | vxtime.last = hpet_readl(HPET_COUNTER); | ||
992 | vxtime.mode = VXTIME_HPET; | 998 | vxtime.mode = VXTIME_HPET; |
993 | do_gettimeoffset = do_gettimeoffset_hpet; | 999 | do_gettimeoffset = do_gettimeoffset_hpet; |
994 | #ifdef CONFIG_X86_PM_TIMER | 1000 | #ifdef CONFIG_X86_PM_TIMER |
diff --git a/include/asm-x86_64/hpet.h b/include/asm-x86_64/hpet.h index c20c28f5c7a0..08b75c15269a 100644 --- a/include/asm-x86_64/hpet.h +++ b/include/asm-x86_64/hpet.h | |||
@@ -55,6 +55,8 @@ extern int is_hpet_enabled(void); | |||
55 | extern int hpet_rtc_timer_init(void); | 55 | extern int hpet_rtc_timer_init(void); |
56 | extern int oem_force_hpet_timer(void); | 56 | extern int oem_force_hpet_timer(void); |
57 | 57 | ||
58 | extern int hpet_use_timer; | ||
59 | |||
58 | #ifdef CONFIG_HPET_EMULATE_RTC | 60 | #ifdef CONFIG_HPET_EMULATE_RTC |
59 | extern int hpet_mask_rtc_irq_bit(unsigned long bit_mask); | 61 | extern int hpet_mask_rtc_irq_bit(unsigned long bit_mask); |
60 | extern int hpet_set_rtc_irq_bit(unsigned long bit_mask); | 62 | extern int hpet_set_rtc_irq_bit(unsigned long bit_mask); |