From 401dd5daed126bbd29ca582a2e6ab6a0e786aac8 Mon Sep 17 00:00:00 2001 From: Farshad Ghanei Date: Wed, 28 Mar 2018 13:34:35 -0400 Subject: [PATCH] timer: Fix timer calibration logic. loops_per_tick calculation should get updated with loops_per_tick, not with high_bit. --- src/devices/timer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/devices/timer.c b/src/devices/timer.c index befaaae..8b92341 100644 --- a/src/devices/timer.c +++ b/src/devices/timer.c @@ -60,7 +60,7 @@ timer_calibrate (void) /* Refine the next 8 bits of loops_per_tick. */ high_bit = loops_per_tick; for (test_bit = high_bit >> 1; test_bit != high_bit >> 10; test_bit >>= 1) - if (!too_many_loops (high_bit | test_bit)) + if (!too_many_loops (loops_per_tick | test_bit)) loops_per_tick |= test_bit; printf ("%'"PRIu64" loops/s.\n", (uint64_t) loops_per_tick * TIMER_FREQ); -- 2.30.2