On Mon, Oct 16, 2017 at 16:10 +0000, Joe Gidi wrote:
> Hi Mike,
>
> Thanks for the patch; it appears to fix the clock:
>
> acpitimer0 at acpi0: 3579545 Hz, 24 bits
> acpimadt0 at acpi0 addr 0xfee00000: PC-AT compat
>
> System time is advancing at the expected rate :-)
>
No, nothing is fixed yet. I'm trying to understand what's
going on. Please try this new one instead.
diff --git sys/arch/amd64/amd64/tsc.c sys/arch/amd64/amd64/tsc.c
index ce91d5b95df..40e35defb16 100644
--- sys/arch/amd64/amd64/tsc.c
+++ sys/arch/amd64/amd64/tsc.c
@@ -148,18 +148,24 @@ measure_tsc_freq(struct timecounter *tc)
continue;
usec = calculate_tc_delay(tc, count1, count2);
if ((usec < (delay_usec - RECALIBRATE_DELAY_THRESHOLD)) ||
- (usec > (delay_usec + RECALIBRATE_DELAY_THRESHOLD)))
+ (usec > (delay_usec + RECALIBRATE_DELAY_THRESHOLD))) {
+ printf("usec %d tsc1 %llu tsc2 %llu count1 %llu "
+ "count2 %llu\n", usec, tsc1, tsc2, count1, count2);
continue;
+ }
frequency = calculate_tsc_freq(tsc1, tsc2, usec);
min_freq = MIN(min_freq, frequency);
+ printf("tsc1 %llu tsc2 %llu freq %llu\n", tsc1, tsc2,
+ frequency);
}
+ min_freq = 0;
return (min_freq);
}
void
calibrate_tsc_freq(void)