[ntp:questions] Is 24PPM an Excessive Real-Time Clock Correction?

Spoon root at localhost.invalid
Thu Jul 12 13:19:34 UTC 2007


Hal Murray wrote:

> I have an old Linux system with a 2.4 kernel.  It uses
> the RTC clock.  A 2.6 kernel on another system uses the 14 MHz
> crystal via the TSC.
> 
> The latter has a buggy calibration routine.  The drift jumps
> around when you reboot.  That might be another test.  Just grep
> your system log files for a line like this and see if the CPU speed
> is stable:
> Jun 30 23:26:15 localhost kernel: [    0.000000] Detected 431.255 MHz processor
> Jul  1 14:25:22 localhost kernel: [    0.000000] Detected 431.244 MHz processor
> Jul  1 17:41:10 localhost kernel: [    0.000000] Detected 431.243 MHz processor
> Jul  7 12:44:16 localhost kernel: [    0.000000] Detected 431.222 MHz processor

I have a trivial patch to skip the CPU calibration routine:

--- a/arch/i386/kernel/tsc.c
+++ b/arch/i386/kernel/tsc.c
@@ -122,6 +122,7 @@ static unsigned long calculate_cpu_khz(v
  	u64 delta64;
  	int i;
  	unsigned long flags;
+	printk("DEBUG: calculate_cpu_khz\n");

  	local_irq_save(flags);

@@ -187,7 +188,7 @@ void __init tsc_init(void)
  	if (!cpu_has_tsc || tsc_disable)
  		goto out_no_tsc;

-	cpu_khz = calculate_cpu_khz();
+	cpu_khz = 1266700;
  	tsc_khz = cpu_khz;

  	if (!cpu_khz)


(You'd replace 1266700 with an appropriate value.)

I'll make it a boot time parameter some day.




More information about the questions mailing list