From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757344AbcK2Qt5 (ORCPT ); Tue, 29 Nov 2016 11:49:57 -0500 Received: from terminus.zytor.com ([198.137.202.10]:37616 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756379AbcK2Qtk (ORCPT ); Tue, 29 Nov 2016 11:49:40 -0500 Date: Tue, 29 Nov 2016 08:48:48 -0800 From: tip-bot for Thomas Gleixner Message-ID: Cc: linux-kernel@vger.kernel.org, peterz@infradead.org, mingo@kernel.org, tglx@linutronix.de, hpa@zytor.com, yinghai@kernel.org, bp@alien8.de Reply-To: bp@alien8.de, yinghai@kernel.org, hpa@zytor.com, tglx@linutronix.de, peterz@infradead.org, mingo@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20161119134017.892095627@linutronix.de> References: <20161119134017.892095627@linutronix.de> To: linux-tip-commits@vger.kernel.org Subject: [tip:x86/timers] x86/tsc: Move sync cleanup to a safe place Git-Commit-ID: ce68ad5a095f151426cab18cc8fad9c968421da3 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: ce68ad5a095f151426cab18cc8fad9c968421da3 Gitweb: http://git.kernel.org/tip/ce68ad5a095f151426cab18cc8fad9c968421da3 Author: Thomas Gleixner AuthorDate: Sat, 19 Nov 2016 13:47:40 +0000 Committer: Thomas Gleixner CommitDate: Tue, 29 Nov 2016 17:29:48 +0100 x86/tsc: Move sync cleanup to a safe place Cleaning up the stop marker on the control CPU is wrong when we want to add retry support. Move the cleanup to the starting CPU. Signed-off-by: Thomas Gleixner Reviewed-by: Ingo Molnar Cc: Peter Zijlstra Cc: Yinghai Lu Cc: Borislav Petkov Link: http://lkml.kernel.org/r/20161119134017.892095627@linutronix.de Signed-off-by: Thomas Gleixner --- arch/x86/kernel/tsc_sync.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/arch/x86/kernel/tsc_sync.c b/arch/x86/kernel/tsc_sync.c index 1770f60..8642223 100644 --- a/arch/x86/kernel/tsc_sync.c +++ b/arch/x86/kernel/tsc_sync.c @@ -267,11 +267,6 @@ void check_tsc_sync_source(int cpu) } /* - * Reset it - in case this is a second bootup: - */ - atomic_set(&stop_count, 0); - - /* * Wait for the target to start or to skip the test: */ while (atomic_read(&start_count) != cpus - 1) { @@ -360,6 +355,11 @@ void check_tsc_sync_target(void) */ while (atomic_read(&stop_count) != cpus) cpu_relax(); + + /* + * Reset it for the next sync test: + */ + atomic_set(&stop_count, 0); } #endif /* CONFIG_SMP */