All of lore.kernel.org
 help / color / mirror / Atom feed
From: Matthias Kaehlcke <mka@chromium.org>
To: Daniel Lezcano <daniel.lezcano@linaro.org>
Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>,
	"open list:CPU IDLE TIME MANAGEMENT FRAMEWORK" 
	<linux-pm@vger.kernel.org>,
	open list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 2/2] thermal: cpuidle: Register cpuidle cooling device
Date: Thu, 19 Dec 2019 14:51:03 -0800	[thread overview]
Message-ID: <20191219225103.GZ228856@google.com> (raw)
In-Reply-To: <20191219221932.15930-2-daniel.lezcano@linaro.org>

Hi Daniel,

On Thu, Dec 19, 2019 at 11:19:28PM +0100, Daniel Lezcano wrote:
> The cpuidle driver can be used as a cooling device by injecting idle
> cycles. The DT binding for the idle state added an optional
> 
> When the property is set, register the cpuidle driver with the idle
> state node pointer as a cooling device. The thermal framework will do
> the association automatically with the thermal zone via the
> cooling-device defined in the device tree cooling-maps section.
> 
> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
> ---
>  drivers/cpuidle/dt_idle_states.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/drivers/cpuidle/dt_idle_states.c b/drivers/cpuidle/dt_idle_states.c
> index d06d21a9525d..34bd65197342 100644
> --- a/drivers/cpuidle/dt_idle_states.c
> +++ b/drivers/cpuidle/dt_idle_states.c
> @@ -8,6 +8,7 @@
>  
>  #define pr_fmt(fmt) "DT idle-states: " fmt
>  
> +#include <linux/cpu_cooling.h>
>  #include <linux/cpuidle.h>
>  #include <linux/cpumask.h>
>  #include <linux/errno.h>
> @@ -205,6 +206,13 @@ int dt_init_idle_driver(struct cpuidle_driver *drv,
>  			err = -EINVAL;
>  			break;
>  		}
> +
> +		if (of_find_property(state_node, "#cooling-cells", NULL)) {
> +			err = cpuidle_of_cooling_register(state_node, drv);

cpuidle_of_cooling_register() returns a struct thermal_cooling_device *,
so you probably want to use PTR_ERR() here.

Could it be a problem that the cooling device isn't unregistered even when all
associated cores are taken offline?

  reply	other threads:[~2019-12-19 22:51 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-19 22:19 [PATCH 1/2] DT: bindings: Add cooling cells for idle states Daniel Lezcano
2019-12-19 22:19 ` [PATCH 2/2] thermal: cpuidle: Register cpuidle cooling device Daniel Lezcano
2019-12-19 22:51   ` Matthias Kaehlcke [this message]
2019-12-19 22:57     ` Daniel Lezcano
2020-01-08 14:03 ` [PATCH 1/2] DT: bindings: Add cooling cells for idle states Rob Herring
2020-01-11 17:32   ` Daniel Lezcano
2020-01-13 16:16     ` Rob Herring
2020-01-13 17:52       ` Daniel Lezcano
2020-01-27 18:29         ` Daniel Lezcano
2020-01-28  0:21         ` Rob Herring

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191219225103.GZ228856@google.com \
    --to=mka@chromium.org \
    --cc=daniel.lezcano@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=rjw@rjwysocki.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.