From: john stultz <johnstul@us.ibm.com>

Here's the patch w/ timer_cyclone.c and timer_hpet.c fixed as well. 

I've also got the same fix for acpi-pm time-source in my tree. I'll send
it to you shortly.



 25-akpm/arch/i386/kernel/timers/timer_cyclone.c |    4 ++--
 25-akpm/arch/i386/kernel/timers/timer_hpet.c    |    2 +-
 25-akpm/arch/i386/kernel/timers/timer_tsc.c     |    9 ++++-----
 3 files changed, 7 insertions(+), 8 deletions(-)

diff -puN arch/i386/kernel/timers/timer_cyclone.c~ia32-jiffy-wrap-fixes arch/i386/kernel/timers/timer_cyclone.c
--- 25/arch/i386/kernel/timers/timer_cyclone.c~ia32-jiffy-wrap-fixes	Wed Dec 17 14:17:57 2003
+++ 25-akpm/arch/i386/kernel/timers/timer_cyclone.c	Wed Dec 17 14:17:57 2003
@@ -71,7 +71,7 @@ static void mark_offset_cyclone(void)
 	lost = delta/(1000000/HZ);
 	delay = delta%(1000000/HZ);
 	if (lost >= 2)
-		jiffies += lost-1;
+		jiffies_64 += lost-1;
 	
 	/* update the monotonic base value */
 	this_offset = ((unsigned long long)last_cyclone_high<<32)|last_cyclone_low;
@@ -88,7 +88,7 @@ static void mark_offset_cyclone(void)
 	 * usec delta is > 90% # of usecs/tick)
 	 */
 	if (lost && abs(delay - delay_at_last_interrupt) > (900000/HZ))
-		jiffies++;
+		jiffies_64++;
 }
 
 static unsigned long get_offset_cyclone(void)
diff -puN arch/i386/kernel/timers/timer_hpet.c~ia32-jiffy-wrap-fixes arch/i386/kernel/timers/timer_hpet.c
--- 25/arch/i386/kernel/timers/timer_hpet.c~ia32-jiffy-wrap-fixes	Wed Dec 17 14:17:57 2003
+++ 25-akpm/arch/i386/kernel/timers/timer_hpet.c	Wed Dec 17 14:17:57 2003
@@ -108,7 +108,7 @@ static void mark_offset_hpet(void)
 	offset = hpet_readl(HPET_T0_CMP) - hpet_tick;
 	if (unlikely(((offset - hpet_last) > hpet_tick) && (hpet_last != 0))) {
 		int lost_ticks = (offset - hpet_last) / hpet_tick;
-		jiffies += lost_ticks;
+		jiffies_64 += lost_ticks;
 	}
 	hpet_last = offset;
 
diff -puN arch/i386/kernel/timers/timer_tsc.c~ia32-jiffy-wrap-fixes arch/i386/kernel/timers/timer_tsc.c
--- 25/arch/i386/kernel/timers/timer_tsc.c~ia32-jiffy-wrap-fixes	Wed Dec 17 14:17:57 2003
+++ 25-akpm/arch/i386/kernel/timers/timer_tsc.c	Wed Dec 17 14:17:57 2003
@@ -30,7 +30,6 @@ struct timer_opts timer_tsc;
 int tsc_disable __initdata = 0;
 
 extern spinlock_t i8253_lock;
-extern volatile unsigned long jiffies;
 
 static int use_tsc;
 /* Number of usecs that the last interrupt was delayed */
@@ -141,7 +140,7 @@ unsigned long long sched_clock(void)
 #ifndef CONFIG_NUMA
 	if (!use_tsc)
 #endif
-		return (unsigned long long)jiffies * (1000000000 / HZ);
+		return (unsigned long long)get_jiffies_64() * (1000000000 / HZ);
 
 	/* Read the Time Stamp Counter */
 	rdtscll(this_offset);
@@ -215,7 +214,7 @@ static void mark_offset_tsc(void)
 	lost = delta/(1000000/HZ);
 	delay = delta%(1000000/HZ);
 	if (lost >= 2) {
-		jiffies += lost-1;
+		jiffies_64 += lost-1;
 
 		/* sanity check to ensure we're not always losing ticks */
 		if (lost_count++ > 100) {
@@ -241,7 +240,7 @@ static void mark_offset_tsc(void)
 	 * usec delta is > 90% # of usecs/tick)
 	 */
 	if (lost && abs(delay - delay_at_last_interrupt) > (900000/HZ))
-		jiffies++;
+		jiffies_64++;
 }
 
 static void delay_tsc(unsigned long loops)
@@ -283,7 +282,7 @@ static void mark_offset_tsc_hpet(void)
 	offset = hpet_readl(HPET_T0_CMP) - hpet_tick;
 	if (unlikely(((offset - hpet_last) > hpet_tick) && (hpet_last != 0))) {
 		int lost_ticks = (offset - hpet_last) / hpet_tick;
-		jiffies += lost_ticks;
+		jiffies_64 += lost_ticks;
 	}
 	hpet_last = hpet_current;
 

_