From patchwork Thu Jun 4 01:53:12 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thara Gopinath X-Patchwork-Id: 11586801 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 0E9921392 for ; Thu, 4 Jun 2020 01:53:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E91A4207F5 for ; Thu, 4 Jun 2020 01:53:24 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="TTHUNmNT" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728000AbgFDBxX (ORCPT ); Wed, 3 Jun 2020 21:53:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49172 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728001AbgFDBxW (ORCPT ); Wed, 3 Jun 2020 21:53:22 -0400 Received: from mail-qk1-x742.google.com (mail-qk1-x742.google.com [IPv6:2607:f8b0:4864:20::742]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 296CDC08C5C0 for ; Wed, 3 Jun 2020 18:53:22 -0700 (PDT) Received: by mail-qk1-x742.google.com with SMTP id c14so4471800qka.11 for ; Wed, 03 Jun 2020 18:53:22 -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=OXFBxnWXYnn/70SvWtr9K2MHoufkLsFwRRiIi6zZBfk=; b=TTHUNmNTBK6ssrGE4vNIHuoGl36/IKA184BiSEt8dXIB0bXbrx0XulkgtaLviqMvuW tiIHAKyJPYZreacCzAGf8kljq9QG3N1PG/bNUFHp6FKanpARhYnd1lj2lOa6FWJptBym L3dMIgXoBnK89BgeVPpe8GHacwrkCx5LaXP0Aq0Xj0HBxajAOPuALcf5U/FjaB+Z1voT vf9KlCpD5m6T105XsMMrDnc2eE2+NRpCmzy6IkeydAUxAPeb6uqYMzZgBWZcU5IkBZgX EYrGk3+RyAqITb8mgfYGzzvQrK11Ct5wGRbMIFnMdg3+5dZJ1/4HOLZ606IzJqO/iePB GkYg== 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=OXFBxnWXYnn/70SvWtr9K2MHoufkLsFwRRiIi6zZBfk=; b=aeOLx9IB8//0Gj36Nknhy+XXwijbvZo09gzEyaq17EbI5dRZVmV1XTpZox7wPC4QnQ jW7h/A01Ncf1HspTIBV5noHBK3PzhXVn4hBjyIJRKieqESvSVazs1+FXrGa5EeNxxPau ICaOwC0S55mCzZ3VbXcUpPiPyMKLIK1mKIp7EV8wemKjeZTCN4nL0AFrOf3aNZwqZboC mtJ8qnV6LDKczAQw8NLemoJpXr+qpvIgpSDPfs64K/xqiup64iGm6Ud2vz3J0nMGlfTK chqRXVo5nH+wfPUb4ug01Q13+sPXpI4E2vEXJ2VtldsBO/jcyHXCuGys4KEcaTKV2ici MOmw== X-Gm-Message-State: AOAM531aEipizLiTEbBO5JHEgtLNLAqv+KPHrrbFZsNVgjsXAMKPGBgz a2yQxTNqB+yN7AUv7XgmAAMR2et4PfzRQg== X-Google-Smtp-Source: ABdhPJxtYPvU4sjsI6bm1cB56yIjkZm4HSRbup9Y6NQzxcUlyQ8iJvQmJ9f/YKDFoggQ1o/Vl5DgyA== X-Received: by 2002:a05:620a:15a5:: with SMTP id f5mr2710795qkk.9.1591235601365; Wed, 03 Jun 2020 18:53:21 -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 t74sm2986439qka.21.2020.06.03.18.53.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Jun 2020 18:53:19 -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 v6 1/6] PM/Domains: Add support for retrieving genpd performance states information Date: Wed, 3 Jun 2020 21:53:12 -0400 Message-Id: <20200604015317.31389-2-thara.gopinath@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200604015317.31389-1-thara.gopinath@linaro.org> References: <20200604015317.31389-1-thara.gopinath@linaro.org> MIME-Version: 1.0 Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@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. Signed-off-by: Thara Gopinath Reviewed-by: Ulf Hansson 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 0a01df608849..88f8773cabe7 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 Thu Jun 4 01:53:13 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thara Gopinath X-Patchwork-Id: 11586821 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 F24D31391 for ; Thu, 4 Jun 2020 01:53:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D9B5820772 for ; Thu, 4 Jun 2020 01:53:54 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="g+JVXvVE" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728025AbgFDBxu (ORCPT ); Wed, 3 Jun 2020 21:53:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49180 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728012AbgFDBxX (ORCPT ); Wed, 3 Jun 2020 21:53:23 -0400 Received: from mail-qt1-x844.google.com (mail-qt1-x844.google.com [IPv6:2607:f8b0:4864:20::844]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4A472C08C5C0 for ; Wed, 3 Jun 2020 18:53:23 -0700 (PDT) Received: by mail-qt1-x844.google.com with SMTP id c12so3930772qtq.11 for ; Wed, 03 Jun 2020 18:53:23 -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=Ol8M2KCtVTfhjIudQ80yoAA541E23GCrsvIpBzMufk8=; b=g+JVXvVEhHBGXKk2wAZGtNuoP1FYpvjvUuC5MOwY3es9FBBcxhVq6st1ofsoIOh7+e 2eFVCjT62+hMAWz2US1Slf0/Wzf6zyrhKXZ7XXrIwxVYhhLty0DDItF+ZpBm5FB4Eqon 7uv+DEl4e5steUBdILty/uqHIbznxb8XXwua4wBLyTUX1Ln0ENC4YgiE7rXkPKrqw/U+ oYXNL+FC6xTjKapLxYXEgp9prko8EXbVw4RR7+kADWkJgyS/CfIvgcU4mIYg+ez2B4jR ouIkuZGdHNwOWxpM8m4GtThiXkCxZTYLikuEoLjVRopgs8ZAqm6hkSFQj1UNuSzaG9r4 hCkQ== 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=Ol8M2KCtVTfhjIudQ80yoAA541E23GCrsvIpBzMufk8=; b=GqscbC2BYtTU/urWJ+1K6cVllwsYWXqR1kO6EHuoYFo6z5sM76oVdBzr9x3nFBT1Jd r+1xpsSHsnhml2cgd9QXdg2BGY5ZUgZJgigYdNbkgJnPBJoDZ6kv+UdHTSr3mwLneSHF E36vn5hFKZ/U9En/8g0KIVlEokZtR32HWGu77FPbdFO4GhgrZHQD7MpJIh0lzfAD7I33 BRI8PoB4u1O9CKg5YgWxDsOUE38Rm0Opvo6lpc/o5ZVdHZVJ+H/wxFhEZdFnFORd6mn6 VcRy0Z4AcIm2RzMT5p5zOj0iq24knNssjcg6pwK3/IpcqanAWo2Niu0f0+Ecs6yKccAR 4VGQ== X-Gm-Message-State: AOAM530PT27TRq2gOApq61oqWdOeWurSuPoF8YFbQEbEn21rSG6Do0+w 4rxt/Isq5M+oUG6OYZ+gmZTRQw== X-Google-Smtp-Source: ABdhPJwV+BvFStA1v5/UAqO4fihvZU5fJ58FDImcRujQQp1tu0wGpU2ow31ZMbF7tSXu0JwSuJkq6A== X-Received: by 2002:ac8:2bc1:: with SMTP id n1mr2332050qtn.382.1591235602521; Wed, 03 Jun 2020 18:53:22 -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 t74sm2986439qka.21.2020.06.03.18.53.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Jun 2020 18:53:21 -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 v6 2/6] soc: qcom: rpmhpd: Introduce function to retrieve power domain performance state count Date: Wed, 3 Jun 2020 21:53:13 -0400 Message-Id: <20200604015317.31389-3-thara.gopinath@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200604015317.31389-1-thara.gopinath@linaro.org> References: <20200604015317.31389-1-thara.gopinath@linaro.org> MIME-Version: 1.0 Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Populate .get_performance_state_count in genpd ops to retrieve the count of performance states supported by a rpmh power domain. Signed-off-by: Thara Gopinath Reviewed-by: Bjorn Andersson Reviewed-by: Ulf Hansson --- drivers/soc/qcom/rpmhpd.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/soc/qcom/rpmhpd.c b/drivers/soc/qcom/rpmhpd.c index e72426221a69..a9c597143525 100644 --- a/drivers/soc/qcom/rpmhpd.c +++ b/drivers/soc/qcom/rpmhpd.c @@ -362,6 +362,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; @@ -450,6 +457,7 @@ 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 Thu Jun 4 01:53:14 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thara Gopinath X-Patchwork-Id: 11586803 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 8799A90 for ; Thu, 4 Jun 2020 01:53:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6233620738 for ; Thu, 4 Jun 2020 01:53:29 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="wWp6CJTq" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728029AbgFDBx2 (ORCPT ); Wed, 3 Jun 2020 21:53:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49194 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728015AbgFDBxY (ORCPT ); Wed, 3 Jun 2020 21:53:24 -0400 Received: from mail-qt1-x844.google.com (mail-qt1-x844.google.com [IPv6:2607:f8b0:4864:20::844]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 93D14C08C5C6 for ; Wed, 3 Jun 2020 18:53:24 -0700 (PDT) Received: by mail-qt1-x844.google.com with SMTP id k22so3955519qtm.6 for ; Wed, 03 Jun 2020 18:53:24 -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=6zVKcLTPmnGwe40Y367QYIcZACR6WrRrYV644jQUiEs=; b=wWp6CJTqDOyoFiDlZn1RLWo8Hmy/EWuTSribqdOwk5CHkQFGicLYbtiYIQm7t8I4le NOl2bkCeWBwACjo4HVqTt84VS6fc7Wc2rEeC6ecL3qnnWqwgXOqt2tdnjMRnKIMcT/vw eWAtV/7ViPZqHAiQEOWlrLnX2STnNR8nElsEHk46SfWRfwkb/2rxFkvb1nfdWi6IFBoO q3ydaxZqnD6beBnYQPDoWREQLRaVTVWO9fOmu1T+w/g32pI50Hgh3FarYsrGxrJ5cwZJ NgIi3WCFwXD9nZl85/64TMJMnJ4PqHj53uYKV/C5v5oVnidr/s6KWZv9vHKMDQaGl/Bq Azbg== 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=6zVKcLTPmnGwe40Y367QYIcZACR6WrRrYV644jQUiEs=; b=D7demz5EeU8//iQYu0MWwHVwAJq9xmYhQsjl27PG/XrdnA2tEcaJ1RoV1ZE25wHUG8 Qwz5EBp9emlurhuQkwbZX9vqpNycpna7jOCZ9OnBEkmqh76suAc7o2m+1W0majrxs4ia hp2/8JmLghrHYOAVzGJzOJte2nDXmege/LFHQVNms3CDoRA8Nm7946Nw1+qeXJE5PZcy T8i/WnyuO9EYoH3YVpEPU2RnWW8BZ0WbRRyHrbgpAcV5y1yasvKICft5yONnyIUQBpCQ VQGBewNyEdup6Oe1NhZovJ84KZK8oX5bYX/+dLbwz/p+MG2XqfZyuL7rkyy3y67if54P AfPA== X-Gm-Message-State: AOAM530ou1L1xC1Pph6qjjSXYHVuOpPHZ0mREGVwWJPzqi1Z04aENqhY pcSoO5y5oK01FGhbayFMJUVwpw== X-Google-Smtp-Source: ABdhPJx3QMOwNKw/vg6Qo4Do37BesTxVwG1EFm8RXWKL64cET36kH8f3if6rvKhrSBWCgRScsulADw== X-Received: by 2002:ac8:42c3:: with SMTP id g3mr2208401qtm.313.1591235603690; Wed, 03 Jun 2020 18:53:23 -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 t74sm2986439qka.21.2020.06.03.18.53.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Jun 2020 18:53:23 -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 v6 3/6] thermal: Add generic power domain warming device driver. Date: Wed, 3 Jun 2020 21:53:14 -0400 Message-Id: <20200604015317.31389-4-thara.gopinath@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200604015317.31389-1-thara.gopinath@linaro.org> References: <20200604015317.31389-1-thara.gopinath@linaro.org> MIME-Version: 1.0 Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@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 Reviewed-by: Ulf Hansson --- 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. v5->v6: - Fixed issues with ->release() and kfree(dev) as pointed out by Ulf. drivers/thermal/Kconfig | 10 +++ drivers/thermal/Makefile | 4 + drivers/thermal/pd_warming.c | 169 +++++++++++++++++++++++++++++++++++ include/linux/pd_warming.h | 29 ++++++ 4 files changed, 212 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 e53314ea9e25..3a0bcf3e8bd9 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 86c506410cc0..14fa696a08bd 100644 --- a/drivers/thermal/Makefile +++ b/drivers/thermal/Makefile @@ -28,7 +28,11 @@ thermal_sys-$(CONFIG_CLOCK_THERMAL) += clock_cooling.o # devfreq cooling thermal_sys-$(CONFIG_DEVFREQ_THERMAL) += devfreq_cooling.o +#pwr domain warming +thermal_sys-$(CONFIG_PWR_DOMAIN_WARMING_THERMAL) += pd_warming.o + obj-$(CONFIG_K3_THERMAL) += k3_bandgap.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..1ea93481c79b --- /dev/null +++ b/drivers/thermal/pd_warming.c @@ -0,0 +1,169 @@ +// 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) +{ + struct pd_warming_device *pd_wdev; + + pd_wdev = container_of(dev, struct pd_warming_device, dev); + kfree(pd_wdev); +} + +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 out; + } + + 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); +out: + 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); + device_unregister(dev); +} +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 Thu Jun 4 01:53:15 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thara Gopinath X-Patchwork-Id: 11586809 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 39A9F1391 for ; Thu, 4 Jun 2020 01:53:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 200E220738 for ; Thu, 4 Jun 2020 01:53:34 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="gvkwNtLe" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726135AbgFDBxc (ORCPT ); Wed, 3 Jun 2020 21:53:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49186 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728034AbgFDBx2 (ORCPT ); Wed, 3 Jun 2020 21:53:28 -0400 Received: from mail-qt1-x841.google.com (mail-qt1-x841.google.com [IPv6:2607:f8b0:4864:20::841]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0FE03C08C5C7 for ; Wed, 3 Jun 2020 18:53:27 -0700 (PDT) Received: by mail-qt1-x841.google.com with SMTP id u17so3980554qtq.1 for ; Wed, 03 Jun 2020 18:53:27 -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=Tud9p3zmcof67j7J04w2IZJcscMQG/mxzuG6n3catS0=; b=gvkwNtLeDcKfmolxt47SKJqNLrx96FuiXBbqhr6yL6pkbk+6eAfUdi7Ls635NAFRis 1ZRTZoZVrji9WfctgIUCfoTMINNQPtGir1JDuraItDR4TWZbcbMtU2S0+2fwUELd77Wy bXiEYvBqgPMT4Dc1VEEruvyYf+4RPQtWGwAmPQfnJJOWKuWyT2CpsESBkiwsT0Xj/q5h 8+de2RsSZmYinEoYcQcEs9UVRYEozaOh+kuah0oajP4qQlqj8s5sh57asM+LRqT4MmOM G6DkmlqR928RXVNYALs88O1fJBmUerCcuQM7UsK1zK4qxp8y+hMBAYlEPNTA6+pafGZd o6Fg== 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=Tud9p3zmcof67j7J04w2IZJcscMQG/mxzuG6n3catS0=; b=l2q951vZzxEUpfRIncJIs8JlmLFqfh0F6+mcniSMsy/5D1B0mA/t+oI/B0GzFSlOmg dnBMRjGB2lFN4umtqoqSYKppFpilLjSevPlLzLp1tqRhC3HQ/S2a2kZaN/pprrzHs0eP sOsvPLaZOyXVkn6oe23dSb2BLnhnKBFc/1vWeoC2kB5urpavpzcBBEiZYDDyEa/mxm1c IU/BhWCNJbrG7yBUKFqVY55xhtwERn0QwKfndyoIrvKwNbwGnJQ0D9qN+pOflkzsiKAR v2te206/tV7fUyAoNTzKUC+IrIdzy4168VmF75fw/8aDH7CpJ5vm/aJOxLmPeA8PEVgh nJew== X-Gm-Message-State: AOAM530dCbSYvcXXXnF3pvZUxu+nEZ9R7mSMijL/y3Fkdkjtk9lrXzrh xc0R9ddMV5Pnk8SAxKzP4oEoYs7+4kJRVQ== X-Google-Smtp-Source: ABdhPJwZSZlwdqbh/tvDoU4z1M6L05Pn97ctupdyClOzsDYxbB7M2fC/4WCBKJ4VDhth6SO/kz7aGA== X-Received: by 2002:aed:2237:: with SMTP id n52mr2160281qtc.83.1591235606250; Wed, 03 Jun 2020 18:53:26 -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 t74sm2986439qka.21.2020.06.03.18.53.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Jun 2020 18:53:24 -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 v6 4/6] soc: qcom: Extend RPMh power controller driver to register warming devices. Date: Wed, 3 Jun 2020 21:53:15 -0400 Message-Id: <20200604015317.31389-5-thara.gopinath@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200604015317.31389-1-thara.gopinath@linaro.org> References: <20200604015317.31389-1-thara.gopinath@linaro.org> MIME-Version: 1.0 Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@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. Signed-off-by: Thara Gopinath Reviewed-by: Ulf Hansson --- 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. v5->v6: - Moved back registering of warming devices into probe since Bjorn pointed out that now the driver can be initialized as as a module, late_initcall will not work. Thermal framework takes care of binding a cooling device to a thermal zone even if the cooling device is registered before the thermal framework is initialized. drivers/soc/qcom/rpmhpd.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/drivers/soc/qcom/rpmhpd.c b/drivers/soc/qcom/rpmhpd.c index a9c597143525..29e1eb4d11af 100644 --- a/drivers/soc/qcom/rpmhpd.c +++ b/drivers/soc/qcom/rpmhpd.c @@ -12,6 +12,7 @@ #include #include #include +#include #include #include #include @@ -49,6 +50,7 @@ struct rpmhpd { bool enabled; const char *res_name; u32 addr; + bool is_warming_dev; }; struct rpmhpd_desc { @@ -90,6 +92,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 = { @@ -472,7 +475,19 @@ 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; + + if (!of_find_property(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; } static struct platform_driver rpmhpd_driver = { From patchwork Thu Jun 4 01:53:16 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thara Gopinath X-Patchwork-Id: 11586813 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 86BD990 for ; Thu, 4 Jun 2020 01:53:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6C580207D0 for ; Thu, 4 Jun 2020 01:53:37 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="iSv3LGf0" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728047AbgFDBxg (ORCPT ); Wed, 3 Jun 2020 21:53:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49194 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728031AbgFDBx2 (ORCPT ); Wed, 3 Jun 2020 21:53:28 -0400 Received: from mail-qv1-xf41.google.com (mail-qv1-xf41.google.com [IPv6:2607:f8b0:4864:20::f41]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 07E18C08C5C0 for ; Wed, 3 Jun 2020 18:53:28 -0700 (PDT) Received: by mail-qv1-xf41.google.com with SMTP id ec10so2200402qvb.5 for ; Wed, 03 Jun 2020 18:53:27 -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=i858jJWQbhuwRMj8E1/bxOovHVRlGVAzlzhMfpqJNyU=; b=iSv3LGf08jzGFo42mX0KR7PGLzCPQauNhYrrp3BXnzbEc2CW7abMVDkozTgcYHf/yf s06fyMTLbG0oexq0OXdsjoYiPqq3jub1muv86cBhQuRun9lTu9qyObmSQhH+ZbqwEspx j+/cCPcW9aXerBwgotYV3sFiQLISg0OInwfqnT898hy7S+mmH5v2P4oIe7/lJJrdIma8 qFVD9dKIT603LPHP8ksXAJ9aP8QhIhZSkHv7lEUp1bmgFT3A+SRbUw3uvSz9z8pa6i+6 oZybQtGht8sq8EH5pgK8aWzj1S21q4RDdPUoKXCQGvEKkHuWOwKWiNyr2lbuh+H8JmMM T8TQ== 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=i858jJWQbhuwRMj8E1/bxOovHVRlGVAzlzhMfpqJNyU=; b=hAQ4KeEomwpZsP9UrWHUCnkv71cKbWoSO8qnpx1VL/q3zGPG5R0OsZMFRFLiIYT1K4 OH2qtA4WexDG4lslTIrIKToi0MSNvVhuBJLlPMFXRL3F+jzF/99jVA7lD2dJh9CotoHi TGSqIOp9I+6WE9WQOXWEBpaACwjx+sZR2Wc1bTASOr7mmEYQ6updBaNGFNRcLElyteHv 4v0xhZAXl/YzuZq4mKwQeX9pG9pXzP6fL+vAahl9Tc5+3MsS1dcLzsP5K5vFd7M0xiuz 1BcDnEGuTGvni+v/PkAjUvt8EDM+YsejlFEI8WTUiaiwBsvbcagluQ99/nyrR6KONCRR o2wg== X-Gm-Message-State: AOAM532RqV89c74WQ08Z8l2xLyH8IhTZgXgoI2gTfe83TNa0iNrgoLMp +fQ4vNnHZVTswuP0V6w65goUWA== X-Google-Smtp-Source: ABdhPJy/qVnYPDu7TwQ009JRMbLWRxZ8N0T6NTl5vAfmesQQgKmZ693NBu1XxWhNl9aBfX2gOnZ6KA== X-Received: by 2002:a05:6214:28:: with SMTP id b8mr2571818qvr.60.1591235607224; Wed, 03 Jun 2020 18:53:27 -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 t74sm2986439qka.21.2020.06.03.18.53.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Jun 2020 18:53:26 -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 v6 5/6] dt-bindings: power: Extend RPMh power controller binding to describe thermal warming device Date: Wed, 3 Jun 2020 21:53:16 -0400 Message-Id: <20200604015317.31389-6-thara.gopinath@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200604015317.31389-1-thara.gopinath@linaro.org> References: <20200604015317.31389-1-thara.gopinath@linaro.org> MIME-Version: 1.0 Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@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 Reviewed-by: Ulf Hansson --- 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 8058955fb3b9..a4fbbd88ce18 100644 --- a/Documentation/devicetree/bindings/power/qcom,rpmpd.yaml +++ b/Documentation/devicetree/bindings/power/qcom,rpmpd.yaml @@ -28,6 +28,9 @@ properties: '#power-domain-cells': const: 1 + '#cooling-cells': + const: 2 + operating-points-v2: true opp-table: From patchwork Thu Jun 4 01:53:17 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thara Gopinath X-Patchwork-Id: 11586811 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 D20B490 for ; Thu, 4 Jun 2020 01:53:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B992120870 for ; Thu, 4 Jun 2020 01:53:35 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="PSKnA+A3" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726429AbgFDBxc (ORCPT ); Wed, 3 Jun 2020 21:53:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49216 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728048AbgFDBx3 (ORCPT ); Wed, 3 Jun 2020 21:53:29 -0400 Received: from mail-qt1-x843.google.com (mail-qt1-x843.google.com [IPv6:2607:f8b0:4864:20::843]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F188FC08C5CA for ; Wed, 3 Jun 2020 18:53:28 -0700 (PDT) Received: by mail-qt1-x843.google.com with SMTP id z1so3985122qtn.2 for ; Wed, 03 Jun 2020 18:53:28 -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=cx1RfItm8P+5zdZthMwhmTFP4jusIpmaSOa4M7MTCuw=; b=PSKnA+A32FTYGNyVZ3JCedIaquwwdMV72TXnPo6jQ5OtwjCTbqy4v+cayuXvcEV+h3 zdwZeJ8nrs6vtj5J4AFvYymjLdeGkrP7+DzUYcHY3H5dq429Gd+ioqTgp2GB256edagr sin0Mxjm1Ra82p1Ny8wMEEm/SuvoitD95Xr3cZVdoYK+AVezR0e+1Prav2RMCe6iU/4N j1wM0QWac4RMmJtIRdAVp7wUCmO68mfJzJrebTnWL+k6lvZzFmAdxWU+7SulimOiLd9C Jh18p/7qP8dlgFw5GljRiy5MWLAyuGZylM0Pb46DCNgWAaP4u1VrXQ8eo0cUk++O30yp R+hA== 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=cx1RfItm8P+5zdZthMwhmTFP4jusIpmaSOa4M7MTCuw=; b=ME6QTlDdyXlV2NKwLB6H5o5lmk2ihXOqsZqf7KWWzOwbQZh1kuppVHRETpcEEur+2M Z+JQ4DrwflWJpLz4J2dK97ezgd7aqJGOY0uobv7x0jSqcZlhObDGMKmBkqsMBvwSvyw+ FuNGHIcRHRYNQZheRy3meo1WwNsF+G3zU3OkiaBVXin2ZXHnKdIupR9zzx5sSKK+8rVd iQmGkpLl58ZrcTAXxzQ1ujMHrxxAZTVEt1aObUzsnlkn32tnUf/ixhIY9I45Cy21OGSQ KgR+f2v+/okFtVWbDTo0gl9fu67Ur5jqm5D1Dnjrd7AesbVvSTJ0ToCvQAX8XldqdENA LahA== X-Gm-Message-State: AOAM531weFuCTjIT39j+qc+bFktcQ5PlSrcjCfvgwgOnpd/C7HjuCE9H zqmyG3JifcLfbN7HB1crBufkBQ== X-Google-Smtp-Source: ABdhPJzFuQ11RGaUFX9ez2ZUYVbvhFKr+5CSf9niClZmUapncKEZa/DruY85eifIRSadG1SF4IIQrg== X-Received: by 2002:ac8:450a:: with SMTP id q10mr2274459qtn.328.1591235608210; Wed, 03 Jun 2020 18:53:28 -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 t74sm2986439qka.21.2020.06.03.18.53.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Jun 2020 18:53:27 -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 v6 6/6] arm64: dts: qcom: Indicate rpmhpd hosts a power domain that can be used as a warming device. Date: Wed, 3 Jun 2020 21:53:17 -0400 Message-Id: <20200604015317.31389-7-thara.gopinath@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200604015317.31389-1-thara.gopinath@linaro.org> References: <20200604015317.31389-1-thara.gopinath@linaro.org> MIME-Version: 1.0 Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org RPMh hosts mx power domain that can be used to warm up the SoC. Indicate this by using #cooling-cells property. Signed-off-by: Thara Gopinath Reviewed-by: Ulf Hansson 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 8eb5a31346d2..dcc3bcd16b68 100644 --- a/arch/arm64/boot/dts/qcom/sdm845.dtsi +++ b/arch/arm64/boot/dts/qcom/sdm845.dtsi @@ -3854,6 +3854,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 {