linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [v3] x86/tsc: Unset TSC_KNOWN_FREQ and TSC_RELIABLE flags on Intel Bay Trail SoC
@ 2020-01-21 14:41 Vipul Kumar
  2020-01-21 15:24 ` Andy Shevchenko
                   ` (2 more replies)
  0 siblings, 3 replies; 32+ messages in thread
From: Vipul Kumar @ 2020-01-21 14:41 UTC (permalink / raw)
  To: Daniel Lezcano, Thomas Gleixner
  Cc: linux-kernel, Stable, Srikanth Krishnakar, Cedric Hombourger,
	Vipul Kumar, x86, Bin Gao, Andy Shevchenko, Len Brown,
	Vipul Kumar

From: Vipul Kumar <vipul_kumar@mentor.com>

commit f3a02ecebed7 ("x86/tsc: Set TSC_KNOWN_FREQ and TSC_RELIABLE
flags on Intel Atom SoCs"), is setting TSC_KNOWN_FREQ and TSC_RELIABLE
flags for Soc's which is causing time drift on Valleyview/Bay trail Soc.

This patch introduces a new macro to skip these flags.

Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Cc: stable@vger.kernel.org
---
Changes in V2:
- Added linux-stable along with kernel version in CC

Changes in V3:
- Intead of cpuid-level, used macro to skip the flags

Tested-on: SIEMENS-IPC227E board
---
 arch/x86/Kconfig          | 10 ++++++++++
 arch/x86/kernel/tsc_msr.c |  4 ++++
 2 files changed, 14 insertions(+)

diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 5e89499..f6c175d 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -1155,6 +1155,16 @@ config X86_THERMAL_VECTOR
 	def_bool y
 	depends on X86_MCE_INTEL
 
+config X86_FEATURE_TSC_UNKNOWN_FREQ
+	bool "Support to skip tsc known frequency flag"
+	help
+	  Include support to skip X86_FEATURE_TSC_KNOWN_FREQ flag
+
+	  X86_FEATURE_TSC_KNOWN_FREQ flag is causing time-drift on Valleyview/
+	  Baytrail SoC.
+	  By selecting this option, user can skip X86_FEATURE_TSC_KNOWN_FREQ
+	  flag to use refine tsc freq calibration.
+
 source "arch/x86/events/Kconfig"
 
 config X86_LEGACY_VM86
diff --git a/arch/x86/kernel/tsc_msr.c b/arch/x86/kernel/tsc_msr.c
index e0cbe4f..60c3a4a 100644
--- a/arch/x86/kernel/tsc_msr.c
+++ b/arch/x86/kernel/tsc_msr.c
@@ -112,6 +112,10 @@ unsigned long cpu_khz_from_msr(void)
 	lapic_timer_period = (freq * 1000) / HZ;
 #endif
 
+#ifdef CONFIG_X86_FEATURE_TSC_UNKNOWN_FREQ
+	return res;
+#endif
+
 	/*
 	 * TSC frequency determined by MSR is always considered "known"
 	 * because it is reported by HW.
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 32+ messages in thread

end of thread, other threads:[~2020-02-13 21:06 UTC | newest]

Thread overview: 32+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-21 14:41 [v3] x86/tsc: Unset TSC_KNOWN_FREQ and TSC_RELIABLE flags on Intel Bay Trail SoC Vipul Kumar
2020-01-21 15:24 ` Andy Shevchenko
2020-01-21 17:45 ` Thomas Gleixner
     [not found]   ` <CADdC98RJpsvu_zWehNGDDN=W11rD11NSPaodg-zuaXsHuOJYTQ@mail.gmail.com>
2020-01-22 14:45     ` Thomas Gleixner
     [not found]       ` <CADdC98TE4oNWZyEsqXzr+zJtfdTTOyeeuHqu1u04X_ktLHo-Hg@mail.gmail.com>
2020-01-23 14:12         ` Thomas Gleixner
2020-01-23 14:41         ` Andy Shevchenko
2020-01-23 21:18           ` Hans de Goede
2020-01-24  8:35             ` Thomas Gleixner
2020-01-24  9:11               ` Hans de Goede
2020-01-24 11:55                 ` Thomas Gleixner
2020-01-24 15:54                   ` Hans de Goede
     [not found]                     ` <CADdC98To8VKOUWnR+8zAJ04vgdc4vJoh2h96588+5XFer9YTJw@mail.gmail.com>
2020-01-28 14:23                       ` Hans de Goede
2020-01-28 14:39                         ` vipul kumar
2020-01-28 15:11                       ` Thomas Gleixner
2020-01-28 18:57                   ` Hans de Goede
2020-01-28 22:39                     ` Thomas Gleixner
2020-01-29 13:03                       ` Andy Shevchenko
2020-01-29 13:21                         ` Hans de Goede
2020-01-29 14:14                           ` Andy Shevchenko
2020-01-29 14:27                             ` Hans de Goede
2020-01-29 15:13                               ` Thomas Gleixner
2020-01-29 15:53                                 ` Andy Shevchenko
2020-01-29 15:59                                   ` Andy Shevchenko
2020-01-29 16:02                                     ` Andy Shevchenko
2020-01-29 20:57                                   ` Thomas Gleixner
2020-01-30  8:54                                     ` Hans de Goede
2020-02-13 18:32                                     ` Dave Hansen
2020-02-13 21:06                                       ` Thomas Gleixner
2020-01-29 15:14                               ` David Laight
2020-01-29 11:43             ` vipul kumar
2020-01-29  5:20       ` vipul kumar
     [not found] ` <20200122022619.B95C024655@mail.kernel.org>
2020-01-22  4:24   ` Kumar, Vipul

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).