From patchwork Mon Feb 10 21:07:18 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 24416 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qc0-f199.google.com (mail-qc0-f199.google.com [209.85.216.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 673C520143 for ; Mon, 10 Feb 2014 21:07:36 +0000 (UTC) Received: by mail-qc0-f199.google.com with SMTP id m20sf15084686qcx.10 for ; Mon, 10 Feb 2014 13:07:35 -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=RPDgyqCWnDk2lghA1KjHjgAtg6VdQq31lx1cTE0v6YgJScxvKkzP+4XLKo7MAO30xl qjyYGu+cUO0BhQ8nLKfWpMLFfxFxzHINZK+Rblekz1lXqWqmqGwUVkXja/bPCv1GGf+6 7R6DfTQ9NzzQcFCJNe2b0EPZSOS/6huSDk5hAtNHs0ychs5J9eTH74S6WaQAv7isoGq0 Kb+6NViI9cUYwsrDJq2ZH4kPBPoqg9s6RBP43eyNKkF3onpyooF3CxIq8gsU9cd08PJ1 GRIWOqhNTh184O24BsqcrxQCL7t9bKmPk2lHNrqmRUJISVrO6BThVBEThruu/XSukWtw UTiQ== X-Gm-Message-State: ALoCoQmJdftXI+0pXd24eezftmdE4sceDCXwdQiwu++pYEOKZqAeH+Lw9qKlHE4aymlNMBjS6o3x X-Received: by 10.58.151.98 with SMTP id up2mr12363159veb.14.1392066455420; Mon, 10 Feb 2014 13:07:35 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.80.149 with SMTP id c21ls2244329qgd.52.gmail; Mon, 10 Feb 2014 13:07:35 -0800 (PST) X-Received: by 10.58.248.198 with SMTP id yo6mr48178vec.40.1392066455300; Mon, 10 Feb 2014 13:07:35 -0800 (PST) Received: from mail-ve0-f177.google.com (mail-ve0-f177.google.com [209.85.128.177]) by mx.google.com with ESMTPS id zp2si5157274vec.46.2014.02.10.13.07.35 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 10 Feb 2014 13:07:35 -0800 (PST) Received-SPF: neutral (google.com: 209.85.128.177 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.177; Received: by mail-ve0-f177.google.com with SMTP id jz11so5362715veb.36 for ; Mon, 10 Feb 2014 13:07:35 -0800 (PST) X-Received: by 10.58.85.133 with SMTP id h5mr25176920vez.4.1392066455218; Mon, 10 Feb 2014 13:07: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.220.174.196 with SMTP id u4csp197757vcz; Mon, 10 Feb 2014 13:07:34 -0800 (PST) X-Received: by 10.68.189.198 with SMTP id gk6mr11553630pbc.146.1392066454109; Mon, 10 Feb 2014 13:07:34 -0800 (PST) Received: from mail-pa0-f48.google.com (mail-pa0-f48.google.com [209.85.220.48]) by mx.google.com with ESMTPS id xk2si16607054pab.187.2014.02.10.13.07.33 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 10 Feb 2014 13:07:34 -0800 (PST) Received-SPF: neutral (google.com: 209.85.220.48 is neither permitted nor denied by best guess record for domain of john.stultz@linaro.org) client-ip=209.85.220.48; Received: by mail-pa0-f48.google.com with SMTP id kx10so6685990pab.21 for ; Mon, 10 Feb 2014 13:07:33 -0800 (PST) X-Received: by 10.68.11.199 with SMTP id s7mr4248194pbb.12.1392066453737; Mon, 10 Feb 2014 13:07: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 bz4sm45596387pbb.12.2014.02.10.13.07.32 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 10 Feb 2014 13:07:32 -0800 (PST) From: John Stultz To: stable Cc: John Stultz , Sasha Levin , Thomas Gleixner , Prarit Bhargava , Richard Cochran , Ingo Molnar Subject: [PATCH 1/7] 3.13.y: timekeeping: Fix lost updates to tai adjustment Date: Mon, 10 Feb 2014 13:07:18 -0800 Message-Id: <1392066444-4940-2-git-send-email-john.stultz@linaro.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1392066444-4940-1-git-send-email-john.stultz@linaro.org> References: <1392066444-4940-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.128.177 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);