From patchwork Tue Nov 17 22:37:40 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lina Iyer X-Patchwork-Id: 7643421 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id D613BBF90C for ; Tue, 17 Nov 2015 22:54:29 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id EA8EF2058A for ; Tue, 17 Nov 2015 22:54:28 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0DA3B205D4 for ; Tue, 17 Nov 2015 22:54:28 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Zyp6y-0004dg-Fg; Tue, 17 Nov 2015 22:52:28 +0000 Received: from mail-pa0-x22b.google.com ([2607:f8b0:400e:c03::22b]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Zyou3-0005bW-Qi for linux-arm-kernel@lists.infradead.org; Tue, 17 Nov 2015 22:39:10 +0000 Received: by pabfh17 with SMTP id fh17so22934350pab.0 for ; Tue, 17 Nov 2015 14:38:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro_org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=xy1buFHgvXhcvlaPoPBeFZs3SeqvRRBSseGWjv0sstA=; b=zy3DDyR5UJobHk4Vn3kn2UFuDX3WObA0CH1gvwqCioKp7vX+7KONUoq4uCg+ecLK8U 9fuSXwhThGEGUA3tXzmN/XB6wmZ2UMXZnW8vjMaER1T2Kf+3x1TAgq+s5RnYWa7J3cxA 4nmHIlMwgyLvycFk+vqaow29Z7Zcfhpk1LQw98hrYiUG2LCxKdnzJMkW2xLOb8Pu+A4s Aot4oY/ODCccfj2GR1I1RhZJkAE6DopD9CAuam8izN3lahiDHL3ZIkle2KG2T2PApUlq 4YVfdyysRUT0+r7cy7p3wHu/K7JlNl7aF3+eL0uMeUKzjAtN1gH8FjfC1sKMXonHodje XEAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=xy1buFHgvXhcvlaPoPBeFZs3SeqvRRBSseGWjv0sstA=; b=EAOMKoMtwaz9vaxp+0xR7whFatqZnh+KGmvtyX9iF8xGReXf7Xirwfm4oWJONpeMTb CXbWC3ildulSIDHh+lReE/oFiJey05BFHJhPynwzEgcYy3ZkNemyU48E58SSlD/dcFLH sOr0mVidloRky3dsn7absLrzJYOSabd79qLw6i2emaYkU8H7P8DFyxNq01BkOKI2aRU3 obOBDWcMeXQu2YRyIfxDKrLl9S3d0bjRGoL3diqJ2ldGj0o9kH2/eByZDd7d08sM2rnQ hvZ/RPwjrapC0k0715cq4YkTirwD+WCaMkT9SCNVzxEnsc+SsxeiKDnfKcBA/8iMSFps OS9g== X-Gm-Message-State: ALoCoQkdjt0267xqNmXweI8LIHJAXmayocYAo7dIHm1J2DP5uIFbb1GpwuDrA5HN4XMh1anfnzwG X-Received: by 10.67.1.103 with SMTP id bf7mr65862849pad.147.1447799930873; Tue, 17 Nov 2015 14:38:50 -0800 (PST) Received: from ubuntu.localdomain ([8.42.77.226]) by smtp.gmail.com with ESMTPSA id hy1sm14875199pbb.63.2015.11.17.14.38.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 17 Nov 2015 14:38:49 -0800 (PST) From: Lina Iyer To: ulf.hansson@linaro.org, khilman@linaro.org, linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH RFC 16/27] ARM: cpuidle: Record the next wakeup event of the CPU Date: Tue, 17 Nov 2015 15:37:40 -0700 Message-Id: <1447799871-56374-17-git-send-email-lina.iyer@linaro.org> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1447799871-56374-1-git-send-email-lina.iyer@linaro.org> References: <1447799871-56374-1-git-send-email-lina.iyer@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20151117_143908_292944_1FD22062 X-CRM114-Status: GOOD ( 12.86 ) X-Spam-Score: -2.6 (--) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: k.kozlowski@samsung.com, lorenzo.pieralisi@arm.com, ahaslam@baylibre.com, linux-arm-msm@vger.kernel.org, sboyd@codeaurora.org, msivasub@codeaurora.org, geert@linux-m68k.org, Lina Iyer , agross@codeaurora.org, mtitinger@baylibre.com MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Reading the next wakeup of the CPU can only be realiably done only from that CPU. In the idle enter path record the next wake up of the CPU. The information is useful to determine the sleep time left for the CPU. Signed-off-by: Lina Iyer --- drivers/cpuidle/cpuidle-arm.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/cpuidle/cpuidle-arm.c b/drivers/cpuidle/cpuidle-arm.c index 8e72a23..b3133ef 100644 --- a/drivers/cpuidle/cpuidle-arm.c +++ b/drivers/cpuidle/cpuidle-arm.c @@ -18,9 +18,11 @@ #include #include #include +#include #include #include #include +#include #include @@ -49,7 +51,9 @@ static int arm_enter_idle_state(struct cpuidle_device *dev, ret = cpu_pm_enter(); if (!ret) { struct device *cpu_dev = get_cpu_device(dev->cpu); + struct generic_pm_domain_data *gpd = dev_gpd_data(cpu_dev); + gpd->td.next_wakeup = tick_nohz_get_next_wakeup(); RCU_NONIDLE(pm_runtime_put_sync_suspend(cpu_dev)); /* @@ -60,6 +64,7 @@ static int arm_enter_idle_state(struct cpuidle_device *dev, arm_cpuidle_suspend(idx); RCU_NONIDLE(pm_runtime_get_sync(cpu_dev)); + gpd->td.next_wakeup.tv64 = 0; cpu_pm_exit(); }