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: 7642921 X-Patchwork-Delegate: agross@codeaurora.org Return-Path: X-Original-To: patchwork-linux-arm-msm@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 E3228BF90C for ; Tue, 17 Nov 2015 22:39:04 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 138DE2051F for ; Tue, 17 Nov 2015 22:39:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3253820524 for ; Tue, 17 Nov 2015 22:39:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932591AbbKQWiw (ORCPT ); Tue, 17 Nov 2015 17:38:52 -0500 Received: from mail-pa0-f47.google.com ([209.85.220.47]:34219 "EHLO mail-pa0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932586AbbKQWiv (ORCPT ); Tue, 17 Nov 2015 17:38:51 -0500 Received: by padhx2 with SMTP id hx2so22139973pad.1 for ; Tue, 17 Nov 2015 14:38:50 -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=ChUuYeEChS6qlTQ55MncpKvGETR2T4SkwVd0yrWJ3wvoFHeUqfA91JowoJDKtVysxB 0i+AIPv3YpIAWQk28cRPusboStsK7AfEynQAWb/0pKK6S6KbBZ7ej04wUgD8cRKl3KW5 WEQ8zP9BG/NXzavlnZRnh0TRLGmCskZK7N7ACdm3pJj172BRqVbjkbn3uUNDA48dpmr8 Gkrqnd7lUgKPuj3z9zby1WU/1bNX6/WNNanZcjA37X1qHR80G+GFnuP7JUZFxLxSxBO+ 2ZI30ueXAGw4PJP0K5CXyonR5wIAXd5H8zxQLk/KRtTRtPP6Ta5+8W/ctVQNOep1NAJ2 /L3w== X-Gm-Message-State: ALoCoQkPmx6RtxHzFc6dmrI7z3DhWdnmeuHEtoRoBB3PxfDUo/69mtPdUgk9LD4Xd+ZVroNbhQI+ 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 Cc: geert@linux-m68k.org, k.kozlowski@samsung.com, msivasub@codeaurora.org, agross@codeaurora.org, sboyd@codeaurora.org, linux-arm-msm@vger.kernel.org, lorenzo.pieralisi@arm.com, ahaslam@baylibre.com, mtitinger@baylibre.com, Lina Iyer 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> Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,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(); }