From patchwork Tue Aug 21 03:38:02 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 178949 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from ozlabs.org (localhost [IPv6:::1]) by ozlabs.org (Postfix) with ESMTP id 2CD2B2C038D for ; Tue, 21 Aug 2012 13:38:42 +1000 (EST) Received: from e34.co.us.ibm.com (e34.co.us.ibm.com [32.97.110.152]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "e34.co.us.ibm.com", Issuer "GeoTrust SSL CA" (not verified)) by ozlabs.org (Postfix) with ESMTPS id DFDEB2C008D for ; Tue, 21 Aug 2012 13:38:12 +1000 (EST) Received: from /spool/local by e34.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 20 Aug 2012 21:38:10 -0600 Received: from d03dlp02.boulder.ibm.com (9.17.202.178) by e34.co.us.ibm.com (192.168.1.134) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Mon, 20 Aug 2012 21:38:08 -0600 Received: from d03relay04.boulder.ibm.com (d03relay04.boulder.ibm.com [9.17.195.106]) by d03dlp02.boulder.ibm.com (Postfix) with ESMTP id A0A2C3E40039 for ; Mon, 20 Aug 2012 21:38:07 -0600 (MDT) Received: from d03av06.boulder.ibm.com (d03av06.boulder.ibm.com [9.17.195.245]) by d03relay04.boulder.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q7L3c678153530 for ; Mon, 20 Aug 2012 21:38:06 -0600 Received: from d03av06.boulder.ibm.com (loopback [127.0.0.1]) by d03av06.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q7L3dQh3015673 for ; Mon, 20 Aug 2012 21:39:27 -0600 Received: from [9.57.79.191] ([9.57.79.191]) by d03av06.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id q7L3dNxp015594; Mon, 20 Aug 2012 21:39:24 -0600 Message-ID: <5033029A.2030201@linaro.org> Date: Mon, 20 Aug 2012 20:38:02 -0700 From: John Stultz User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:14.0) Gecko/20120714 Thunderbird/14.0 MIME-Version: 1.0 To: Andreas Schwab Subject: Re: [PATCH 4/8] time: Condense timekeeper.xtime into xtime_sec References: <1342156917-25092-1-git-send-email-john.stultz@linaro.org> <1342156917-25092-5-git-send-email-john.stultz@linaro.org> <503288ED.10306@linaro.org> <503296C1.4070906@linaro.org> In-Reply-To: X-Content-Scanned: Fidelis XPS MAILER x-cbid: 12082103-1780-0000-0000-000008961340 X-IBM-ISS-SpamDetectors: X-IBM-ISS-DetailInfo: BY=3.00000292; HX=3.00000196; KW=3.00000007; PH=3.00000001; SC=3.00000007; SDB=6.00167117; UDB=6.00037852; UTC=2012-08-21 03:38:09 Cc: Prarit Bhargava , Peter Zijlstra , Richard Cochran , Linux Kernel , Thomas Gleixner , linuxppc-dev@lists.ozlabs.org, Ingo Molnar X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" On 08/20/2012 01:04 PM, Andreas Schwab wrote: > John Stultz writes: > >> Huh. Yea, that looks fine. And without the >> __timekeeping_inject_sleeptime() call, the system resumed ok? > Yes, it does. So I'm mostly still stumped on this. But I did find one possible related bugfix that maybe you can try? Let me know if the patch below dodges the problem, and if not, please send me the JDB printk output. (if the resume hangs without any output, add a "return;" before the tk_xtime_add() call between the JDB printks). thanks -john diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c index e16af19..1a9b9c5 100644 --- a/kernel/time/timekeeping.c +++ b/kernel/time/timekeeping.c @@ -115,6 +115,7 @@ static void tk_xtime_add(struct timekeeper *tk, const struct timespec *ts) { tk->xtime_sec += ts->tv_sec; tk->xtime_nsec += (u64)ts->tv_nsec << tk->shift; + tk_normalize_xtime(tk); } static void tk_set_wall_to_mono(struct timekeeper *tk, struct timespec wtm) @@ -695,9 +696,22 @@ static void __timekeeping_inject_sleeptime(struct timekeeper *tk, "sleep delta value!\n"); return; } + + printk("JDB: pre xt %ld:%ld wtm: %ld:%ld st: %ld:%ld\n", + tk_xtime(tk).tv_sec, tk_xtime(tk).tv_nsec, + tk->wall_to_monotonic.tv_sec,tk->wall_to_monotonic.tv_nsec, + tk->total_sleep_time.tv_sec, tk->total_sleep_time.tv_nsec); + printk("JDB: Adding %ld:%ld\n", delta->tv_sec, delta->tv_nsec); + tk_xtime_add(tk, delta); tk_set_wall_to_mono(tk, timespec_sub(tk->wall_to_monotonic, *delta)); tk_set_sleep_time(tk, timespec_add(tk->total_sleep_time, *delta)); + + printk("JDB: post xt %ld:%ld wtm: %ld:%ld st: %ld:%ld\n", + tk_xtime(tk).tv_sec, tk_xtime(tk).tv_nsec, + tk->wall_to_monotonic.tv_sec,tk->wall_to_monotonic.tv_nsec, + tk->total_sleep_time.tv_sec, tk->total_sleep_time.tv_nsec); + } /**