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: 56887 Delivered-To: patch@linaro.org Received: by 10.112.155.196 with SMTP id vy4csp2218221lbb; Tue, 17 Nov 2015 14:38:56 -0800 (PST) X-Received: by 10.66.216.7 with SMTP id om7mr60345923pac.90.1447799912763; Tue, 17 Nov 2015 14:38:32 -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.32; Tue, 17 Nov 2015 14:38:32 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-arm-msm-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-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-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 S932531AbbKQWib (ORCPT + 6 others); 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 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(+) -- 2.1.4 -- To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" 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/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; };