From patchwork Thu Jan 2 22:23:19 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 22864 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qa0-f70.google.com (mail-qa0-f70.google.com [209.85.216.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 4A9FB202E2 for ; Thu, 2 Jan 2014 22:23:36 +0000 (UTC) Received: by mail-qa0-f70.google.com with SMTP id j5sf18788341qaq.9 for ; Thu, 02 Jan 2014 14:23:36 -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=wCFzJZnufvU5iQzppzTUDFMQVYdKMMm243ID7mkf4w4=; b=DxKdMbSDyN6qG4XKDyDMu/p4R4uMG6cUs5k3fSsmvOvQqD+LK2QmiwYMjmOaAIccX0 fjmWCR+TqwJq8+Fb9hBOhsWjt9K0X4Rg31jbXjTPjJKQb27JUzzn5FL3ytWbg0aKthgN meQkUCOrSqHgZIPw1z5pTHD6kpeoGBXhnguwRN0Iwvhmnn+yBj6yb3iWyT7qXBrEJ5q7 fd/r85dUrBpbbEvXeW/IMLskkAlZ1UtK1NIyq02tZwABnFlftjspsmGtrhTrEdYK0vcA W1LIKtMKv8dQ2unyDxLmNHqougnDO/CvHVsFvWeRX1TUzqG5VJMY8a9olRXb2NQGI3FJ 8Wuw== X-Gm-Message-State: ALoCoQkL5IwS3YHxtPXgSEg368kxRGXYwxGJMwIsWN3pTHc6NzKWHp8c75FrM4KrXLrKnzeXDn89 X-Received: by 10.58.216.198 with SMTP id os6mr16715542vec.30.1388701415922; Thu, 02 Jan 2014 14:23:35 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.3.228 with SMTP id f4ls4565750qef.85.gmail; Thu, 02 Jan 2014 14:23:35 -0800 (PST) X-Received: by 10.220.106.84 with SMTP id w20mr14819567vco.18.1388701415684; Thu, 02 Jan 2014 14:23:35 -0800 (PST) Received: from mail-ve0-f171.google.com (mail-ve0-f171.google.com [209.85.128.171]) by mx.google.com with ESMTPS id cy15si23775716veb.144.2014.01.02.14.23.35 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 02 Jan 2014 14:23:35 -0800 (PST) Received-SPF: neutral (google.com: 209.85.128.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.128.171; Received: by mail-ve0-f171.google.com with SMTP id pa12so7532562veb.2 for ; Thu, 02 Jan 2014 14:23:35 -0800 (PST) X-Received: by 10.52.237.228 with SMTP id vf4mr40600754vdc.3.1388701415599; Thu, 02 Jan 2014 14:23:35 -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.59.13.131 with SMTP id ey3csp795754ved; Thu, 2 Jan 2014 14:23:35 -0800 (PST) X-Received: by 10.66.139.100 with SMTP id qx4mr73941672pab.141.1388701414409; Thu, 02 Jan 2014 14:23:34 -0800 (PST) Received: from mail-pd0-f170.google.com (mail-pd0-f170.google.com [209.85.192.170]) by mx.google.com with ESMTPS id s4si11096170pbg.213.2014.01.02.14.23.33 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 02 Jan 2014 14:23:34 -0800 (PST) Received-SPF: neutral (google.com: 209.85.192.170 is neither permitted nor denied by best guess record for domain of john.stultz@linaro.org) client-ip=209.85.192.170; Received: by mail-pd0-f170.google.com with SMTP id g10so14685994pdj.29 for ; Thu, 02 Jan 2014 14:23:33 -0800 (PST) X-Received: by 10.68.130.10 with SMTP id oa10mr6553827pbb.160.1388701413513; Thu, 02 Jan 2014 14:23:33 -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 ju10sm104179969pbd.33.2014.01.02.14.23.32 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 02 Jan 2014 14:23:32 -0800 (PST) From: John Stultz To: LKML Cc: John Stultz , Sasha Levin , Thomas Gleixner , Prarit Bhargava , Richard Cochran , Ingo Molnar , stable Subject: [PATCH 1/9] timekeeping: Fix lost updates to tai adjustment Date: Thu, 2 Jan 2014 14:23:19 -0800 Message-Id: <1388701407-5029-1-git-send-email-john.stultz@linaro.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <52C5E6A0.7010507@linaro.org> References: <52C5E6A0.7010507@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.128.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: Sasha Levin 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 3abf534..7488f0b 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);