From patchwork Wed Dec 11 19:11:34 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 22252 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qa0-f69.google.com (mail-qa0-f69.google.com [209.85.216.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id A2AFB23FC9 for ; Wed, 11 Dec 2013 19:11:46 +0000 (UTC) Received: by mail-qa0-f69.google.com with SMTP id ii20sf1966224qab.4 for ; Wed, 11 Dec 2013 11:11:46 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=0rmB9vZu9Pj4x3L3JUhJKobbMXp4ED3trBFyIEiJFMs=; b=lWTsPUtiqygIbBggdplylEmahzAXQa49ciQPE/92wzXlo1yI8uQu3+DxMnV8nQdq9o OAXL6am2UYQpRsyZQG8F17mVBlTEn5GoTI40NUKnaxc68cWml3bOPCCfK6voz83LwOAM v0l43/CNRBJKaiVCSgdVuRa9LIVlTuDkljzeFE3srMTNVrNLkrmsJfv+zKeAWconLcUD 1Ii0EBs3E5QE01bxCDu+RS2F8ZTxaGZLB8IdSm6jUTn5U0Wu6HY+myvztuIOXH2RJ6dQ YeS4Jt3qTt1byJ5hW20itO/UvmCo7DlT+D94KfATUDN5p3SvjPr0E2y9i+KcW+mKIImp 7JkQ== X-Gm-Message-State: ALoCoQmA8aQ3tLTA30l17g0F96tjew5adskJ6rj9pOrvFjfoJpSP6QbbfbHeeVrXtu+NTVPBlOsD X-Received: by 10.58.46.36 with SMTP id s4mr1161835vem.18.1386789106488; Wed, 11 Dec 2013 11:11:46 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.116.108 with SMTP id jv12ls193854qeb.18.gmail; Wed, 11 Dec 2013 11:11:46 -0800 (PST) X-Received: by 10.220.64.69 with SMTP id d5mr1232714vci.11.1386789106404; Wed, 11 Dec 2013 11:11:46 -0800 (PST) Received: from mail-vc0-f170.google.com (mail-vc0-f170.google.com [209.85.220.170]) by mx.google.com with ESMTPS id pv1si6744266veb.56.2013.12.11.11.11.46 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 11 Dec 2013 11:11:46 -0800 (PST) Received-SPF: neutral (google.com: 209.85.220.170 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.170; Received: by mail-vc0-f170.google.com with SMTP id la4so2960722vcb.29 for ; Wed, 11 Dec 2013 11:11:46 -0800 (PST) X-Received: by 10.220.97.69 with SMTP id k5mr992730vcn.45.1386789106317; Wed, 11 Dec 2013 11:11:46 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.174.196 with SMTP id u4csp296246vcz; Wed, 11 Dec 2013 11:11:45 -0800 (PST) X-Received: by 10.68.212.10 with SMTP id ng10mr3998389pbc.158.1386789105427; Wed, 11 Dec 2013 11:11:45 -0800 (PST) Received: from mail-pd0-f176.google.com (mail-pd0-f176.google.com [209.85.192.176]) by mx.google.com with ESMTPS id im7si13654405pbd.71.2013.12.11.11.11.45 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 11 Dec 2013 11:11:45 -0800 (PST) Received-SPF: neutral (google.com: 209.85.192.176 is neither permitted nor denied by best guess record for domain of john.stultz@linaro.org) client-ip=209.85.192.176; Received: by mail-pd0-f176.google.com with SMTP id w10so10036637pde.21 for ; Wed, 11 Dec 2013 11:11:45 -0800 (PST) X-Received: by 10.68.241.134 with SMTP id wi6mr4027639pbc.44.1386789104799; Wed, 11 Dec 2013 11:11:44 -0800 (PST) Received: from localhost.localdomain (c-67-170-153-23.hsd1.or.comcast.net. [67.170.153.23]) by mx.google.com with ESMTPSA id ki1sm34506989pbd.1.2013.12.11.11.11.43 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 11 Dec 2013 11:11:43 -0800 (PST) From: John Stultz To: LKML Cc: John Stultz , Thomas Gleixner , Prarit Bhargava , Richard Cochran , Ingo Molnar , stable Subject: [RFC][PATCH 1/5] timekeeping: Fix lost updates to tai adjustment Date: Wed, 11 Dec 2013 11:11:34 -0800 Message-Id: <1386789098-17391-2-git-send-email-john.stultz@linaro.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1386789098-17391-1-git-send-email-john.stultz@linaro.org> References: <1386789098-17391-1-git-send-email-john.stultz@linaro.org> X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: john.stultz@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.170 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Since 48cdc135d4840 (Implement a shadow timekeeper), we have to call timekeeping_update() after any adjustment to the timekeeping structure in order to make sure that any adjustments to the structure persist. Unfortunately, the updates to the tai offset via adjtimex do not trigger this update, causing adjustments to the tai offset to be made and then over-written by the previous value at the next update_wall_time() call. This patch resovles the issue by calling timekeeping_update() right after setting the tai offset. Cc: Thomas Gleixner Cc: Prarit Bhargava Cc: Richard Cochran Cc: Ingo Molnar Cc: stable #3.10+ Signed-off-by: John Stultz --- kernel/time/timekeeping.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c index 87b4f00..6bad3d9 100644 --- a/kernel/time/timekeeping.c +++ b/kernel/time/timekeeping.c @@ -610,6 +610,7 @@ void timekeeping_set_tai_offset(s32 tai_offset) raw_spin_lock_irqsave(&timekeeper_lock, flags); write_seqcount_begin(&timekeeper_seq); __timekeeping_set_tai_offset(tk, tai_offset); + timekeeping_update(tk, TK_MIRROR | TK_CLOCK_WAS_SET); write_seqcount_end(&timekeeper_seq); raw_spin_unlock_irqrestore(&timekeeper_lock, flags); clock_was_set(); @@ -1698,7 +1699,7 @@ int do_adjtimex(struct timex *txc) if (tai != orig_tai) { __timekeeping_set_tai_offset(tk, tai); - update_pvclock_gtod(tk, true); + timekeeping_update(tk, TK_MIRROR | TK_CLOCK_WAS_SET); clock_was_set_delayed(); } write_seqcount_end(&timekeeper_seq);