From: Lukasz Luba <lukasz.luba@arm.com>
To: Daniel Lezcano <daniel.lezcano@linaro.org>, rui.zhang@intel.com
Cc: amit.kucheria@verdurent.com,
"Rafael J. Wysocki" <rjw@rjwysocki.net>,
Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>,
Sudeep Holla <sudeep.holla@arm.com>,
"open list:CPU IDLE TIME MANAGEMENT FRAMEWORK"
<linux-pm@vger.kernel.org>,
open list <linux-kernel@vger.kernel.org>,
"open list:CPUIDLE DRIVER - ARM PSCI"
<linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH v3 4/4] thermal: cpuidle: Register cpuidle cooling device
Date: Tue, 28 Apr 2020 16:31:40 +0100 [thread overview]
Message-ID: <db4eeecf-2126-e455-ef02-fc034c631e09@arm.com> (raw)
In-Reply-To: <20200414220837.9284-4-daniel.lezcano@linaro.org>
On 4/14/20 11:08 PM, 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/cpuidle-arm.c | 5 +++++
> drivers/cpuidle/cpuidle-psci.c | 5 +++++
> 2 files changed, 10 insertions(+)
>
> diff --git a/drivers/cpuidle/cpuidle-arm.c b/drivers/cpuidle/cpuidle-arm.c
> index 9e5156d39627..2406ac0ae134 100644
> --- a/drivers/cpuidle/cpuidle-arm.c
> +++ b/drivers/cpuidle/cpuidle-arm.c
> @@ -8,6 +8,7 @@
>
> #define pr_fmt(fmt) "CPUidle arm: " fmt
>
> +#include <linux/cpu_cooling.h>
> #include <linux/cpuidle.h>
> #include <linux/cpumask.h>
> #include <linux/cpu_pm.h>
> @@ -124,6 +125,10 @@ static int __init arm_idle_init_cpu(int cpu)
> if (ret)
> goto out_kfree_drv;
>
> + ret = cpuidle_cooling_register(drv);
> + if (ret)
> + pr_err("Failed to register the idle cooling device: %d\n", ret);
This and similar from cpuidle-psci.c might produce a lot of error log
entries. The 'return 0' below does not take into account that we failed
to register cpuidle cooling. Thus, I would rather ignore the return from
cpuidle_cooling_register and move this print into
cpuidle_cooling_register function, changing it also to debug level.
> +
> return 0;
>
> out_kfree_drv:
> diff --git a/drivers/cpuidle/cpuidle-psci.c b/drivers/cpuidle/cpuidle-psci.c
> index edd7a54ef0d3..8e805bff646f 100644
> --- a/drivers/cpuidle/cpuidle-psci.c
> +++ b/drivers/cpuidle/cpuidle-psci.c
> @@ -9,6 +9,7 @@
> #define pr_fmt(fmt) "CPUidle PSCI: " fmt
>
> #include <linux/cpuhotplug.h>
> +#include <linux/cpu_cooling.h>
> #include <linux/cpuidle.h>
> #include <linux/cpumask.h>
> #include <linux/cpu_pm.h>
> @@ -305,6 +306,10 @@ static int __init psci_idle_init_cpu(int cpu)
> if (ret)
> goto out_kfree_drv;
>
> + ret = cpuidle_cooling_register(drv);
> + if (ret)
> + pr_err("Failed to register the idle cooling device: %d\n", ret);
> +
The same here. I would change it into one line:
+ cpuidle_cooling_register(drv);
> return 0;
>
> out_kfree_drv:
>
Regards,
Lukasz
prev parent reply other threads:[~2020-04-28 15:31 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-14 22:08 [PATCH v3 1/4] powercap/drivers/idle_inject: Specify idle state max latency Daniel Lezcano
2020-04-14 22:08 ` [PATCH v3 2/4] dt-bindings: thermal: Add the idle cooling device Daniel Lezcano
2020-04-20 21:14 ` Rob Herring
2020-04-14 22:08 ` [PATCH v3 3/4] thermal/drivers/cpuidle_cooling: Change the registration function Daniel Lezcano
2020-04-28 15:20 ` Lukasz Luba
2020-04-28 15:30 ` Daniel Lezcano
2020-04-14 22:08 ` [PATCH v3 4/4] thermal: cpuidle: Register cpuidle cooling device Daniel Lezcano
2020-04-21 8:15 ` Daniel Lezcano
2020-04-27 16:50 ` Daniel Lezcano
2020-04-28 15:31 ` Lukasz Luba [this message]
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=db4eeecf-2126-e455-ef02-fc034c631e09@arm.com \
--to=lukasz.luba@arm.com \
--cc=amit.kucheria@verdurent.com \
--cc=daniel.lezcano@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=lorenzo.pieralisi@arm.com \
--cc=rjw@rjwysocki.net \
--cc=rui.zhang@intel.com \
--cc=sudeep.holla@arm.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome