From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752995AbdCMO52 (ORCPT ); Mon, 13 Mar 2017 10:57:28 -0400 Received: from merlin.infradead.org ([205.233.59.134]:42704 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751119AbdCMO5V (ORCPT ); Mon, 13 Mar 2017 10:57:21 -0400 Date: Mon, 13 Mar 2017 15:57:12 +0100 From: Peter Zijlstra To: Thomas Gleixner Cc: linux-kernel@vger.kernel.org, subhransu.s.prusty@intel.com, kevin.b.stanton@intel.com, akataria@vmware.com, john.stultz@linaro.org, christopher.s.hall@intel.com, Ingo Molnar Subject: x86/tsc: Fix ART for TSC_KNOWN_FREQ Message-ID: <20170313145712.GI3312@twins.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.23.1 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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" Cc: kevin.b.stanton@intel.com Cc: Alok N Kataria Cc: John Stultz Cc: Christopher Hall Fixes: 57779dc2b3b7 ("x86, tsc: Skip refined tsc calibration on systems with reliable TSC") Signed-off-by: Peter Zijlstra (Intel) --- 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; }