From patchwork Thu Mar 31 13:50:26 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 64790 Delivered-To: patches@linaro.org Received: by 10.112.199.169 with SMTP id jl9csp169823lbc; Thu, 31 Mar 2016 06:50:37 -0700 (PDT) X-Received: by 10.25.167.144 with SMTP id q138mr727340lfe.17.1459432234117; Thu, 31 Mar 2016 06:50:34 -0700 (PDT) Return-Path: Received: from mail-lf0-x236.google.com (mail-lf0-x236.google.com. [2a00:1450:4010:c07::236]) by mx.google.com with ESMTPS id j10si5414837lfd.238.2016.03.31.06.50.34 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 31 Mar 2016 06:50:34 -0700 (PDT) Received-SPF: pass (google.com: domain of ulf.hansson@linaro.org designates 2a00:1450:4010:c07::236 as permitted sender) client-ip=2a00:1450:4010:c07::236; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org; spf=pass (google.com: domain of ulf.hansson@linaro.org designates 2a00:1450:4010:c07::236 as permitted sender) smtp.mailfrom=ulf.hansson@linaro.org; dmarc=pass (p=NONE dis=NONE) header.from=linaro.org Received: by mail-lf0-x236.google.com with SMTP id p188so32833158lfd.0 for ; Thu, 31 Mar 2016 06:50:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=LAkQCXc0XMNjukOszYUzJTqmn0TdmPT33YjrYGhNNmM=; b=QM4X3N+ZBaWxZ6tnNyWZaGIftzAsIloqwMfGd8wuxfmndOmhmxdLrDU2naLk++/QiS TWH1gsKVYkt6GaeAm6EWeAKUJbtLM4keevD3UT025XRAjDxz6fOeHFRGugxlicAhiQPT dtiwjMggmFgKK2JtP0F4/2hc+I2+fc4qSpIlY= 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=LAkQCXc0XMNjukOszYUzJTqmn0TdmPT33YjrYGhNNmM=; b=gK7NBwBhLw86Dj1qw0J5AfLeQnP7fTu6UO8q5TJJXuRI+kSyYPSPkOJlKE20ijEQTY 9mRSitjNxmMuOgO96ZrC1GnEaHXFVkOg2dj4QzPOica+QcGZFXvPc67DAXR+PjajdCNo +MFcF/XTETYpF8cHewborWCbYsWmaT5+jrB0SFjwu4f/tEGIszDjlePj566HJeclBgTf h23atiPdt3VpWkMp3HtDaopNLPBzqXGuxYTugYwHPvJhY1whYS9VY78gfamgrFIyC6sV hHXQjIbQe+fhOUaraCA8tubN3RS3fGNroSqXBIvSf4rmiFPvcs+UuQX+//iJwQPrQlHL RieA== X-Gm-Message-State: AD7BkJL6VDzohXrnDJiY6a31NCGaEfptWJMl0WoN2SjLDoUv25dk6k0ixxE/bGRkPxEwdTujoDA= X-Received: by 10.25.157.79 with SMTP id g76mr3535595lfe.41.1459432233956; Thu, 31 Mar 2016 06:50:33 -0700 (PDT) Return-Path: Received: from uffe-Latitude-E6430s.ideon.se ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id iy8sm1336622lbc.20.2016.03.31.06.50.31 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 31 Mar 2016 06:50:32 -0700 (PDT) From: Ulf Hansson To: "Rafael J. Wysocki" , Kevin Hilman , Ulf Hansson , Rob Herring , linux-pm@vger.kernel.org Cc: Len Brown , Pavel Machek , Geert Uytterhoeven , Lina Iyer , Axel Haslam , Marek Szyprowski , Jon Hunter , devicetree@vger.kernel.org Subject: [PATCH 2/2] PM / Domains: Retrieve PM QoS device latencies from DT Date: Thu, 31 Mar 2016 15:50:26 +0200 Message-Id: <1459432226-22562-2-git-send-email-ulf.hansson@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1459432226-22562-1-git-send-email-ulf.hansson@linaro.org> References: <1459432226-22562-1-git-send-email-ulf.hansson@linaro.org> For the DT based device attach process, let's parse the device node for PM QoS latency properties and provide the result as the timing data when adding a device to its PM domain. In DT based platforms, this change allows a device to have initial correct latency values. In the ideal scenario it should mean that the calibration of these values shouldn't be needed by the genpd governor, but let's leave that as a future change to consider. Suggested-by: Geert Uytterhoeven Signed-off-by: Ulf Hansson --- drivers/base/power/domain.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) -- 1.9.1 diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c index 56705b5..f3302a9 100644 --- a/drivers/base/power/domain.c +++ b/drivers/base/power/domain.c @@ -1790,6 +1790,7 @@ int genpd_dev_pm_attach(struct device *dev) { struct of_phandle_args pd_args; struct generic_pm_domain *pd; + struct gpd_timing_data td; unsigned int i; int ret; @@ -1824,10 +1825,16 @@ int genpd_dev_pm_attach(struct device *dev) return -EPROBE_DEFER; } + memset(&td, 0, sizeof(td)); + of_property_read_u64(dev->of_node, "suspend-latency", + &td.suspend_latency_ns); + of_property_read_u64(dev->of_node, "resume-latency", + &td.resume_latency_ns); + dev_dbg(dev, "adding to PM domain %s\n", pd->name); for (i = 1; i < GENPD_RETRY_MAX_MS; i <<= 1) { - ret = pm_genpd_add_device(pd, dev); + ret = __pm_genpd_add_device(pd, dev, &td); if (ret != -EAGAIN) break;