From patchwork Thu Jul 5 17:50:31 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 10510081 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 0C1C06024A for ; Thu, 5 Jul 2018 17:50:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E5C741FFCD for ; Thu, 5 Jul 2018 17:50:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D920F223B3; Thu, 5 Jul 2018 17:50:50 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7AA431FFCD for ; Thu, 5 Jul 2018 17:50:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753764AbeGERui (ORCPT ); Thu, 5 Jul 2018 13:50:38 -0400 Received: from mail-pl0-f65.google.com ([209.85.160.65]:44824 "EHLO mail-pl0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753403AbeGERug (ORCPT ); Thu, 5 Jul 2018 13:50:36 -0400 Received: by mail-pl0-f65.google.com with SMTP id m16-v6so1593641pls.11 for ; Thu, 05 Jul 2018 10:50:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=DkMcqAFaeEJxjYoWVDK4vidf6ScNNCBtbd/QZR2sM7g=; b=ZfjY5yFmf56PfUY5i6emE8zGLjNobk93Mc6KvOTjNACuizCqvNa744Ze/ue6aHGUB9 7IL0b5pnC1pKqsVmmyhj3gUz5mu5jJCGf+zqZnBHw55YPWB+ju877etyWEHqANvP3sWs bDEfrOzFtGuviRXjpa9dkONpZruqvY+uT1a+A= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=DkMcqAFaeEJxjYoWVDK4vidf6ScNNCBtbd/QZR2sM7g=; b=iz432gRsjGBiW2z7kP4crU8QY8/Jsvaeg+CHD2N8wzgEH7ixGOkoOU3KrunbNWD97B SpaY5o6Xi0ZTKpMyDOuFxFvXu8yAkE96jgC6rH4CXsUnEz/aFUszPl5mdJoSW3Tw8HA9 dAnZHAUyq990DISIePK7L9WFtx1H1CqYiWMGRCUHDqWYRBvgdEZ7cnUvWZ51DMtkgXcJ y89e8XHWWO6ow99zqSm2rrLt+RfvaA5OtttTgPlsgT5LWYjd7/7HXapzLLc+irhO0Yk1 hrL09JnjDoQS2gPECAA56Zrbh/3+3aXmIMT4VMbpPsIXTs1sMkp7FUmwCTSU8LyGkQQP u59g== X-Gm-Message-State: APt69E37ELwQfdIJ2Mz2aE6bgG20p59/w4+ckA7FnkTswi5ZKkMUnOMH W3flIMKYQFN+W79MXyJIYy+ksw== X-Google-Smtp-Source: AAOMgpc9noROr0YWrf+EAJvAGOyZeHURgVubBrlLQA2XEFwa/67WquJvWxdqfNbdBvHXzfWofcViyw== X-Received: by 2002:a17:902:7202:: with SMTP id ba2-v6mr6998911plb.119.1530813035699; Thu, 05 Jul 2018 10:50:35 -0700 (PDT) Received: from localhost.localdomain ([2601:1c2:600:5100:4e72:b9ff:fe99:466a]) by smtp.gmail.com with ESMTPSA id b123-v6sm11922633pfb.156.2018.07.05.10.50.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 05 Jul 2018 10:50:34 -0700 (PDT) From: John Stultz To: lkml Cc: John Stultz , Thomas Gleixner , Ingo Molnar , Miroslav Lichvar , Richard Cochran , Prarit Bhargava , Stephen Boyd , Shuah Khan , linux-kselftest@vger.kernel.org Subject: [RFC][PATCH v2] selftest: timers: Tweak raw_skew to SKIP when ADJ_OFFSET/other clock adjustments are in progress Date: Thu, 5 Jul 2018 10:50:31 -0700 Message-Id: <1530813031-19243-1-git-send-email-john.stultz@linaro.org> X-Mailer: git-send-email 2.7.4 Sender: linux-kselftest-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 sets a flag which we check 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 --- v2: Widened the checks to look for other clock adjustments that could happen, as suggested by Miroslav --- tools/testing/selftests/timers/raw_skew.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tools/testing/selftests/timers/raw_skew.c b/tools/testing/selftests/timers/raw_skew.c index ca6cd14..dcf73c5 100644 --- 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(); }