From patchwork Fri Dec 20 18:59:44 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 22695 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-oa0-f69.google.com (mail-oa0-f69.google.com [209.85.219.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id AE3AB20555 for ; Fri, 20 Dec 2013 18:59:58 +0000 (UTC) Received: by mail-oa0-f69.google.com with SMTP id h16sf12055188oag.0 for ; Fri, 20 Dec 2013 10:59:57 -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=KwpI97YC0Fk6+zhQI48HLjrsWpZraPq3ooFQzoD3Adg=; b=OkCDb1+wP/+LY//0mFwKKIJN6TXMPqveKsR4LkbL+VUrFr16zWnnnpu5RJx/0abhZ2 3Xo1+kPQYcljshnogFAhwMadEHJhU5Pi04ZxoBalixLRDuMcG+wCWMfEKOq1loH12JmI Gw8zxRJ2ZFOE55ot1o+mxD+1jGmWz0FZLPdxvzZrwESbYgwrRDjMKkawmL/7kmp56RPV nkv/xgAjpdr2iyrKSStz2wlzzMf+Y51LK+wiD+X0OAPClwoNHwzalgx5Dx+32hCq4GIP uVq4U/7S7uIn7XFUXObvPwgTzAp+Ik/q8qvbQwQ0tk9I0iW+HmX2TWXB3A9aibTK3o3w W79A== X-Gm-Message-State: ALoCoQn9Fc5Ll6ugLVYB90kCfyesanDtNxI8pFJFzB3gzQr8S3GtuaOi+WiuBqDFykCCUajOSWM8 X-Received: by 10.182.60.37 with SMTP id e5mr4114255obr.30.1387565997339; Fri, 20 Dec 2013 10:59:57 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.62.199 with SMTP id a7ls935456qes.87.gmail; Fri, 20 Dec 2013 10:59:57 -0800 (PST) X-Received: by 10.52.164.16 with SMTP id ym16mr4386vdb.39.1387565997193; Fri, 20 Dec 2013 10:59:57 -0800 (PST) Received: from mail-vc0-f169.google.com (mail-vc0-f169.google.com [209.85.220.169]) by mx.google.com with ESMTPS id at4si1708807ved.37.2013.12.20.10.59.57 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 20 Dec 2013 10:59:57 -0800 (PST) Received-SPF: neutral (google.com: 209.85.220.169 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.169; Received: by mail-vc0-f169.google.com with SMTP id hu19so1706781vcb.0 for ; Fri, 20 Dec 2013 10:59:57 -0800 (PST) X-Received: by 10.52.231.130 with SMTP id tg2mr4995533vdc.16.1387565997116; Fri, 20 Dec 2013 10:59:57 -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 ey3csp83367ved; Fri, 20 Dec 2013 10:59:56 -0800 (PST) X-Received: by 10.68.209.193 with SMTP id mo1mr10664170pbc.38.1387565995987; Fri, 20 Dec 2013 10:59:55 -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 5si5946615pbj.35.2013.12.20.10.59.55 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 20 Dec 2013 10:59:55 -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 md12so2939139pbc.5 for ; Fri, 20 Dec 2013 10:59:55 -0800 (PST) X-Received: by 10.66.66.202 with SMTP id h10mr10524511pat.70.1387565995501; Fri, 20 Dec 2013 10:59:55 -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 z10sm20919924pas.6.2013.12.20.10.59.53 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 20 Dec 2013 10:59:54 -0800 (PST) From: John Stultz To: LKML Cc: John Stultz , Sasha Levin , Thomas Gleixner , Prarit Bhargava , Richard Cochran , Ingo Molnar , stable Subject: [PATCH 1/3] timekeeping: Fix lost updates to tai adjustment Date: Fri, 20 Dec 2013 10:59:44 -0800 Message-Id: <1387565986-11738-2-git-send-email-john.stultz@linaro.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1387565986-11738-1-git-send-email-john.stultz@linaro.org> References: <1387565986-11738-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.169 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 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);