From patchwork Tue Nov 17 22:37:31 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lina Iyer X-Patchwork-Id: 7642731 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 C9B0FC05CA for ; Tue, 17 Nov 2015 22:38:39 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id CABBA20524 for ; Tue, 17 Nov 2015 22:38:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E49132051C for ; Tue, 17 Nov 2015 22:38:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932531AbbKQWib (ORCPT ); Tue, 17 Nov 2015 17:38:31 -0500 Received: from mail-pa0-f45.google.com ([209.85.220.45]:35836 "EHLO mail-pa0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932482AbbKQWia (ORCPT ); Tue, 17 Nov 2015 17:38:30 -0500 Received: by pacej9 with SMTP id ej9so22068545pac.2 for ; Tue, 17 Nov 2015 14:38:30 -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=EFCdkvUpG/u5tvRBoc36Q7SARnipRjVcqWt5w/zeBnA=; b=iAhOPYib6mGWajJLh5FSLDRXwG/wDcBupLYe60okz0y1poISmvO9FuXkAtsgnFaAr9 3Rr0qLwO7sfR6VMKDx68FZFcXKRDOV+vhmH1vfIoFbFReY1h0qkbP4dzJv0Lcxsx62oL tkbohEs+1UrzqZyFW0qdiiTcjlnIZAx9O1f7z5C5vn0lS4ljDgPeBIJwolqPVEOVww+m /Ve3kQ2a0nku2g0S1GRElllsrIWfrZ3y6ZYqi+88zZe8tZsNXboda4Ct3BVgoM7yItou CWy5ZFU9gHjldQHBfxgct9KqqxrbTpHJGJacVmFfp1RoM1Ri/iOyBFSylUG2RnWEOklT yB4A== 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=EFCdkvUpG/u5tvRBoc36Q7SARnipRjVcqWt5w/zeBnA=; b=BESaTmV/hrJWV82NPi4J8tDMfvvoyFcQAYr1C0eY0yavKdB48XLWY/HbZMutxDCf5V jW55+uFrfk37yrUW8g8UC/Utq0NHJ9Pv19HiUXetKrEj85dKkVsxHeuS1qOJR3zNTAIT 9xrQBXfKiOC3Ow05Gp7XQUIfQSqbBlsr5dyy2lsMzNyUljknksiIEdfBnmb1VufuB8PA OHfZqbm9WWJ695KziJ1yRBL7mkxdazT/ZfBL065WvrPFOsqiORJzHCju4YW4P7ZZk52C IWdbBEvca3XTSSTMp2KsKtmkuryFxkDaGGrPO9mP6yXXFcCxXKj5vfVmUVdi0AV764d5 RHzw== X-Gm-Message-State: ALoCoQmiV037D0gqiWrIwythEt50/ZR0qRvhFC+SLp8UbLXW5K52Edkc8e31GpYlEgipB/2yhfPn X-Received: by 10.66.141.73 with SMTP id rm9mr1208459pab.96.1447799910173; Tue, 17 Nov 2015 14:38:30 -0800 (PST) Received: from ubuntu.localdomain ([8.42.77.226]) by smtp.gmail.com with ESMTPSA id hy1sm14875199pbb.63.2015.11.17.14.38.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 17 Nov 2015 14:38:29 -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 07/27] PM / Domains: Read domain residency from DT Date: Tue, 17 Nov 2015 15:37:31 -0700 Message-Id: <1447799871-56374-8-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 Domains that have expensive suspend resume operations, may require a certain amount of time be spent in an idle state to reap the power saving benefit. Such domains, may provide the residency requirement for a domain state. Read the residency for a domain state from the DT. A domain governor may use this information in determining the state for the domain. Cc: Axel Haslam Cc: Marc Titinger Signed-off-by: Lina Iyer --- Documentation/devicetree/bindings/power/power_domain.txt | 7 +++++++ drivers/base/power/domain.c | 6 ++++++ include/linux/pm_domain.h | 1 + 3 files changed, 14 insertions(+) diff --git a/Documentation/devicetree/bindings/power/power_domain.txt b/Documentation/devicetree/bindings/power/power_domain.txt index ecfaf44..d71da29 100644 --- a/Documentation/devicetree/bindings/power/power_domain.txt +++ b/Documentation/devicetree/bindings/power/power_domain.txt @@ -67,6 +67,13 @@ have the following properties - If omitted, this is assumed to be equal to: entry-latency-us + exit-latency-us + - residency-us: + Usage: Optional + Value type: + Definition: A u32 value representing the time for which a + domain must be idle in the state to reap power saving benefits + of entering the state. + - state-param: Usage: Optional Value type: diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c index 9a0df09..abc81bd 100644 --- a/drivers/base/power/domain.c +++ b/drivers/base/power/domain.c @@ -1245,6 +1245,7 @@ static int genpd_alloc_states_data(struct generic_pm_domain *genpd, st[i].power_on_latency_ns; genpd->states[i].power_off_latency_ns = st[i].power_off_latency_ns; + genpd->states[i].residency_ns = st[i].residency_ns; genpd->states[i].param = st[i].param; } @@ -1513,6 +1514,7 @@ static int of_get_genpd_power_state(struct genpd_power_state *genpd_state, const struct of_device_id *match_id; int err = 0; u32 latency; + u32 residency; u32 param; match_id = of_match_node(power_state_match, state_node); @@ -1554,6 +1556,10 @@ static int of_get_genpd_power_state(struct genpd_power_state *genpd_state, return -EINVAL; } + err = of_property_read_u32(state_node, "residency-us", &residency); + if (!err) + genpd_state->residency_ns = 1000 * residency; + err = of_property_read_u32(state_node, "state-param", ¶m); if (!err) genpd_state->param = param; diff --git a/include/linux/pm_domain.h b/include/linux/pm_domain.h index 108a4b3..fed024a 100644 --- a/include/linux/pm_domain.h +++ b/include/linux/pm_domain.h @@ -41,6 +41,7 @@ struct genpd_power_state { char *name; s64 power_off_latency_ns; s64 power_on_latency_ns; + s64 residency_ns; u32 param; };