From patchwork Wed Aug 22 00:30:46 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 10839 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 1EF5D23E41 for ; Wed, 22 Aug 2012 00:31:03 +0000 (UTC) Received: from mail-iy0-f180.google.com (mail-iy0-f180.google.com [209.85.210.180]) by fiordland.canonical.com (Postfix) with ESMTP id AE703A18C9A for ; Wed, 22 Aug 2012 00:30:52 +0000 (UTC) Received: by iadj38 with SMTP id j38so307283iad.11 for ; Tue, 21 Aug 2012 17:31:01 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:from:to:cc :subject:date:message-id:x-mailer:in-reply-to:references :x-content-scanned:x-cbid:x-gm-message-state; bh=+enKAtKO5RANYrUW2QqZNHNWtaT71d0lsac35RU0hxY=; b=RJ9hX5ojGGYdLhdNy/9kN+TPcRPbkP2TcXZLFWXuoNSw67XfuhUsWFeFFq5rw+0Ljq ZqtxGw6VjIO67cEnSaCrZNxyR//1nKqcvsw78wXfZhdN9502EIpsMvDy5JtBUCJS4awp fEUZDNsttYPIlgh71qhCUIVyEN9vNSIFm7j6pY50X3kN2znyrTdfZdZwrfppo0SCCZ+6 fjQSX5N40c9WYWjKbkvuIF4RmKrOVlM3EFfLuvoVt/oVbNjTybar+k9hcAZEZqCkjnz9 CcDZk3rZ/fh7JACoFnSEubOfFY8Q8JCJReUzjrkP3xV7K8GbfCPDK9RJStbuXeaxi7P1 QDBg== Received: by 10.50.159.196 with SMTP id xe4mr325167igb.43.1345595461888; Tue, 21 Aug 2012 17:31:01 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.50.184.232 with SMTP id ex8csp173731igc; Tue, 21 Aug 2012 17:31:01 -0700 (PDT) Received: by 10.50.194.130 with SMTP id hw2mr303387igc.57.1345595460895; Tue, 21 Aug 2012 17:31:00 -0700 (PDT) Received: from e5.ny.us.ibm.com (e5.ny.us.ibm.com. [32.97.182.145]) by mx.google.com with ESMTPS id t10si4991646icw.45.2012.08.21.17.31.00 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 21 Aug 2012 17:31:00 -0700 (PDT) Received-SPF: neutral (google.com: 32.97.182.145 is neither permitted nor denied by best guess record for domain of john.stultz@linaro.org) client-ip=32.97.182.145; Authentication-Results: mx.google.com; spf=neutral (google.com: 32.97.182.145 is neither permitted nor denied by best guess record for domain of john.stultz@linaro.org) smtp.mail=john.stultz@linaro.org Received: from /spool/local by e5.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 21 Aug 2012 20:30:59 -0400 Received: from d01dlp01.pok.ibm.com (9.56.250.166) by e5.ny.us.ibm.com (192.168.1.105) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Tue, 21 Aug 2012 20:30:58 -0400 Received: from d01relay06.pok.ibm.com (d01relay06.pok.ibm.com [9.56.227.116]) by d01dlp01.pok.ibm.com (Postfix) with ESMTP id 8AF8938C8041; Tue, 21 Aug 2012 20:30:57 -0400 (EDT) Received: from d01av03.pok.ibm.com (d01av03.pok.ibm.com [9.56.224.217]) by d01relay06.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q7M0Uv3u35192852; Tue, 21 Aug 2012 20:30:57 -0400 Received: from d01av03.pok.ibm.com (loopback [127.0.0.1]) by d01av03.pok.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q7M0UuJF024421; Tue, 21 Aug 2012 21:30:57 -0300 Received: from kernel-pok.stglabs.ibm.com (kernel.stglabs.ibm.com [9.114.214.19]) by d01av03.pok.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id q7M0UuAF024415; Tue, 21 Aug 2012 21:30:56 -0300 From: John Stultz To: linux-kernel Cc: John Stultz , Ingo Molnar , Prarit Bhargava , Thomas Gleixner , Andreas Schwab Subject: [PATCH 1/4] time: Ensure we normalize the timekeeper in tk_xtime_add Date: Tue, 21 Aug 2012 20:30:46 -0400 Message-Id: <1345595449-34965-2-git-send-email-john.stultz@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1345595449-34965-1-git-send-email-john.stultz@linaro.org> References: <1345595449-34965-1-git-send-email-john.stultz@linaro.org> X-Content-Scanned: Fidelis XPS MAILER x-cbid: 12082200-5930-0000-0000-00000B1E2240 X-Gm-Message-State: ALoCoQl7OKVBwZIh7DmB08njIyUMhEPvfcME/JYWughKn3ESo6wsUUag1bm7EoEqzgU8fnX/+agn Andreas noticed problems with resume on specific hardware after commit 1e75fa8be9fb61e1af46b5b3b176347a4c958ca1 combined with commit b44d50dcacea0d485ca2ff9140f8cc28ee22f28d After some digging I realized we aren't normalizing the timekeeper after the add. This patch to correct this resolved the issue. Cc: Ingo Molnar Cc: Prarit Bhargava Cc: Thomas Gleixner Cc: Andreas Schwab Reported-by: Andreas Schwab Tested-by: Andreas Schwab Signed-off-by: John Stultz --- kernel/time/timekeeping.c | 1 + 1 file changed, 1 insertion(+) diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c index 898bef0..258164a 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)