From patchwork Thu Jan 23 01:34:54 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 23559 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-vb0-f69.google.com (mail-vb0-f69.google.com [209.85.212.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 4F712203C6 for ; Thu, 23 Jan 2014 01:35:13 +0000 (UTC) Received: by mail-vb0-f69.google.com with SMTP id m10sf1891964vbh.4 for ; Wed, 22 Jan 2014 17:35:12 -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=2op/itPnSztdtmHw9duc4UsruB7L/M8VubLWAoBVL9A=; b=kbq9eVgWTIxDag68IkmkGNKZeOTgeKV0CdVNcKGGXbLUYNhb0B8jYoZndBXkOgGk2a HqG3hiXvn/BQLg3gM3EzMfNb97wtYFVnwsMbURlFF2hg5qDP9KyfsAfnBoscskPhal8p b+EBYtyJ2cEo00ICTtVH8f2VvfVdYElMAoK0jkW1cRIUxBAkKKg7j0u0aJtVIps2Y6B+ h3/GE54HdouHOsGfrmg8nRYO6JHkwzG1fo+UJGrgd6+HfvFLj4jctTzp7bYTM5f2j4Oe jWfQ0+xQFzLEZwijQI2H0uJDGikzHLhb6odVMmdelQLCaS7SubZq3HDJ3TaLRzfabhho rCTQ== X-Gm-Message-State: ALoCoQl6bqNsqOE5NKEIjU74DFsRmMX+yvzupTe4q6RMDMnHK8UYgNYjBQqX5qUJSSZXj95dqHM8 X-Received: by 10.58.39.202 with SMTP id r10mr1995988vek.12.1390440912484; Wed, 22 Jan 2014 17:35:12 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.94.167 with SMTP id dd7ls226210qeb.81.gmail; Wed, 22 Jan 2014 17:35:12 -0800 (PST) X-Received: by 10.220.88.204 with SMTP id b12mr2988580vcm.3.1390440912381; Wed, 22 Jan 2014 17:35:12 -0800 (PST) Received: from mail-vb0-f46.google.com (mail-vb0-f46.google.com [209.85.212.46]) by mx.google.com with ESMTPS id h13si5678862vct.68.2014.01.22.17.35.12 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 22 Jan 2014 17:35:12 -0800 (PST) Received-SPF: neutral (google.com: 209.85.212.46 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.212.46; Received: by mail-vb0-f46.google.com with SMTP id o19so684971vbm.19 for ; Wed, 22 Jan 2014 17:35:12 -0800 (PST) X-Received: by 10.58.75.6 with SMTP id y6mr3050863vev.23.1390440912292; Wed, 22 Jan 2014 17:35:12 -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 u4csp224910vcz; Wed, 22 Jan 2014 17:35:11 -0800 (PST) X-Received: by 10.66.220.198 with SMTP id py6mr4904109pac.21.1390440911421; Wed, 22 Jan 2014 17:35:11 -0800 (PST) Received: from mail-pd0-f182.google.com (mail-pd0-f182.google.com [209.85.192.182]) by mx.google.com with ESMTPS id gx4si11891935pbc.201.2014.01.22.17.35.11 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 22 Jan 2014 17:35:11 -0800 (PST) Received-SPF: neutral (google.com: 209.85.192.182 is neither permitted nor denied by best guess record for domain of john.stultz@linaro.org) client-ip=209.85.192.182; Received: by mail-pd0-f182.google.com with SMTP id v10so1116293pde.41 for ; Wed, 22 Jan 2014 17:35:11 -0800 (PST) X-Received: by 10.68.193.233 with SMTP id hr9mr5155952pbc.26.1390440910923; Wed, 22 Jan 2014 17:35:10 -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 j3sm29268483pbh.38.2014.01.22.17.35.09 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 22 Jan 2014 17:35:10 -0800 (PST) From: John Stultz To: stable Cc: John Stultz , Sasha Levin , Thomas Gleixner , Prarit Bhargava , Richard Cochran , Ingo Molnar Subject: [PATCH 1/6] 3.13.y: timekeeping: Fix lost updates to tai adjustment Date: Wed, 22 Jan 2014 17:34:54 -0800 Message-Id: <1390440899-10273-2-git-send-email-john.stultz@linaro.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1390440899-10273-1-git-send-email-john.stultz@linaro.org> References: <1390440899-10273-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.212.46 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: , This is a 3.13-stable backport of f55c07607a38f84b5c7e6066ee1cfe433fa5643c 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 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);