]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commit
x86/tsc: Future-proof native_calibrate_tsc()
authorLen Brown <len.brown@intel.com>
Thu, 1 Feb 2018 18:59:27 +0000 (13:59 -0500)
committerStefan Bader <stefan.bader@canonical.com>
Wed, 14 Mar 2018 10:41:14 +0000 (11:41 +0100)
commit635796d8840f8174e90039a7ad7be1e69d9209a6
treeb13a44cc45835f185e94d7c39405d2d9b71f93af
parentbebdaa21b4f6590a78a835619a9b3f1016fb51d0
x86/tsc: Future-proof native_calibrate_tsc()

BugLink: http://bugs.launchpad.net/bugs/1744988
If the crystal frequency cannot be determined via CPUID(15).crystal_khz or
the built-in table then native_calibrate_tsc() will still set the
X86_FEATURE_TSC_KNOWN_FREQ flag which prevents the refined TSC calibration.

As a consequence such systems use cpu_khz for the TSC frequency which is
incorrect when cpu_khz != tsc_khz resulting in time drift.

Return early when the crystal frequency cannot be retrieved without setting
the X86_FEATURE_TSC_KNOWN_FREQ flag. This ensures that the refined TSC
calibration is invoked.

[ tglx: Steam-blastered changelog. Sigh ]

Fixes: 4ca4df0b7eb0 ("x86/tsc: Mark TSC frequency determined by CPUID as known")
Signed-off-by: Len Brown <len.brown@intel.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: peterz@infradead.org
Cc: Bin Gao <bin.gao@intel.com>
Cc: stable@vger.kernel.org
Link: https://lkml.kernel.org/r/0fe2503aa7d7fc69137141fc705541a78101d2b9.1513920414.git.len.brown@intel.com
(cherry picked from commit da4ae6c4a0b8dee5a5377a385545d2250fa8cddb)
Signed-off-by: Joseph Salisbury <joseph.salisbury@canonical.com>
Acked-by: Colin Ian King <colin.king@canonical.com>
Acked-by: Khalid Elmously <khalid.elmously@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
arch/x86/kernel/tsc.c