From patchwork Tue Dec 10 05:09:56 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 22199 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-vc0-f198.google.com (mail-vc0-f198.google.com [209.85.220.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 31F8823A4E for ; Tue, 10 Dec 2013 05:10:18 +0000 (UTC) Received: by mail-vc0-f198.google.com with SMTP id ld13sf9225018vcb.9 for ; Mon, 09 Dec 2013 21:10:18 -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=obbfQ+X7NhGnGbOYj4kYaDA45OvLKusxhlcern6laHg=; b=XU6aYQH9VYRqTkJsmCqYqm9UBqFWJtOIvhSwaTKXXpgK6CxFYd5mXXg8CiO0MK2XQ7 DtHkU6Tf+B6Om91o7k8U85LMZjP4oY6a/I0rgd9kQQglo2hRNh3/6M+IFi/w7VT+TtpG N2HbZeieCLQeHrujuu6dS36sOevHRNk/r3Dj8cIgGBG3kuXJhtOgyU651z8du4hk095f uqJ1bWFjQqABB2n6lZMcLqApA5kh8EdG3RYVBt8H3gkPUrVQWo4soXHuFGuPgckYyJm0 kWAj1TqXiOYJSp1/XJkFr3Erve+yy+7hiD5Isf+xThGAwbhpnoJ/Mz3FtIoUH8i2dYjO U4tQ== X-Gm-Message-State: ALoCoQkEI8daDomYeCdwYI5Klx41JBInr7jCgeUwN/9I6kFoDf7kyVEn208Ob07xAIm25UI8sC+Y X-Received: by 10.58.169.81 with SMTP id ac17mr8348559vec.15.1386652218042; Mon, 09 Dec 2013 21:10:18 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.3.165 with SMTP id d5ls2355096qed.77.gmail; Mon, 09 Dec 2013 21:10:17 -0800 (PST) X-Received: by 10.52.230.102 with SMTP id sx6mr10680949vdc.15.1386652217917; Mon, 09 Dec 2013 21:10:17 -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 td8si4677770vdc.40.2013.12.09.21.10.17 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 09 Dec 2013 21:10:17 -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 hu19so4211248vcb.14 for ; Mon, 09 Dec 2013 21:10:17 -0800 (PST) X-Received: by 10.52.72.49 with SMTP id a17mr10920140vdv.20.1386652217829; Mon, 09 Dec 2013 21:10:17 -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 u4csp160473vcz; Mon, 9 Dec 2013 21:10:17 -0800 (PST) X-Received: by 10.68.220.194 with SMTP id py2mr25274391pbc.92.1386652217115; Mon, 09 Dec 2013 21:10:17 -0800 (PST) Received: from mail-pd0-f176.google.com (mail-pd0-f176.google.com [209.85.192.176]) by mx.google.com with ESMTPS id gn4si9311870pbc.201.2013.12.09.21.10.16 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 09 Dec 2013 21:10:17 -0800 (PST) Received-SPF: neutral (google.com: 209.85.192.176 is neither permitted nor denied by best guess record for domain of john.stultz@linaro.org) client-ip=209.85.192.176; Received: by mail-pd0-f176.google.com with SMTP id w10so6554650pde.7 for ; Mon, 09 Dec 2013 21:10:16 -0800 (PST) X-Received: by 10.68.134.200 with SMTP id pm8mr25703748pbb.123.1386652216677; Mon, 09 Dec 2013 21:10:16 -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 dq3sm701959pbc.35.2013.12.09.21.10.15 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 09 Dec 2013 21:10:16 -0800 (PST) From: John Stultz To: LKML Cc: John Stultz , Thomas Gleixner , Prarit Bhargava , Richard Cochran , Ingo Molnar , stable Subject: [RFC][PATCH 2/3] timekeeping: Fix missing timekeeping_update in suspend path Date: Mon, 9 Dec 2013 21:09:56 -0800 Message-Id: <1386652197-7035-3-git-send-email-john.stultz@linaro.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1386652197-7035-1-git-send-email-john.stultz@linaro.org> References: <1386652197-7035-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. In the timekeeping suspend path, we udpate the timekeeper structure, so we should be sure to update the shadow-timekeeper before releasing the timekeeping locks. Currently this isn't done. In most cases, the next time related code to run would be timekeeping_resume, which does update the shadow-timekeeper, but in an abundence of caution, this patch adds the call to timekeeping_update() in the suspend path. 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 6bad3d9..c615e9d 100644 --- a/kernel/time/timekeeping.c +++ b/kernel/time/timekeeping.c @@ -1024,6 +1024,8 @@ static int timekeeping_suspend(void) timekeeping_suspend_time = timespec_add(timekeeping_suspend_time, delta_delta); } + + timekeeping_update(tk, TK_MIRROR); write_seqcount_end(&timekeeper_seq); raw_spin_unlock_irqrestore(&timekeeper_lock, flags);