Skip to contentSkip to conversation

x86/tsc: Unset TSC_KNOWN_FREQ and TSC_RELIABLE flags on Intel Bay Trail SoC

PATCH Superseded Vipul Kumar 1 participant 1 message Dec 19, 2019

Subsystems (2)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 x86/tsc: Unset TSC_KNOWN_FREQ and TSC_RELIABLE flags on Intel Bay Trail SoC

From: Vipul Kumar <[email protected]>

'commit f3a02ecebed7 ("x86/tsc: Set TSC_KNOWN_FREQ and TSC_RELIABLE flags on Intel Atom SoCs")', causing time drift for Bay trail SoC. These flags are set for SoCs having cpuid_level 0x15 or more. Bay trail is having cpuid_level 0xb.

So, unset both flags to make sure the clocksource calibration can be done.

---
- Changes in v2:
- Added linux-stable along with kernel version in CC

---
 arch/x86/kernel/tsc_msr.c | 3 +++
 1 file changed, 3 insertions(+)
arch/x86/kernel/tsc_msr.c +3 -0
index e0cbe4f2af49..1ca27c28db98 100644
@@ -112,6 +112,9 @@ unsigned long cpu_khz_from_msr(void)
 	lapic_timer_period = (freq * 1000) / HZ;
 #endif
 
+	if (boot_cpu_data.cpuid_level < 0x15)
+		return res;
+
 	/*
 	 * TSC frequency determined by MSR is always considered "known"
 	 * because it is reported by HW.
Signature · 1 line
2.20.1