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: 7643211 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id B2DDD9F392 for ; Tue, 17 Nov 2015 22:42:20 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id CB4D2203DC for ; Tue, 17 Nov 2015 22:42:19 +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 3B1B02051C for ; Tue, 17 Nov 2015 22:42:18 +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 1ZyovA-00071o-I6; Tue, 17 Nov 2015 22:40:16 +0000 Received: from mail-pa0-x22e.google.com ([2607:f8b0:400e:c03::22e]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Zyotl-0005XW-VQ for linux-arm-kernel@lists.infradead.org; Tue, 17 Nov 2015 22:38:51 +0000 Received: by pacej9 with SMTP id ej9so22068546pac.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=UEmMFJdPDsSjuwzjBAP1NrKgiK8TCe//VtOyeYCligv0QyyaxugAAXnMUJJ77A+6+8 Uy5lkjfpQMVB42oKm4reM49/xIzgmwIdhfIOQCqXkoF3G0bAqqeaIWi0//Xd5tM+ozl3 6AgACCivJ0ykHGcz17JPLwp6OPEHcCN4MHRPXYKG6fGpUcTrnJuBQfB3b+LXbr2J1BMn 3yHuCfLYLorIuQL4rat/lSd1pidIb49VbDylF58ZQYVnP3g55aiG8JdkWJH+UVCVCTMf umwrppe/iH6veoO+guBRt20c27rzAU5x6LedDZ+HDcX3lCm4qBPQbhQ1XNKO00B683/p 9+hw== X-Gm-Message-State: ALoCoQmTtAQicroqCdK5e2B7iDNJiPl8NH9l0b7wsyUtVnIZKqQSAEDeE7GehY4drPFCaKLnIeK0 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 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> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20151117_143850_105046_16DA4535 X-CRM114-Status: GOOD ( 13.49 ) 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=unavailable 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; };