From patchwork Fri Mar 20 01:41:02 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thara Gopinath X-Patchwork-Id: 11448231 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 41C281874 for ; Fri, 20 Mar 2020 01:41:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 211B420842 for ; Fri, 20 Mar 2020 01:41:19 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="KHAAHrhj" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727392AbgCTBlO (ORCPT ); Thu, 19 Mar 2020 21:41:14 -0400 Received: from mail-qk1-f193.google.com ([209.85.222.193]:41499 "EHLO mail-qk1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727380AbgCTBlO (ORCPT ); Thu, 19 Mar 2020 21:41:14 -0400 Received: by mail-qk1-f193.google.com with SMTP id q188so82967qke.8 for ; Thu, 19 Mar 2020 18:41:11 -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 :mime-version:content-transfer-encoding; bh=eW/OFJFoFR7v20uQTXTPh54Gfwm5+Kkq94S8j8KRbyc=; b=KHAAHrhj23E533BBgqVy2TKK9CkcDC+OiwALUwXvFo6SAi2TVKs1mJB2WM2g78Mz6K SH/hEEVBv5Y/WYM3+X5xyw1FJGPxEUlGxbd6NNOwmDpuyPWp92lwuI8U17HEADuXTbZ9 tmCPLEI1tftEfJRlRIBot9aYl60W4ZdMhhrO5xS8nxxi14JlOS/mMusF2gDpc9QwFiO8 ujIKx79Ob+MgNtBJHwRv/Nyycj3yhy/sh6f06kdZsCIYTSQzyusrpvVFEthtiBdHJ/Yz iUFL7ZufL460bMxi9slNvBYv7269HUi7Taz/6OtXN7BSuqhCoGJZMeuul74pHhwn8HCC eRzw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=eW/OFJFoFR7v20uQTXTPh54Gfwm5+Kkq94S8j8KRbyc=; b=Dc1RjmKKuHpUHaLaBA9xtdSKpUwCa8YBZHJ6DBXbijsESoyVy5MJdV1PHEOLH/t5vM d861s09XT04wD21tDfG3XRnEtjKK31Adb0ZwTteOeu7ktfBD4xR2Onrx8Z3f/zSWyCBY l0c39/NXfT48fpoDWzeHdnOnYWwMcJFlG62TZvoTSCjJe3+ERR0fOfHb3xA7gqv6I0bd jYgn9LHwkVBykcqehViQo4ULdy1xuUr9p67CC+UF0fMof1YxpyenaSwNW1ZDtMLSGekk R35wyMhCiWeNOlB+7XDSWsRozlnE7rMFFg2Qr7iqizC3pbsyxloVpQs1cO758s6eX/nN GF8g== X-Gm-Message-State: ANhLgQ2pm5VWmDMILBO1eDuhGTPGaVScvqETq4j2KwLSYMtTOiRmBtHL T8lN5F25PjRw3y79mQrXLRxXNg== X-Google-Smtp-Source: ADFU+vupj+aipcr9NvAb73NIy/bo48Y/CMGZJQO1EeS20z8InsstfuNlICLQGUkvjfuN2dcNGNPp7w== X-Received: by 2002:a05:620a:4e:: with SMTP id t14mr5845072qkt.122.1584668471016; Thu, 19 Mar 2020 18:41:11 -0700 (PDT) Received: from pop-os.fios-router.home (pool-71-255-246-27.washdc.fios.verizon.net. [71.255.246.27]) by smtp.googlemail.com with ESMTPSA id 2sm2706287qtp.33.2020.03.19.18.41.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Mar 2020 18:41:10 -0700 (PDT) From: Thara Gopinath To: rui.zhang@intel.com, ulf.hansson@linaro.org, daniel.lezcano@linaro.org, bjorn.andersson@linaro.org, agross@kernel.org, robh@kernel.org Cc: amit.kucheria@verdurent.com, mark.rutland@arm.com, rjw@rjwysocki.net, linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [Patch v5 1/6] PM/Domains: Add support for retrieving genpd performance states information Date: Thu, 19 Mar 2020 21:41:02 -0400 Message-Id: <20200320014107.26087-2-thara.gopinath@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200320014107.26087-1-thara.gopinath@linaro.org> References: <20200320014107.26087-1-thara.gopinath@linaro.org> MIME-Version: 1.0 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org Add two new APIs in the genpd framework, dev_pm_genpd_get_performance_state to return the current performance state of a power domain and dev_pm_genpd_performance_state_count to return the total number of performance states supported by a power domain. Since the genpd framework does not maintain a count of number of performance states supported by a power domain, introduce a new callback(.get_performance_state_count) that can be used to retrieve this information from power domain drivers. These APIs are added to aid the implementation of a power domain as a warming device. Linux kernel cooling device framework(into which warming device can be plugged in) requires during initialization to be provided with the maximum number of states that can be supported. When a power domain acts as a warming device, the max state is the max number of perfomrance states supported by the power domain. The cooling device framework implements API to retrieve the current state of the cooling device. This in turn translates to the current performance state of the power domain. Reviewed-by: Ulf Hansson Signed-off-by: Thara Gopinath Reviewed-by: Bjorn Andersson --- drivers/base/power/domain.c | 37 +++++++++++++++++++++++++++++++++++++ include/linux/pm_domain.h | 13 +++++++++++++ 2 files changed, 50 insertions(+) diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c index 959d6d5eb000..d0297c48fa79 100644 --- a/drivers/base/power/domain.c +++ b/drivers/base/power/domain.c @@ -408,6 +408,43 @@ int dev_pm_genpd_set_performance_state(struct device *dev, unsigned int state) } EXPORT_SYMBOL_GPL(dev_pm_genpd_set_performance_state); +int dev_pm_genpd_get_performance_state(struct device *dev) +{ + struct generic_pm_domain *genpd; + unsigned int state; + + genpd = dev_to_genpd_safe(dev); + if (IS_ERR(genpd)) + return -ENODEV; + + genpd_lock(genpd); + state = genpd->performance_state; + genpd_unlock(genpd); + + return state; +} +EXPORT_SYMBOL_GPL(dev_pm_genpd_get_performance_state); + +int dev_pm_genpd_performance_state_count(struct device *dev) +{ + struct generic_pm_domain *genpd; + int count; + + genpd = dev_to_genpd_safe(dev); + if (IS_ERR(genpd)) + return -ENODEV; + + if (unlikely(!genpd->get_performance_state_count)) + return -EINVAL; + + genpd_lock(genpd); + count = genpd->get_performance_state_count(genpd); + genpd_unlock(genpd); + + return count; +} +EXPORT_SYMBOL_GPL(dev_pm_genpd_performance_state_count); + static int _genpd_power_on(struct generic_pm_domain *genpd, bool timed) { unsigned int state_idx = genpd->state_idx; diff --git a/include/linux/pm_domain.h b/include/linux/pm_domain.h index 9ec78ee53652..7d415350380f 100644 --- a/include/linux/pm_domain.h +++ b/include/linux/pm_domain.h @@ -117,6 +117,7 @@ struct generic_pm_domain { struct dev_pm_opp *opp); int (*set_performance_state)(struct generic_pm_domain *genpd, unsigned int state); + int (*get_performance_state_count)(struct generic_pm_domain *genpd); struct gpd_dev_ops dev_ops; s64 max_off_time_ns; /* Maximum allowed "suspended" time. */ bool max_off_time_changed; @@ -204,6 +205,8 @@ int pm_genpd_init(struct generic_pm_domain *genpd, struct dev_power_governor *gov, bool is_off); int pm_genpd_remove(struct generic_pm_domain *genpd); int dev_pm_genpd_set_performance_state(struct device *dev, unsigned int state); +int dev_pm_genpd_get_performance_state(struct device *dev); +int dev_pm_genpd_performance_state_count(struct device *dev); extern struct dev_power_governor simple_qos_governor; extern struct dev_power_governor pm_domain_always_on_gov; @@ -251,6 +254,16 @@ static inline int dev_pm_genpd_set_performance_state(struct device *dev, return -ENOTSUPP; } +static inline int dev_pm_genpd_get_performance_state(struct device *dev) +{ + return -ENOTSUPP; +} + +static inline int dev_pm_genpd_performance_state_count(struct device *dev) +{ + return -ENOTSUPP; +} + #define simple_qos_governor (*(struct dev_power_governor *)(NULL)) #define pm_domain_always_on_gov (*(struct dev_power_governor *)(NULL)) #endif From patchwork Fri Mar 20 01:41:03 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thara Gopinath X-Patchwork-Id: 11448229 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 17E061668 for ; Fri, 20 Mar 2020 01:41:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id EADF620739 for ; Fri, 20 Mar 2020 01:41:18 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="iUr7LVw9" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727360AbgCTBlO (ORCPT ); Thu, 19 Mar 2020 21:41:14 -0400 Received: from mail-qk1-f193.google.com ([209.85.222.193]:41502 "EHLO mail-qk1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727364AbgCTBlN (ORCPT ); Thu, 19 Mar 2020 21:41:13 -0400 Received: by mail-qk1-f193.google.com with SMTP id q188so83011qke.8 for ; Thu, 19 Mar 2020 18:41:13 -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 :mime-version:content-transfer-encoding; bh=PMpp9cGV1kolIa23/+eXnHG3jYVNr7iJ09Ptby/dQWg=; b=iUr7LVw9yHWif+ZG2vxEMY0bR1h+bCvJ+y8Af7km3yxODyCKqGeLTuoAa94xgvtgvN 9r/pYxzS6JQpcpWm6vPUMohRn6hsM+mnz8L/BY7V9ZuUcOl8gFc/Cl/ONKiXSl2AwYID 4DAY+x0Q81jFcJcTVsMUpyGs/ybHm1U4GYKlV8sEh1ON90pbIijtoj5Rx3dlLn/iHT1i Z4A++AavvO8qdTEW/g3j1JcgA/OTnxayZveVOoI8mupFY3geIf3aEqQkt94XG3BVgW67 AWJW6g6HffdtQsixG9lBHGPbeENRX/pNWXM5SnyOipO8XPB7/JyA4K085MljAgLQrnOA bWOA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=PMpp9cGV1kolIa23/+eXnHG3jYVNr7iJ09Ptby/dQWg=; b=Gk7IXFv74FBruKPc8oS9VULSbWfIAc/k3ArYOiA1xqyULrlGHvVgXqiIvkrzy5u2nY teLj2UF0nOXywQD7srMAOmYGow0UIiO4LZci264dr6BWklWLIvkGN5S9osWV7LJr1s76 FCWJ/QU/kZhz33WmboJMeP2QjuxCkxEF1lLfBnH4QWzI+K4J3uxYTAmL9+JO36qrRScx I2R0DSgMWYoJKYwh5VZoi12dVa2FmlwLbFZmOSesOmfKWTbinKnqRqe7LxZV5/IxQsbX SnILQaChtlyXdigh8gNBMWOZG+54FZSsLUWwkEI7p4X3s04VXdt6pnf2DhBsmVsXxA3A nnLg== X-Gm-Message-State: ANhLgQ3WnhNjTb/XdDbzVa1XSeeltjhHQfcxgAHmLea4SwvkxXSuc/Cq 3b44HJvyRPTTxCY2+Ul8PG5FWg== X-Google-Smtp-Source: ADFU+vtZPj94yZXMLwqO8JOCiKMUmJSZBqsuWIHCWksgaTY/SAPuOrMmCfd9rU2kKgjinskLZzoRhw== X-Received: by 2002:a37:aa92:: with SMTP id t140mr5385602qke.119.1584668472463; Thu, 19 Mar 2020 18:41:12 -0700 (PDT) Received: from pop-os.fios-router.home (pool-71-255-246-27.washdc.fios.verizon.net. [71.255.246.27]) by smtp.googlemail.com with ESMTPSA id 2sm2706287qtp.33.2020.03.19.18.41.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Mar 2020 18:41:11 -0700 (PDT) From: Thara Gopinath To: rui.zhang@intel.com, ulf.hansson@linaro.org, daniel.lezcano@linaro.org, bjorn.andersson@linaro.org, agross@kernel.org, robh@kernel.org Cc: amit.kucheria@verdurent.com, mark.rutland@arm.com, rjw@rjwysocki.net, linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [Patch v5 2/6] soc: qcom: rpmhpd: Introduce function to retrieve power domain performance state count Date: Thu, 19 Mar 2020 21:41:03 -0400 Message-Id: <20200320014107.26087-3-thara.gopinath@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200320014107.26087-1-thara.gopinath@linaro.org> References: <20200320014107.26087-1-thara.gopinath@linaro.org> MIME-Version: 1.0 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org Populate .get_performace_state_count in genpd ops to retrieve the count of performance states supported by a rpmh power domain. Reviewed-by: Ulf Hansson Signed-off-by: Thara Gopinath Reviewed-by: Bjorn Andersson --- drivers/soc/qcom/rpmhpd.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/soc/qcom/rpmhpd.c b/drivers/soc/qcom/rpmhpd.c index 4d264d0672c4..7142409a3b77 100644 --- a/drivers/soc/qcom/rpmhpd.c +++ b/drivers/soc/qcom/rpmhpd.c @@ -341,6 +341,13 @@ static unsigned int rpmhpd_get_performance_state(struct generic_pm_domain *genpd return dev_pm_opp_get_level(opp); } +static int rpmhpd_performance_states_count(struct generic_pm_domain *domain) +{ + struct rpmhpd *pd = domain_to_rpmhpd(domain); + + return pd->level_count; +} + static int rpmhpd_update_level_mapping(struct rpmhpd *rpmhpd) { int i; @@ -429,6 +436,8 @@ static int rpmhpd_probe(struct platform_device *pdev) rpmhpds[i]->pd.power_on = rpmhpd_power_on; rpmhpds[i]->pd.set_performance_state = rpmhpd_set_performance_state; rpmhpds[i]->pd.opp_to_performance_state = rpmhpd_get_performance_state; + rpmhpds[i]->pd.get_performance_state_count = + rpmhpd_performance_states_count; pm_genpd_init(&rpmhpds[i]->pd, NULL, true); data->domains[i] = &rpmhpds[i]->pd; From patchwork Fri Mar 20 01:41:04 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thara Gopinath X-Patchwork-Id: 11448259 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5A6DE1668 for ; Fri, 20 Mar 2020 01:42:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2FAB92076E for ; Fri, 20 Mar 2020 01:42:22 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="pdylMiGC" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727299AbgCTBmV (ORCPT ); Thu, 19 Mar 2020 21:42:21 -0400 Received: from mail-qt1-f193.google.com ([209.85.160.193]:34512 "EHLO mail-qt1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727377AbgCTBlQ (ORCPT ); Thu, 19 Mar 2020 21:41:16 -0400 Received: by mail-qt1-f193.google.com with SMTP id 10so3738690qtp.1 for ; Thu, 19 Mar 2020 18:41:14 -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 :mime-version:content-transfer-encoding; bh=+q0Whneakoia71PzXBgxmZbnd+3OHmL7DK4XuhtZbsg=; b=pdylMiGCq/devMh7m0Gj/CfkrdfdovRUED2arwHY3YZmdpuvoVo3Av7s+j6jPkG+86 giK4uCy+sHNGWyauJenzGi+z3wGZuAJ8bcKNnnQoJaclnCHVJIaMwGITOZBlWreZunkV 6Pwe6IkgjqlmEI/oy3VNeWVWWmF13j3Pu1fg7UqHLcM7/tu3pkFvJRFX04E9hSh9ndGP Huls/g/UqdMz9EVRmzY51A+1AFhjsJ6HvCCXfHx8Y+Nky5il561TTptdGjt7CeNCM/Bc Zv+EOnCfsGEOYxgEht3LDDBdHzZU6a31d6ChNYnfTp9zFedJb+nrl7SG3LTXVdPBQHJK L0rw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=+q0Whneakoia71PzXBgxmZbnd+3OHmL7DK4XuhtZbsg=; b=jsequ0QOT+Vlcyv348g4kazrSUCKny0BP4kZxd8+R8QMtEtLakKWPJmw5JFLGufVVV QlgbvKVAHGOXNgrsDIEgdFfitZwz5136qOJ6MqsDsBbOblDEdPi9bkzCjC/tJ8v6GPI9 0XU54P1jrNv2v9bccxB1ROJFO+kmZcyBCd2UbthJ9oM64Y4/a30EKFQtVhPX2WH+JXch cghHYtYu7+e4EZNiR0Ood/H+1UIjDwX7euf80bMKmPmhF7zSlxAxVpzr3gdKuEarnw8Y TIaMq/fFZ+iB1fCsDyyyXeC3g0z4PglG1EZUCm2GDycmK3CTimypqkx969d9iofQjVEv 1mkA== X-Gm-Message-State: ANhLgQ1gGragW1uzDWevqDAES6ud0xy68rlThi0CG0aDczF+DSqCmAFL Lblue6g2oCN0929ZvfNslQxeFw== X-Google-Smtp-Source: ADFU+vvV3I4YxVq1xAymPLnOWFCy9dHEri/NXuJUV5hlLXACtlePaJg5MOBUPU7k00uY22SlISNjIQ== X-Received: by 2002:ac8:3f62:: with SMTP id w31mr5859372qtk.171.1584668473741; Thu, 19 Mar 2020 18:41:13 -0700 (PDT) Received: from pop-os.fios-router.home (pool-71-255-246-27.washdc.fios.verizon.net. [71.255.246.27]) by smtp.googlemail.com with ESMTPSA id 2sm2706287qtp.33.2020.03.19.18.41.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Mar 2020 18:41:13 -0700 (PDT) From: Thara Gopinath To: rui.zhang@intel.com, ulf.hansson@linaro.org, daniel.lezcano@linaro.org, bjorn.andersson@linaro.org, agross@kernel.org, robh@kernel.org Cc: amit.kucheria@verdurent.com, mark.rutland@arm.com, rjw@rjwysocki.net, linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [Patch v5 3/6] thermal: Add generic power domain warming device driver. Date: Thu, 19 Mar 2020 21:41:04 -0400 Message-Id: <20200320014107.26087-4-thara.gopinath@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200320014107.26087-1-thara.gopinath@linaro.org> References: <20200320014107.26087-1-thara.gopinath@linaro.org> MIME-Version: 1.0 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org Resources modeled as power domains in linux kernel can be used to warm the SoC(eg. mx power domain on sdm845). To support this feature, introduce a generic power domain warming device driver that can be plugged into the thermal framework (The thermal framework itself requires further modifiction to support a warming device in place of a cooling device. Those extensions are not introduced in this patch series). Signed-off-by: Thara Gopinath --- v3->v4: - Removed late_init hook pd_warming_device_ops. - Use of_genpd_add_device instead of pm_genpd_add_device to attach device to the generic power domain. - Use thermal_of_cooling_device_parent_register to register the cooling device so that the device with genpd attached can be made parent of the cooling device. - With above changes, remove reference to generic_pm_domain in pd_warming_device. v4->v5: - All the below changes are as per Ulf's review comments. - Renamed pwr_domain_warming.c and pwr_domain_warming.h to pd_warming.c and pd_warming.h. - Renamed pwr_domain_warming_register API to of_pd_warming_register. - Dropped in-param pd_name to of_pd_warming_register. - Introduced ID allocator to uniquely identify each power domain warming device. - Introduced pd_warming_release to handle device kfree for pd_warming_device. - Introduced pm_genpd_remove_device in the error exit path of of_pd_warming_register. drivers/thermal/Kconfig | 10 +++ drivers/thermal/Makefile | 2 + drivers/thermal/pd_warming.c | 168 +++++++++++++++++++++++++++++++++++ include/linux/pd_warming.h | 29 ++++++ 4 files changed, 209 insertions(+) create mode 100644 drivers/thermal/pd_warming.c create mode 100644 include/linux/pd_warming.h diff --git a/drivers/thermal/Kconfig b/drivers/thermal/Kconfig index 4d6753f2b18f..92522d541d0e 100644 --- a/drivers/thermal/Kconfig +++ b/drivers/thermal/Kconfig @@ -206,6 +206,16 @@ config DEVFREQ_THERMAL If you want this support, you should say Y here. +config PWR_DOMAIN_WARMING_THERMAL + bool "Power Domain based warming device" + depends on PM_GENERIC_DOMAINS_OF + help + This implements the generic power domain based warming + mechanism through increasing the performance state of + a power domain. + + If you want this support, you should say Y here. + config THERMAL_EMULATION bool "Thermal emulation mode support" help diff --git a/drivers/thermal/Makefile b/drivers/thermal/Makefile index 8c8ed7b79915..7db87a779126 100644 --- a/drivers/thermal/Makefile +++ b/drivers/thermal/Makefile @@ -28,6 +28,8 @@ thermal_sys-$(CONFIG_CLOCK_THERMAL) += clock_cooling.o # devfreq cooling thermal_sys-$(CONFIG_DEVFREQ_THERMAL) += devfreq_cooling.o +thermal_sys-$(CONFIG_PWR_DOMAIN_WARMING_THERMAL) += pd_warming.o + # platform thermal drivers obj-y += broadcom/ obj-$(CONFIG_THERMAL_MMIO) += thermal_mmio.o diff --git a/drivers/thermal/pd_warming.c b/drivers/thermal/pd_warming.c new file mode 100644 index 000000000000..c0854d2e4b92 --- /dev/null +++ b/drivers/thermal/pd_warming.c @@ -0,0 +1,168 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Copyright (c) 2019, Linaro Ltd + */ +#include +#include +#include +#include +#include +#include +#include +#include +#include + +struct pd_warming_device { + struct thermal_cooling_device *cdev; + struct device dev; + int id; + int max_state; + int cur_state; + bool runtime_resumed; +}; + +static DEFINE_IDA(pd_ida); + +static int pd_wdev_get_max_state(struct thermal_cooling_device *cdev, + unsigned long *state) +{ + struct pd_warming_device *pd_wdev = cdev->devdata; + + *state = pd_wdev->max_state; + return 0; +} + +static int pd_wdev_get_cur_state(struct thermal_cooling_device *cdev, + unsigned long *state) +{ + struct pd_warming_device *pd_wdev = cdev->devdata; + + *state = dev_pm_genpd_get_performance_state(&pd_wdev->dev); + + return 0; +} + +static int pd_wdev_set_cur_state(struct thermal_cooling_device *cdev, + unsigned long state) +{ + struct pd_warming_device *pd_wdev = cdev->devdata; + struct device *dev = &pd_wdev->dev; + int ret; + + ret = dev_pm_genpd_set_performance_state(dev, state); + + if (ret) + return ret; + + if (state && !pd_wdev->runtime_resumed) { + ret = pm_runtime_get_sync(dev); + pd_wdev->runtime_resumed = true; + } else if (!state && pd_wdev->runtime_resumed) { + ret = pm_runtime_put(dev); + pd_wdev->runtime_resumed = false; + } + + return ret; +} + +static struct thermal_cooling_device_ops pd_warming_device_ops = { + .get_max_state = pd_wdev_get_max_state, + .get_cur_state = pd_wdev_get_cur_state, + .set_cur_state = pd_wdev_set_cur_state, +}; + +static void pd_warming_release(struct device *dev) +{ + kfree(dev); +} + +struct thermal_cooling_device * +of_pd_warming_register(struct device *parent, int pd_id) +{ + struct pd_warming_device *pd_wdev; + struct of_phandle_args pd_args; + char cdev_name[THERMAL_NAME_LENGTH]; + int ret; + + pd_wdev = kzalloc(sizeof(*pd_wdev), GFP_KERNEL); + if (!pd_wdev) + return ERR_PTR(-ENOMEM); + + dev_set_name(&pd_wdev->dev, "%s_%d_warming_dev", + dev_name(parent), pd_id); + pd_wdev->dev.parent = parent; + pd_wdev->dev.release = pd_warming_release; + + ret = device_register(&pd_wdev->dev); + if (ret) { + put_device(&pd_wdev->dev); + goto free_pd_wdev; + } + + ret = ida_simple_get(&pd_ida, 0, 0, GFP_KERNEL); + if (ret < 0) + goto unregister_device; + + pd_wdev->id = ret; + + pd_args.np = parent->of_node; + pd_args.args[0] = pd_id; + pd_args.args_count = 1; + + ret = of_genpd_add_device(&pd_args, &pd_wdev->dev); + + if (ret) + goto remove_ida; + + ret = dev_pm_genpd_performance_state_count(&pd_wdev->dev); + if (ret < 0) + goto out_genpd; + + pd_wdev->max_state = ret - 1; + pm_runtime_enable(&pd_wdev->dev); + pd_wdev->runtime_resumed = false; + + snprintf(cdev_name, sizeof(cdev_name), "thermal-pd-%d", pd_wdev->id); + pd_wdev->cdev = thermal_of_cooling_device_register + (NULL, cdev_name, pd_wdev, + &pd_warming_device_ops); + if (IS_ERR(pd_wdev->cdev)) { + pr_err("unable to register %s cooling device\n", cdev_name); + ret = PTR_ERR(pd_wdev->cdev); + goto out_runtime_disable; + } + + return pd_wdev->cdev; + +out_runtime_disable: + pm_runtime_disable(&pd_wdev->dev); +out_genpd: + pm_genpd_remove_device(&pd_wdev->dev); +remove_ida: + ida_simple_remove(&pd_ida, pd_wdev->id); +unregister_device: + device_unregister(&pd_wdev->dev); + pd_warming_release(&pd_wdev->dev); +free_pd_wdev: + kfree(pd_wdev); + return ERR_PTR(ret); +} +EXPORT_SYMBOL_GPL(of_pd_warming_register); + +void pd_warming_unregister(struct thermal_cooling_device *cdev) +{ + struct pd_warming_device *pd_wdev = cdev->devdata; + struct device *dev = &pd_wdev->dev; + + if (pd_wdev->runtime_resumed) { + dev_pm_genpd_set_performance_state(dev, 0); + pm_runtime_put(dev); + pd_wdev->runtime_resumed = false; + } + pm_runtime_disable(dev); + pm_genpd_remove_device(dev); + ida_simple_remove(&pd_ida, pd_wdev->id); + thermal_cooling_device_unregister(cdev); + kfree(pd_wdev); +} +EXPORT_SYMBOL_GPL(pd_warming_unregister); diff --git a/include/linux/pd_warming.h b/include/linux/pd_warming.h new file mode 100644 index 000000000000..550a5683b56d --- /dev/null +++ b/include/linux/pd_warming.h @@ -0,0 +1,29 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Copyright (c) 2019, Linaro Ltd. + */ +#ifndef __PWR_DOMAIN_WARMING_H__ +#define __PWR_DOMAIN_WARMING_H__ + +#include +#include + +#ifdef CONFIG_PWR_DOMAIN_WARMING_THERMAL +struct thermal_cooling_device * +of_pd_warming_register(struct device *parent, int pd_id); + +void pd_warming_unregister(struct thermal_cooling_device *cdev); + +#else +static inline struct thermal_cooling_device * +of_pd_warming_register(struct device *parent, int pd_id) +{ + return ERR_PTR(-ENOSYS); +} + +static inline void +pd_warming_unregister(struct thermal_cooling_device *cdev) +{ +} +#endif /* CONFIG_PWR_DOMAIN_WARMING_THERMAL */ +#endif /* __PWR_DOMAIN_WARMING_H__ */ From patchwork Fri Mar 20 01:41:05 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thara Gopinath X-Patchwork-Id: 11448255 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id BDB0A13B1 for ; Fri, 20 Mar 2020 01:42:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9C5BA2080C for ; Fri, 20 Mar 2020 01:42:20 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="JoZrZzq9" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727473AbgCTBmQ (ORCPT ); Thu, 19 Mar 2020 21:42:16 -0400 Received: from mail-qv1-f68.google.com ([209.85.219.68]:46388 "EHLO mail-qv1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727414AbgCTBlR (ORCPT ); Thu, 19 Mar 2020 21:41:17 -0400 Received: by mail-qv1-f68.google.com with SMTP id m2so2166632qvu.13 for ; Thu, 19 Mar 2020 18:41:15 -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 :mime-version:content-transfer-encoding; bh=Lr1Y7KtiXEwRNt5oEJbHw3xmtSZcUrY6dlEwgFNuRHA=; b=JoZrZzq9MtCdZRY8h1hIczI93UjeYWLiyWcjBPqgqslk4B+dNR7hCtZIo7jyN6xzmt PhtpHWIrRArylYLj/pati/6Okn2ECsDFjNcuTjl/1u2m3eZZvbEsj0JyhcW+Nkf1rQm7 7vkn6PlDFIgd/DPxZnqmxR9bm0UaGI9/Y/zVDLEmBBjWQaEm0UPOBRyLUpRpyat/lwQ2 tIKTvYGmmrm/4MH5dCshcNMg2rWoiOfaFroCJC9mULyzd/myHd5i8mf8ZWoFDKvWy3R+ JmxiYw5Up0VLEHVizPB0QOaKD3/xpnZLsGnlp0Z+8ZFsCkuwJrsbuGlF8/YewmN39dBz pLaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Lr1Y7KtiXEwRNt5oEJbHw3xmtSZcUrY6dlEwgFNuRHA=; b=DW5PKz08fZOBMj55iM53DKNDFMGYaOdqvAsdCIzoOjxX9JlSUzpFEOikd9gyX7lwlI A8hbesmf7FPmIXCOlTdBQbRUvxDQUOM5bUqVAF2K8sMjI53rOtPVDTkEy4MiNq6VeUGv JaSxCdb7f3xTNO4HpTvGq3JfKnEtBYS8s6YzjncqB8nnRglZAV/n08NJCgzklggf6Kuf YgTQFALt/tkclAQ2Hsg1cxk/ztsVwHkufBttz5PTGP9b0esvHAohfJcmGgZUSDWb4xv7 IUYWhJRcO89o00YkJ6sahOHxV7yvG/yj5DNjzvHIQ8s0Qj90G4P7UGKVCmLraR+9tDwg e2/w== X-Gm-Message-State: ANhLgQ0VAl+z5ux30L5WqPQGBYwz/f6HmRA861uh4xVmhDeNda8tmVI8 ai3frtCagTtBRldtBrsR4cCzhQ== X-Google-Smtp-Source: ADFU+vvtDmCrjDHyAveZQW2W4i/gOJjiWwSRbwpOR4ID352DOyHj0eK14rldf7txaLpbXuc8IAZf1Q== X-Received: by 2002:a05:6214:12c1:: with SMTP id s1mr5757053qvv.150.1584668475089; Thu, 19 Mar 2020 18:41:15 -0700 (PDT) Received: from pop-os.fios-router.home (pool-71-255-246-27.washdc.fios.verizon.net. [71.255.246.27]) by smtp.googlemail.com with ESMTPSA id 2sm2706287qtp.33.2020.03.19.18.41.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Mar 2020 18:41:14 -0700 (PDT) From: Thara Gopinath To: rui.zhang@intel.com, ulf.hansson@linaro.org, daniel.lezcano@linaro.org, bjorn.andersson@linaro.org, agross@kernel.org, robh@kernel.org Cc: amit.kucheria@verdurent.com, mark.rutland@arm.com, rjw@rjwysocki.net, linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [Patch v5 4/6] soc: qcom: Extend RPMh power controller driver to register warming devices. Date: Thu, 19 Mar 2020 21:41:05 -0400 Message-Id: <20200320014107.26087-5-thara.gopinath@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200320014107.26087-1-thara.gopinath@linaro.org> References: <20200320014107.26087-1-thara.gopinath@linaro.org> MIME-Version: 1.0 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org RPMh power control hosts power domains that can be used as thermal warming devices. Register these power domains with the generic power domain warming device thermal framework. Reviewed-by: Ulf Hansson Signed-off-by: Thara Gopinath --- v3->v4: - Introduce a boolean value is_warming_dev in rpmhpd structure to indicate if a generic power domain can be used as a warming device or not.With this change, device tree no longer has to specify which power domain inside the rpmh power domain provider is a warming device. - Move registering of warming devices into a late initcall to ensure that warming devices are registered after thermal framework is initialized. drivers/soc/qcom/rpmhpd.c | 37 ++++++++++++++++++++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) diff --git a/drivers/soc/qcom/rpmhpd.c b/drivers/soc/qcom/rpmhpd.c index 7142409a3b77..4e9c0bbb8826 100644 --- a/drivers/soc/qcom/rpmhpd.c +++ b/drivers/soc/qcom/rpmhpd.c @@ -11,6 +11,7 @@ #include #include #include +#include #include #include #include @@ -48,6 +49,7 @@ struct rpmhpd { bool enabled; const char *res_name; u32 addr; + bool is_warming_dev; }; struct rpmhpd_desc { @@ -55,6 +57,8 @@ struct rpmhpd_desc { size_t num_pds; }; +const struct rpmhpd_desc *global_desc; + static DEFINE_MUTEX(rpmhpd_lock); /* SDM845 RPMH powerdomains */ @@ -89,6 +93,7 @@ static struct rpmhpd sdm845_mx = { .pd = { .name = "mx", }, .peer = &sdm845_mx_ao, .res_name = "mx.lvl", + .is_warming_dev = true, }; static struct rpmhpd sdm845_mx_ao = { @@ -452,7 +457,14 @@ static int rpmhpd_probe(struct platform_device *pdev) &rpmhpds[i]->pd); } - return of_genpd_add_provider_onecell(pdev->dev.of_node, data); + ret = of_genpd_add_provider_onecell(pdev->dev.of_node, data); + + if (ret) + return ret; + + global_desc = desc; + + return 0; } static struct platform_driver rpmhpd_driver = { @@ -469,3 +481,26 @@ static int __init rpmhpd_init(void) return platform_driver_register(&rpmhpd_driver); } core_initcall(rpmhpd_init); + +static int __init rpmhpd_init_warming_device(void) +{ + size_t num_pds; + struct rpmhpd **rpmhpds; + int i; + + if (!global_desc) + return -EINVAL; + + rpmhpds = global_desc->rpmhpds; + num_pds = global_desc->num_pds; + + if (!of_find_property(rpmhpds[0]->dev->of_node, "#cooling-cells", NULL)) + return 0; + + for (i = 0; i < num_pds; i++) + if (rpmhpds[i]->is_warming_dev) + of_pd_warming_register(rpmhpds[i]->dev, i); + + return 0; +} +late_initcall(rpmhpd_init_warming_device); From patchwork Fri Mar 20 01:41:06 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thara Gopinath X-Patchwork-Id: 11448253 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 79B7413B1 for ; Fri, 20 Mar 2020 01:42:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5757120753 for ; Fri, 20 Mar 2020 01:42:17 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="bdm7Sshv" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727265AbgCTBmQ (ORCPT ); Thu, 19 Mar 2020 21:42:16 -0400 Received: from mail-qv1-f68.google.com ([209.85.219.68]:46390 "EHLO mail-qv1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727428AbgCTBlR (ORCPT ); Thu, 19 Mar 2020 21:41:17 -0400 Received: by mail-qv1-f68.google.com with SMTP id m2so2166656qvu.13 for ; Thu, 19 Mar 2020 18:41:17 -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 :mime-version:content-transfer-encoding; bh=BmLDbgrQGRMcKnRjecEwvHf9acIPMdQPCuaUHQoEE9I=; b=bdm7Sshv0U+VOsv1chWTcKaftld2B9J2S6C1Dzd267vnc2TrQbnx7sTDemjcSIdSIl XP4Jb604+7eOnOxLy6k1txkJObvEWQVL6zB4R/+lc0qOj5LVcfgCjoMOpbuTaAS2gGeN Du3KWhzgPiQnWCp8QomaVLBPjo0BzsFzj/4aGNjNpVX0NOLYiJrgukUq8/jecz0tT7+a tVf8wJaYJnhV3eh7b7VAsBnrc2Nw5SmzprjSgV0/WsWcofm++w7V3xbXnGbsCz0ucVRu pZo+pFLfUWafOSW5dPWRiBf/ngetpNfqqg9oEhwfV6SfLtV+lMlZJZZrsf+QpSFazJFS R+mA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=BmLDbgrQGRMcKnRjecEwvHf9acIPMdQPCuaUHQoEE9I=; b=pySYQQ0rjJZuWI1lXZ9sauLb6bnfotDDUJXNkZsPyR2qnGAsDDWjTp06CG1qYQ9PJT VtNPxKK9PXatFuJb/dOhLXYdgQBdqflWHzuxBzmHzLxXTGrvDmcar5m6W7JH45h3MQ1b yh7QF8EsFOxUzT5D/mgC9LCGa4gKnmK75WaxP9/WIFK/nRnCYUGxAEO8k7Zz4mmUVdqs yJlA5tVVKWaoPqrFgJXirNeCuNkrgAtzgYOGgRDdDITPWjECcL02gCsiQqOYk00PVu5M YtlAfKy+A9M2QkmQOOjxhRsZa3s+BWnArBFrV06ewF8/NxAlFj0eEBhCFTrO/WK5HLvA 6E1w== X-Gm-Message-State: ANhLgQ0Wy5P7HFfcFQrNKLLbT0YS1m3zQM2gP0faBhH4XKw0fPfY8aLc TJgG8CrEAq39xI3b43ZR4ImmKw== X-Google-Smtp-Source: ADFU+vvLSkOdW7E5U5A5O6CcJJ7ZWJHOi0uG50WCDN6WNaQOvu8Lhdpvt6s/ZGRR/baXJawhCENi5A== X-Received: by 2002:a0c:9e41:: with SMTP id z1mr5918351qve.130.1584668476689; Thu, 19 Mar 2020 18:41:16 -0700 (PDT) Received: from pop-os.fios-router.home (pool-71-255-246-27.washdc.fios.verizon.net. [71.255.246.27]) by smtp.googlemail.com with ESMTPSA id 2sm2706287qtp.33.2020.03.19.18.41.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Mar 2020 18:41:16 -0700 (PDT) From: Thara Gopinath To: rui.zhang@intel.com, ulf.hansson@linaro.org, daniel.lezcano@linaro.org, bjorn.andersson@linaro.org, agross@kernel.org, robh@kernel.org Cc: amit.kucheria@verdurent.com, mark.rutland@arm.com, rjw@rjwysocki.net, linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [Patch v5 5/6] dt-bindings: power: Extend RPMh power controller binding to describe thermal warming device Date: Thu, 19 Mar 2020 21:41:06 -0400 Message-Id: <20200320014107.26087-6-thara.gopinath@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200320014107.26087-1-thara.gopinath@linaro.org> References: <20200320014107.26087-1-thara.gopinath@linaro.org> MIME-Version: 1.0 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org RPMh power controller hosts mx domain that can be used as thermal warming device. Add #cooling-cells property to the power domain provider node to indicate this. Signed-off-by: Thara Gopinath Acked-by: Rob Herring --- v3->v4: - Removed subnode to indicate that mx power domain is a warming device. Instead #cooling-cells is used as a power domain provider property to indicate if the provider hosts a power domain that can be used as a warming device. v4->v5: Moved the property from .txt format to .yaml format. Documentation/devicetree/bindings/power/qcom,rpmpd.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Documentation/devicetree/bindings/power/qcom,rpmpd.yaml b/Documentation/devicetree/bindings/power/qcom,rpmpd.yaml index ba605310abeb..16b713d295c4 100644 --- a/Documentation/devicetree/bindings/power/qcom,rpmpd.yaml +++ b/Documentation/devicetree/bindings/power/qcom,rpmpd.yaml @@ -27,6 +27,9 @@ properties: '#power-domain-cells': const: 1 + '#cooling-cells': + const: 2 + operating-points-v2: true opp-table: From patchwork Fri Mar 20 01:41:07 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thara Gopinath X-Patchwork-Id: 11448237 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 99D6D13B1 for ; Fri, 20 Mar 2020 01:41:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 790E520753 for ; Fri, 20 Mar 2020 01:41:22 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="oam8JWZ3" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727469AbgCTBlU (ORCPT ); Thu, 19 Mar 2020 21:41:20 -0400 Received: from mail-qv1-f65.google.com ([209.85.219.65]:36673 "EHLO mail-qv1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727455AbgCTBlU (ORCPT ); Thu, 19 Mar 2020 21:41:20 -0400 Received: by mail-qv1-f65.google.com with SMTP id z13so2204342qvw.3 for ; Thu, 19 Mar 2020 18:41:18 -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 :mime-version:content-transfer-encoding; bh=52Uodj2SzxJW+qxs/0UIGlzA4a0LVLQTDw34ezZAhxU=; b=oam8JWZ3B0HMyyED4XOyqJ7WO+9kN2B2G75Q+shvg5iuMD37rho/XK2LYyggtkp4FD WLLv6b4KPs71RyTzlIkjmB0Y+jpXkv5l+VwdFp8K6M4W0sYJgSBh2ubme7mOgNyq6HRU ImcCdBD//Tt2lG2ZYrtMXEE2lgL+lhLf6K9l4WgNkZw/lGi4E9UdlYg6yegHDsnoCQzn WWYmrB5MtDtpE5dVQQknZYQidYDANdQg/sqlM1H8mMnMDid9eWmKexagz3yJJPdZr9tH cSgac8HaxhEhshozUPLK0RuoeD8z/ns2MRFJ2tS7jF7Rl3WVu9xZ7pChvxrBxmqePMwc k2ow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=52Uodj2SzxJW+qxs/0UIGlzA4a0LVLQTDw34ezZAhxU=; b=GVlhCs95iilh95cuNvi7GBG1f2zotv0Qcgefg8KZlN3q0nT2bj16JEETDx0XjZOf7S g+1U5g4yv3F21A46K47Rms0IjJyyReFP2do1+3zUS68BQAukKgkoTR/VBy7flHMWECik YXu/LYXksIjdz/197n6Znihd/GAevyFMKlkw+FWaoHC09aFq0j2p5TcQIygLZjJQnovB QNBduVQed8x3a40D+2mJF1XuoFTfSR7pIvYxJhF200fHsyr57XbM4hhu0n/YsNQ6I7bw hJ9E8ddEiVqO6QPAnGC6BvhF9llMC5I5+GrhxddeBNeFpm95SL5e3m7cZRnwRYw031FK VKXw== X-Gm-Message-State: ANhLgQ1p4ErPgxCTbASPq1Io0o/fjA/E0sefdM69/uD9znYYlYaKqFig FDveO0LLXE+h8YjlQxUgOhMvAw== X-Google-Smtp-Source: ADFU+vuKKFrOz+rjU+KyncwIFd66K8roSktkMf0iaMaBQ+5F+Bkq/JoTPLHcji0jBMA8VXOSEirdhA== X-Received: by 2002:a05:6214:14a:: with SMTP id x10mr6086238qvs.158.1584668478038; Thu, 19 Mar 2020 18:41:18 -0700 (PDT) Received: from pop-os.fios-router.home (pool-71-255-246-27.washdc.fios.verizon.net. [71.255.246.27]) by smtp.googlemail.com with ESMTPSA id 2sm2706287qtp.33.2020.03.19.18.41.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Mar 2020 18:41:17 -0700 (PDT) From: Thara Gopinath To: rui.zhang@intel.com, ulf.hansson@linaro.org, daniel.lezcano@linaro.org, bjorn.andersson@linaro.org, agross@kernel.org, robh@kernel.org Cc: amit.kucheria@verdurent.com, mark.rutland@arm.com, rjw@rjwysocki.net, linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [Patch v5 6/6] arm64: dts: qcom: Indicate rpmhpd hosts a power domain that can be used as a warming device. Date: Thu, 19 Mar 2020 21:41:07 -0400 Message-Id: <20200320014107.26087-7-thara.gopinath@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200320014107.26087-1-thara.gopinath@linaro.org> References: <20200320014107.26087-1-thara.gopinath@linaro.org> MIME-Version: 1.0 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org RPMh hosts mx power domain that can be used to warm up the SoC. Indicate this by using #cooling-cells property. Reviewed-by: Ulf Hansson Signed-off-by: Thara Gopinath Reviewed-by: Bjorn Andersson --- v3->v4: - Removed subnode to indicate that mx power domain is a warming device. Instead #cooling-cells is used as a power domain provider property to indicate if the provider hosts a power domain that can be used as a warming device. arch/arm64/boot/dts/qcom/sdm845.dtsi | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm64/boot/dts/qcom/sdm845.dtsi b/arch/arm64/boot/dts/qcom/sdm845.dtsi index fe35d37a11cc..0d878b2ca351 100644 --- a/arch/arm64/boot/dts/qcom/sdm845.dtsi +++ b/arch/arm64/boot/dts/qcom/sdm845.dtsi @@ -3703,6 +3703,7 @@ rpmhpd: power-controller { compatible = "qcom,sdm845-rpmhpd"; #power-domain-cells = <1>; + #cooling-cells = <2>; operating-points-v2 = <&rpmhpd_opp_table>; rpmhpd_opp_table: opp-table {