patch-2.1.103 linux/arch/i386/kernel/time.c

Next file: linux/arch/i386/mm/init.c
Previous file: linux/arch/i386/kernel/smp.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.102/linux/arch/i386/kernel/time.c linux/arch/i386/kernel/time.c
@@ -399,11 +399,12 @@
 	 */
 	if (time_state != TIME_BAD && xtime.tv_sec > last_rtc_update + 660 &&
 	    xtime.tv_usec > 500000 - (tick >> 1) &&
-	    xtime.tv_usec < 500000 + (tick >> 1))
-	  if (set_rtc_mmss(xtime.tv_sec) == 0)
-	    last_rtc_update = xtime.tv_sec;
-	  else
-	    last_rtc_update = xtime.tv_sec - 600; /* do it again in 60 s */
+	    xtime.tv_usec < 500000 + (tick >> 1)) {
+		if (set_rtc_mmss(xtime.tv_sec) == 0)
+			last_rtc_update = xtime.tv_sec;
+		else
+			last_rtc_update = xtime.tv_sec - 600; /* do it again in 60 s */
+	}
 #if 0
 	/* As we return to user mode fire off the other CPU schedulers.. this is 
 	   basically because we don't yet share IRQ's around. This message is
@@ -524,6 +525,14 @@
 	xtime.tv_sec = get_cmos_time();
 	xtime.tv_usec = 0;
 
+/*
+ * If we have APM enabled we can't currently depend
+ * on the cycle counter, because a suspend to disk
+ * will reset it. Somebody should come up with a
+ * better solution than to just disable the fast time
+ * code..
+ */
+#ifndef CONFIG_APM
 	/* If we have the CPU hardware time counters, use them */
 	if (boot_cpu_data.x86_capability & 16) {
 		do_gettimeoffset = do_fast_gettimeoffset;
@@ -547,5 +556,6 @@
 			 "=d" (init_timer_cc.high));
 		irq0.handler = pentium_timer_interrupt;
 	}
+#endif
 	setup_x86_irq(0, &irq0);
 }

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov