diff options
Diffstat (limited to 'arch/x86/kernel')
-rw-r--r-- | arch/x86/kernel/hpet.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/arch/x86/kernel/hpet.c b/arch/x86/kernel/hpet.c index c761f914430a..388254f69a2a 100644 --- a/arch/x86/kernel/hpet.c +++ b/arch/x86/kernel/hpet.c | |||
@@ -897,7 +897,7 @@ static unsigned long hpet_rtc_flags; | |||
897 | static int hpet_prev_update_sec; | 897 | static int hpet_prev_update_sec; |
898 | static struct rtc_time hpet_alarm_time; | 898 | static struct rtc_time hpet_alarm_time; |
899 | static unsigned long hpet_pie_count; | 899 | static unsigned long hpet_pie_count; |
900 | static unsigned long hpet_t1_cmp; | 900 | static u32 hpet_t1_cmp; |
901 | static unsigned long hpet_default_delta; | 901 | static unsigned long hpet_default_delta; |
902 | static unsigned long hpet_pie_delta; | 902 | static unsigned long hpet_pie_delta; |
903 | static unsigned long hpet_pie_limit; | 903 | static unsigned long hpet_pie_limit; |
@@ -905,6 +905,14 @@ static unsigned long hpet_pie_limit; | |||
905 | static rtc_irq_handler irq_handler; | 905 | static rtc_irq_handler irq_handler; |
906 | 906 | ||
907 | /* | 907 | /* |
908 | * Check that the hpet counter c1 is ahead of the c2 | ||
909 | */ | ||
910 | static inline int hpet_cnt_ahead(u32 c1, u32 c2) | ||
911 | { | ||
912 | return (s32)(c2 - c1) < 0; | ||
913 | } | ||
914 | |||
915 | /* | ||
908 | * Registers a IRQ handler. | 916 | * Registers a IRQ handler. |
909 | */ | 917 | */ |
910 | int hpet_register_irq_handler(rtc_irq_handler handler) | 918 | int hpet_register_irq_handler(rtc_irq_handler handler) |
@@ -1075,7 +1083,7 @@ static void hpet_rtc_timer_reinit(void) | |||
1075 | hpet_t1_cmp += delta; | 1083 | hpet_t1_cmp += delta; |
1076 | hpet_writel(hpet_t1_cmp, HPET_T1_CMP); | 1084 | hpet_writel(hpet_t1_cmp, HPET_T1_CMP); |
1077 | lost_ints++; | 1085 | lost_ints++; |
1078 | } while ((s32)(hpet_readl(HPET_COUNTER) - hpet_t1_cmp) > 0); | 1086 | } while (!hpet_cnt_ahead(hpet_t1_cmp, hpet_readl(HPET_COUNTER))); |
1079 | 1087 | ||
1080 | if (lost_ints) { | 1088 | if (lost_ints) { |
1081 | if (hpet_rtc_flags & RTC_PIE) | 1089 | if (hpet_rtc_flags & RTC_PIE) |