From patchwork Mon Feb 10 21:11:50 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 24423 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ob0-f197.google.com (mail-ob0-f197.google.com [209.85.214.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 1A27620143 for ; Mon, 10 Feb 2014 21:12:02 +0000 (UTC) Received: by mail-ob0-f197.google.com with SMTP id gq1sf28189451obb.4 for ; Mon, 10 Feb 2014 13:12:02 -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=tk9GoJpXp827sEKCatO1ZBuZwXEKVuqgU98Hthl4CHg=; b=hwutTtUOVVHb2uSiquZ0h5Ul7Zy1AUHyaO9SKVBQRwfqo0impmBLNdG2GGFj5Q2nqI MFAwPNluuROArw5AGRl6lObVljelF87fmY2S/K4e9GHWTq7x7EelSx6YZKlulJPiclZh S+HeufZ84axgxuXn1gtnqcmKLUqbvjsNVEPOZ6OFjlcy8TNHsV/a5CvNIefBLF2CmaOr hkLucouPiIw1/SGcANcoIXwkwuTJOACvqYMPiLtAUNxx+XkqWOpjLoqodZF8B6/yBfSu IPu1fWJ9XW1G09HeGQXZ/hGI7+0zPjN4iYF0ETT91W4pdAecdNH+q9Yqv/o25X5dTrwy Wg9g== X-Gm-Message-State: ALoCoQnb0oD9aWYY6NzJfLVFYxOslYWNbX56L6eA3UOqgx7bKzjf0C8l+VqqPjquXGoQI12Asfwt X-Received: by 10.42.240.19 with SMTP id ky19mr10797450icb.4.1392066722014; Mon, 10 Feb 2014 13:12:02 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.24.215 with SMTP id 81ls2083311qgr.14.gmail; Mon, 10 Feb 2014 13:12:01 -0800 (PST) X-Received: by 10.58.69.111 with SMTP id d15mr25284983veu.3.1392066721922; Mon, 10 Feb 2014 13:12:01 -0800 (PST) Received: from mail-vb0-f49.google.com (mail-vb0-f49.google.com [209.85.212.49]) by mx.google.com with ESMTPS id yb7si5166765vec.1.2014.02.10.13.12.01 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 10 Feb 2014 13:12:01 -0800 (PST) Received-SPF: neutral (google.com: 209.85.212.49 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.49; Received: by mail-vb0-f49.google.com with SMTP id x14so5128697vbb.22 for ; Mon, 10 Feb 2014 13:12:01 -0800 (PST) X-Received: by 10.220.95.139 with SMTP id d11mr8003755vcn.21.1392066721832; Mon, 10 Feb 2014 13:12:01 -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 u4csp198043vcz; Mon, 10 Feb 2014 13:12:01 -0800 (PST) X-Received: by 10.66.66.234 with SMTP id i10mr27926942pat.127.1392066720878; Mon, 10 Feb 2014 13:12:00 -0800 (PST) Received: from mail-pa0-f53.google.com (mail-pa0-f53.google.com [209.85.220.53]) by mx.google.com with ESMTPS id q5si16614242pae.201.2014.02.10.13.12.00 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 10 Feb 2014 13:12:00 -0800 (PST) Received-SPF: neutral (google.com: 209.85.220.53 is neither permitted nor denied by best guess record for domain of john.stultz@linaro.org) client-ip=209.85.220.53; Received: by mail-pa0-f53.google.com with SMTP id lj1so6711569pab.12 for ; Mon, 10 Feb 2014 13:12:00 -0800 (PST) X-Received: by 10.68.180.97 with SMTP id dn1mr39493817pbc.15.1392066720399; Mon, 10 Feb 2014 13:12:00 -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 qh2sm119192622pab.13.2014.02.10.13.11.59 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 10 Feb 2014 13:11:59 -0800 (PST) From: John Stultz To: stable Cc: John Stultz , Sasha Levin , Thomas Gleixner , Prarit Bhargava , Richard Cochran , Ingo Molnar Subject: [PATCH 2/5] 3.10.y: timekeeping: Fix lost updates to tai adjustment Date: Mon, 10 Feb 2014 13:11:50 -0800 Message-Id: <1392066713-5025-3-git-send-email-john.stultz@linaro.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1392066713-5025-1-git-send-email-john.stultz@linaro.org> References: <1392066713-5025-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.49 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.10-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 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c index 1c5b0fc..88c2b8b 100644 --- a/kernel/time/timekeeping.c +++ b/kernel/time/timekeeping.c @@ -605,6 +605,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, false, true); write_seqcount_end(&timekeeper_seq); raw_spin_unlock_irqrestore(&timekeeper_lock, flags); clock_was_set(); @@ -1677,6 +1678,7 @@ int do_adjtimex(struct timex *txc) if (tai != orig_tai) { __timekeeping_set_tai_offset(tk, tai); + timekeeping_update(tk, false, true); clock_was_set_delayed(); } write_seqcount_end(&timekeeper_seq);