From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753122AbdCVUUI (ORCPT ); Wed, 22 Mar 2017 16:20:08 -0400 Received: from userp1040.oracle.com ([156.151.31.81]:41536 "EHLO userp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753061AbdCVUT5 (ORCPT ); Wed, 22 Mar 2017 16:19:57 -0400 From: Pavel Tatashin To: x86@kernel.org, linux-kernel@vger.kernel.org, mingo@redhat.com, peterz@infradead.org, tglx@linutronix.de, hpa@zytor.com Subject: [v1 5/9] x86/tsc: disable early messages from quick_pit_calibrate Date: Wed, 22 Mar 2017 16:24:21 -0400 Message-Id: <1490214265-899964-6-git-send-email-pasha.tatashin@oracle.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1490214265-899964-1-git-send-email-pasha.tatashin@oracle.com> References: <1490214265-899964-1-git-send-email-pasha.tatashin@oracle.com> X-Source-IP: aserv0021.oracle.com [141.146.126.233] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org quick_pit_calibrate() is another method that can determine the frequency of TSC. However, this function by default outputs some information messages. Allow to disable these messages if this function is called early so early time stamps can be initialized before anything is printed. Signed-off-by: Pavel Tatashin --- arch/x86/kernel/tsc.c | 10 ++++++---- 1 files changed, 6 insertions(+), 4 deletions(-) diff --git a/arch/x86/kernel/tsc.c b/arch/x86/kernel/tsc.c index c73a7f9..5add503 100644 --- a/arch/x86/kernel/tsc.c +++ b/arch/x86/kernel/tsc.c @@ -580,7 +580,7 @@ static inline int pit_expect_msb(unsigned char val, u64 *tscp, unsigned long *de #define MAX_QUICK_PIT_MS 50 #define MAX_QUICK_PIT_ITERATIONS (MAX_QUICK_PIT_MS * PIT_TICK_RATE / 1000 / 256) -static unsigned long quick_pit_calibrate(void) +static unsigned long quick_pit_calibrate(bool early_boot) { int i; u64 tsc, delta; @@ -645,7 +645,8 @@ static unsigned long quick_pit_calibrate(void) goto success; } } - pr_info("Fast TSC calibration failed\n"); + if (!early_boot) + pr_info("Fast TSC calibration failed\n"); return 0; success: @@ -664,7 +665,8 @@ static unsigned long quick_pit_calibrate(void) */ delta *= PIT_TICK_RATE; do_div(delta, i*256*1000); - pr_info("Fast TSC calibration using PIT\n"); + if (!early_boot) + pr_info("Fast TSC calibration using PIT\n"); return delta; } @@ -764,7 +766,7 @@ unsigned long native_calibrate_cpu(void) return fast_calibrate; local_irq_save(flags); - fast_calibrate = quick_pit_calibrate(); + fast_calibrate = quick_pit_calibrate(false); local_irq_restore(flags); if (fast_calibrate) return fast_calibrate; -- 1.7.1