Skip to content
Commit 2353b47b authored by Bernd Faust's avatar Bernd Faust Committed by John Stultz
Browse files

Round the calculated scale factor in set_cyc2ns_scale()



During some experiments with an external clock (in a FPGA), we saw that
the TSC clock drifted approx. 2.5ms per second.

This drift was caused by the current way of calculating the scale.
In our case cpu_khz had a value of 3292725. This resulted in a scale
value of 310. But when doing the calculation by hand it shows that the
actual value is 310.9886188491, so a value of 311 would be more precise.

With this change the value is rounded.

Signed-off-by: default avatarBernd Faust <berndfaust@gmail.com>
Signed-off-by: default avatarJohn Stultz <john.stultz@linaro.org>
parent 023f333a
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment