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: 56894 Delivered-To: patch@linaro.org Received: by 10.112.155.196 with SMTP id vy4csp2218398lbb; Tue, 17 Nov 2015 14:39:22 -0800 (PST) X-Received: by 10.66.168.171 with SMTP id zx11mr66653102pab.125.1447799933427; Tue, 17 Nov 2015 14:38:53 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ax2si60766904pbd.123.2015.11.17.14.38.53; Tue, 17 Nov 2015 14:38:53 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-pm-owner@vger.kernel.org; dkim=neutral (body hash did not verify) header.i=@linaro_org.20150623.gappssmtp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932590AbbKQWiw (ORCPT + 11 others); Tue, 17 Nov 2015 17:38:52 -0500 Received: from mail-pa0-f42.google.com ([209.85.220.42]:35105 "EHLO mail-pa0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932585AbbKQWiv (ORCPT ); Tue, 17 Nov 2015 17:38:51 -0500 Received: by pacej9 with SMTP id ej9so22076887pac.2 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=iNXpZgHB+JBBT2qR81pvVtErMlGtplC0km7UtgMwy9v6G3QhCIzm527nWOXP58Lwpa iyzS9SsjX4D9MvGsADZS/GaWRzCR+FyHBWWdYCqx33p7Cc9b2Z400B5RH90DX3euBVDK 3KPONJ+2tLhxZoNoVhXZXbyJHeKrNdT4L2mTXs7/a1u+HQ8IMFWuLpBRiqrix0ul+cLh Iibo9J2maATeskQ0pXnXH0UxOxlAHzBKWUBvjZNkwO4AkYabjV7tjnigNhnXOoY+aHQa o6BworG2oIz4TEirrc4GuHGJ2LJEOXUF69L171800D8CgOPRGX/ua2muiGG8Bl1nt9Zg gQGQ== X-Gm-Message-State: ALoCoQldutDZDjlj3NjKgf7o/M8JkBqKJYwRHRinh1gI+7zdqfedSvxpp6AU92LH5kR5WQcd3tys 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-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org 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(+) -- 2.1.4 -- To unsubscribe from this list: send the line "unsubscribe linux-pm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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(); }