From patchwork Tue Dec 17 19:27:35 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 22608 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ig0-f197.google.com (mail-ig0-f197.google.com [209.85.213.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id C3E7F24005 for ; Tue, 17 Dec 2013 19:27:49 +0000 (UTC) Received: by mail-ig0-f197.google.com with SMTP id uy17sf8818600igb.0 for ; Tue, 17 Dec 2013 11:27:49 -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=Bj7yXETVEOUVBhlJ/MgbUzJoTry151KbvwFA7fOak+sKQ2PnDQ43Wcv96384Gw82/Q 7NzaHrvL1AJXUw8Ly05NsVxnq6YCegsHplyLlikDJK9l8CBVkITHokyb3gb3llS5EXql oos17VCXDB+LuSt84ttmXw8hquynBrjeGoDQEfiLkJKhO84M5pbxF3Dc8Xg9R1xj+giq VbTpg5DFNTBMdS6io+y7WKkOJJdlEq/eSp1XkJBQruPwoi6xM1VQje/7/Z3rO+GJ9qUy T8HDH25i0IC7y597VzgPdX/p//uvTwPW9n5uuNpFzVuwSE78JE0ZVc63rKdyYF/qesrd QXjQ== X-Gm-Message-State: ALoCoQlfujdB3SCDHcHmmOpIkVIUFH/4DEb/40CwOLHvlVjFL/QxJM1WQodPlaEZBpi759X0Uj2m X-Received: by 10.182.95.68 with SMTP id di4mr9283251obb.4.1387308468770; Tue, 17 Dec 2013 11:27:48 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.0.106 with SMTP id 10ls2636670qed.55.gmail; Tue, 17 Dec 2013 11:27:48 -0800 (PST) X-Received: by 10.52.232.8 with SMTP id tk8mr116965vdc.76.1387308468541; Tue, 17 Dec 2013 11:27:48 -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 e3si5145385vek.17.2013.12.17.11.27.48 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 17 Dec 2013 11:27:48 -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 w20so4331748vbb.5 for ; Tue, 17 Dec 2013 11:27:48 -0800 (PST) X-Received: by 10.52.240.201 with SMTP id wc9mr1673332vdc.60.1387308468413; Tue, 17 Dec 2013 11:27:48 -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 ey3csp190149ved; Tue, 17 Dec 2013 11:27:47 -0800 (PST) X-Received: by 10.68.164.131 with SMTP id yq3mr29368602pbb.56.1387308466434; Tue, 17 Dec 2013 11:27:46 -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 vv1si12387841pbb.329.2013.12.17.11.27.46 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 17 Dec 2013 11:27:46 -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 v10so7249316pde.27 for ; Tue, 17 Dec 2013 11:27:46 -0800 (PST) X-Received: by 10.68.163.33 with SMTP id yf1mr29016371pbb.143.1387308465971; Tue, 17 Dec 2013 11:27:45 -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 yg3sm48436118pab.16.2013.12.17.11.27.44 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 17 Dec 2013 11:27:45 -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: Tue, 17 Dec 2013 11:27:35 -0800 Message-Id: <1387308457-25364-2-git-send-email-john.stultz@linaro.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1387308457-25364-1-git-send-email-john.stultz@linaro.org> References: <1387308457-25364-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: , 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);