From patchwork Tue Dec 10 05:09:55 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 22198 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ig0-f197.google.com (mail-ig0-f197.google.com [209.85.213.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 072D123FF5 for ; Tue, 10 Dec 2013 05:10:16 +0000 (UTC) Received: by mail-ig0-f197.google.com with SMTP id uy17sf1834400igb.0 for ; Mon, 09 Dec 2013 21:10:16 -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=cbYxnUYTJ14uiHiuy/2Yl0i+w1W8gX+/hAFsgFodDLpkgOAfwmk1nbZ4T7iZV05PIO dj/C7zN8eIG+Y+UTGQYL0YbQiZbSpS+DzGLitTjeU0TBqbrLPm74foxEhGjSPGliAKPI MLtnO352iJfFrLYSdZuwYDD1OEUaDiwNFxf6YalSH0Wlke24KJ/FdLfk/EOSuQ1S5z9F 9FnWFqt4m5DsPwx6xkP5zz/myWHKA4DCTERVqPcxAs1+aDh5Lx/CxbrzbGRyxUxF6VYU 2eUog8FywZS+O3ofy7eCpV512j077XwhorncRuH77td5n0TlkHHiujAxIc/t5CHRmWst d1wg== X-Gm-Message-State: ALoCoQlzku9TjhiDs+mA0QFrOTdL+1kvVIyz5cNH/SLc3WdXeHwj7qfQ/gOmCjQn8aCcvyA6Jcmp X-Received: by 10.50.66.238 with SMTP id i14mr7756118igt.4.1386652216471; Mon, 09 Dec 2013 21:10:16 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.83.2 with SMTP id m2ls2323660qey.37.gmail; Mon, 09 Dec 2013 21:10:16 -0800 (PST) X-Received: by 10.58.100.244 with SMTP id fb20mr12479679veb.6.1386652216339; Mon, 09 Dec 2013 21:10:16 -0800 (PST) Received: from mail-vc0-f171.google.com (mail-vc0-f171.google.com [209.85.220.171]) by mx.google.com with ESMTPS id s5si4675553vev.117.2013.12.09.21.10.16 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 09 Dec 2013 21:10:16 -0800 (PST) Received-SPF: neutral (google.com: 209.85.220.171 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.171; Received: by mail-vc0-f171.google.com with SMTP id ik5so4202940vcb.16 for ; Mon, 09 Dec 2013 21:10:16 -0800 (PST) X-Received: by 10.52.171.79 with SMTP id as15mr10560408vdc.1.1386652216255; Mon, 09 Dec 2013 21:10:16 -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 u4csp160472vcz; Mon, 9 Dec 2013 21:10:15 -0800 (PST) X-Received: by 10.68.204.136 with SMTP id ky8mr24734174pbc.33.1386652215424; Mon, 09 Dec 2013 21:10:15 -0800 (PST) Received: from mail-pb0-f46.google.com (mail-pb0-f46.google.com [209.85.160.46]) by mx.google.com with ESMTPS id g5si9279914pav.346.2013.12.09.21.10.15 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 09 Dec 2013 21:10:15 -0800 (PST) Received-SPF: neutral (google.com: 209.85.160.46 is neither permitted nor denied by best guess record for domain of john.stultz@linaro.org) client-ip=209.85.160.46; Received: by mail-pb0-f46.google.com with SMTP id md12so6822597pbc.19 for ; Mon, 09 Dec 2013 21:10:15 -0800 (PST) X-Received: by 10.68.172.196 with SMTP id be4mr627597pbc.12.1386652214936; Mon, 09 Dec 2013 21:10:14 -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 dq3sm701959pbc.35.2013.12.09.21.10.13 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 09 Dec 2013 21:10:14 -0800 (PST) From: John Stultz To: LKML Cc: John Stultz , Thomas Gleixner , Prarit Bhargava , Richard Cochran , Ingo Molnar , stable Subject: [RFC][PATCH 1/3] timekeeping: Fix lost updates to tai adjustment Date: Mon, 9 Dec 2013 21:09:55 -0800 Message-Id: <1386652197-7035-2-git-send-email-john.stultz@linaro.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1386652197-7035-1-git-send-email-john.stultz@linaro.org> References: <1386652197-7035-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.171 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);