Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2515931imm; Mon, 24 Sep 2018 05:47:02 -0700 (PDT) X-Google-Smtp-Source: ACcGV60zVWKjR3rDboYxbxy44jZy9eZ8CP9epY3m6MhyMhcYP+jq9lhtDLCN76C3FZ6e8rTlZeTD X-Received: by 2002:a63:4243:: with SMTP id p64-v6mr9509690pga.127.1537793222220; Mon, 24 Sep 2018 05:47:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537793222; cv=none; d=google.com; s=arc-20160816; b=NlzbblY5guGp5x5iwdbklwD2X2e/D7i+qLPMxAmLGP7FF4Pc1A+P1S/gQvK+R0yMrO K00P0TX+ROrXk/LwPgmvEWx7U+AryvmxO9eXmUYe/hytJPluavg8Wlotiu6iIbNQ5+j/ Fa9XJL1jDeBpWFEjY0oYqkrOMpL7XctxEgWMPMGQ5JPCq8oSM6UKAm66GQsJ/rDWOaC6 kPKDM7x0QzF3F6cEdOrPKaxrVNpzdDRscxYmnBx5h1qD2okystk9gP0ElQoCODH4QFoW jdi6o+Dj2ReEMU1RLW4+9ucJSTCA8Hz2Yn2bRXTgvTuoCz1dL7EdpRGABjUOBULhHW17 7S2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from; bh=/pEyxVBVB3Q8LkxUkGLgQ3cC5FAx2CF/QpUzV/lqu8g=; b=rPZ5a30sxpEJy9LH6NnQvoVIYVFOfhrNJKVnWV5/uIATWe8X8XuGMJeKCwI54CDYsU Uc6oScOgAZOHZyWnHc87LXjlkaj1lysL9TSREnrNmNZwCj8h12Yy4r4tTGnQXqRSmoqA sgTznaiACj772XdtsX7XUEx7IiMznEfApvJ8mInKBxuFGjv8EwBH6O3VnwbIfUuOgeOB WbRg4RcZOOBv0Scdi2H+cwk9PlMTLMmIiTref1igv0aSPbHGJ/ZkQbuJGQ9RXuKVEmnW iwJ57nMrfjZm/J+Bs6RgVPswBYma1glgE59+7Svq81wu0mL07IYRN8NBPpuChg/Ee97+ G4Ew== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 186-v6si3490412pfv.101.2018.09.24.05.46.47; Mon, 24 Sep 2018 05:47:02 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389160AbeIXSqa (ORCPT + 99 others); Mon, 24 Sep 2018 14:46:30 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:59622 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388911AbeIXSq3 (ORCPT ); Mon, 24 Sep 2018 14:46:29 -0400 Received: from localhost (ip-213-127-77-73.ip.prioritytelecom.net [213.127.77.73]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 433811099; Mon, 24 Sep 2018 12:44:30 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Thomas Gleixner , Ingo Molnar , Miroslav Lichvar , Richard Cochran , Prarit Bhargava , Stephen Boyd , Shuah Khan , linux-kselftest@vger.kernel.org, John Stultz , Sasha Levin Subject: [PATCH 4.18 218/235] selftest: timers: Tweak raw_skew to SKIP when ADJ_OFFSET/other clock adjustments are in progress Date: Mon, 24 Sep 2018 13:53:24 +0200 Message-Id: <20180924113125.269769392@linuxfoundation.org> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20180924113103.999624566@linuxfoundation.org> References: <20180924113103.999624566@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: John Stultz [ Upstream commit 1416270f4a1ae83ea84156ceba19a66a8f88be1f ] In the past we've warned when ADJ_OFFSET was in progress, usually caused by ntpd or some other time adjusting daemon running in non steady sate, which can cause the skew calculations to be incorrect. Thus, this patch checks to see if the clock was being adjusted when we fail so that we don't cause false negatives. Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Miroslav Lichvar Cc: Richard Cochran Cc: Prarit Bhargava Cc: Stephen Boyd Cc: Shuah Khan Cc: linux-kselftest@vger.kernel.org Suggested-by: Miroslav Lichvar Signed-off-by: John Stultz Signed-off-by: Greg Kroah-Hartman --- v2: Widened the checks to look for other clock adjustments that could happen, as suggested by Miroslav v3: Fixed up commit message Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- tools/testing/selftests/timers/raw_skew.c | 5 +++++ 1 file changed, 5 insertions(+) --- a/tools/testing/selftests/timers/raw_skew.c +++ b/tools/testing/selftests/timers/raw_skew.c @@ -134,6 +134,11 @@ int main(int argv, char **argc) printf(" %lld.%i(act)", ppm/1000, abs((int)(ppm%1000))); if (llabs(eppm - ppm) > 1000) { + if (tx1.offset || tx2.offset || + tx1.freq != tx2.freq || tx1.tick != tx2.tick) { + printf(" [SKIP]\n"); + return ksft_exit_skip("The clock was adjusted externally. Shutdown NTPd or other time sync daemons\n"); + } printf(" [FAILED]\n"); return ksft_exit_fail(); }