]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
x86: Skip late calibration if our reference timer has low quality
authorMark Johnston <markj@FreeBSD.org>
Mon, 3 Jan 2022 15:14:41 +0000 (10:14 -0500)
committerMark Johnston <markj@FreeBSD.org>
Thu, 6 Jan 2022 13:46:33 +0000 (08:46 -0500)
commit08161fd3b207105847bdd1dd8729ea4cbda6e537
tree556750982fc5ac2c847da314cdcb5b4dc852f629
parent1d15c6b3e51637471ace760006e377d59e34a6dc
x86: Skip late calibration if our reference timer has low quality

Some AMD Geode-based systems end up using the 8254 PIT to calibrate the
TSC during late calibration, which doesn't work because that
timecounter's mask (65535) is much smaller than its frequency (1193182).
Moreover, early calibration is done against the 8254 timer anyway.

Work around the problem by simply using early calibration results if no
high-quality timecounters exist.

PR: 260868
Fixes: 22875f88799e ("x86: Implement deferred TSC calibration")
Reported and tested by: mike@sentex.net, Stefan Hegnauer <stefan.hegnauer@gmx.ch>
Reviewed by: imp, kib
Sponsored by: The FreeBSD Foundation

(cherry picked from commit 0e494a9e3fd86ef54899dcbe0268866629096c1e)
sys/x86/x86/tsc.c