public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* x86/tsc: Fix ART for TSC_KNOWN_FREQ
@ 2017-03-13 14:57 Peter Zijlstra
  2017-03-13 18:55 ` [tip:x86/urgent] " tip-bot for Peter Zijlstra
  2017-03-13 19:04 ` Thomas Gleixner
  0 siblings, 2 replies; 4+ messages in thread
From: Peter Zijlstra @ 2017-03-13 14:57 UTC (permalink / raw)
  To: Thomas Gleixner
  Cc: linux-kernel, subhransu.s.prusty, kevin.b.stanton, akataria,
	john.stultz, christopher.s.hall, Ingo Molnar


Subhransu reported that convert_art_to_tsc() isn't working for him.

It turns out that because of commit:

  57779dc2b3b7 ("x86, tsc: Skip refined tsc calibration on systems with reliable TSC")

Systems with TSC_KNOWN_FREQ (due to having CPUID.15h) will not run the
refined calibration thing, and then forget to set the ART clocksource
relation.

We cannot set the ART relation prior to running the refined calibration;
therefore duplicate the lines.

XXX: should we clear this in mark_tsc_unstable() ?

Reported-by: "Prusty, Subhransu S" <subhransu.s.prusty@intel.com>
Cc: kevin.b.stanton@intel.com
Cc: Alok N Kataria <akataria@vmware.com>
Cc: John Stultz <john.stultz@linaro.org>
Cc: Christopher Hall <christopher.s.hall@intel.com>
Fixes: 57779dc2b3b7 ("x86, tsc: Skip refined tsc calibration on systems with reliable TSC")
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
---
 arch/x86/kernel/tsc.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/x86/kernel/tsc.c b/arch/x86/kernel/tsc.c
index 4f7a9833d8e5..c73a7f9e881a 100644
--- a/arch/x86/kernel/tsc.c
+++ b/arch/x86/kernel/tsc.c
@@ -1333,6 +1333,8 @@ static int __init init_tsc_clocksource(void)
 	 * the refined calibration and directly register it as a clocksource.
 	 */
 	if (boot_cpu_has(X86_FEATURE_TSC_KNOWN_FREQ)) {
+		if (boot_cpu_has(X86_FEATURE_ART))
+			art_related_clocksource = &clocksource_tsc;
 		clocksource_register_khz(&clocksource_tsc, tsc_khz);
 		return 0;
 	}

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

end of thread, other threads:[~2017-03-13 20:12 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-03-13 14:57 x86/tsc: Fix ART for TSC_KNOWN_FREQ Peter Zijlstra
2017-03-13 18:55 ` [tip:x86/urgent] " tip-bot for Peter Zijlstra
2017-03-13 19:04 ` Thomas Gleixner
2017-03-13 20:12   ` Peter Zijlstra

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox