linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Daniel Lezcano <daniel.lezcano@linaro.org>
To: daniel.lezcano@linaro.org, rui.zhang@intel.com
Cc: lukasz.luba@arm.com, "Rafael J. Wysocki" <rjw@rjwysocki.net>,
	Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>,
	Sudeep Holla <sudeep.holla@arm.com>,
	linux-pm@vger.kernel.org (open list:CPU IDLE TIME MANAGEMENT
	FRAMEWORK), linux-kernel@vger.kernel.org (open list),
	linux-arm-kernel@lists.infradead.org (open list:CPUIDLE DRIVER -
	ARM PSCI)
Subject: [PATCH v4 4/4] thermal: cpuidle: Register cpuidle cooling device
Date: Wed, 29 Apr 2020 12:36:42 +0200	[thread overview]
Message-ID: <20200429103644.5492-4-daniel.lezcano@linaro.org> (raw)
In-Reply-To: <20200429103644.5492-1-daniel.lezcano@linaro.org>

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>
---
 - V4:
   - Do not check the return value as the function does no longer return one
---
 drivers/cpuidle/cpuidle-arm.c  | 3 +++
 drivers/cpuidle/cpuidle-psci.c | 3 +++
 2 files changed, 6 insertions(+)

diff --git a/drivers/cpuidle/cpuidle-arm.c b/drivers/cpuidle/cpuidle-arm.c
index 9e5156d39627..8c758920d699 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,8 @@ static int __init arm_idle_init_cpu(int cpu)
 	if (ret)
 		goto out_kfree_drv;
 
+	cpuidle_cooling_register(drv);
+
 	return 0;
 
 out_kfree_drv:
diff --git a/drivers/cpuidle/cpuidle-psci.c b/drivers/cpuidle/cpuidle-psci.c
index bae9140a65a5..1f38e0dfc9b2 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>
@@ -313,6 +314,8 @@ static int __init psci_idle_init_cpu(int cpu)
 	if (ret)
 		goto out_kfree_drv;
 
+	cpuidle_cooling_register(drv);
+
 	return 0;
 
 out_kfree_drv:
-- 
2.17.1


  parent reply	other threads:[~2020-04-29 10:37 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-29 10:36 [PATCH v4 1/4] powercap/drivers/idle_inject: Specify idle state max latency Daniel Lezcano
2020-04-29 10:36 ` [PATCH v4 2/4] dt-bindings: thermal: Add the idle cooling device Daniel Lezcano
2020-05-06  9:57   ` Amit Kucheria
2020-04-29 10:36 ` [PATCH v4 3/4] thermal/drivers/cpuidle_cooling: Change the registration function Daniel Lezcano
2020-04-29 20:00   ` Lukasz Luba
2020-05-06  9:57   ` Amit Kucheria
2020-04-29 10:36 ` Daniel Lezcano [this message]
2020-04-29 20:02   ` [PATCH v4 4/4] thermal: cpuidle: Register cpuidle cooling device Lukasz Luba
2020-04-29 21:01     ` Daniel Lezcano
2020-05-04 18:00       ` Daniel Lezcano
2020-05-15  9:58         ` Sudeep Holla
2020-05-15 11:03           ` Daniel Lezcano
2020-05-06  9:57   ` Amit Kucheria
2020-06-15 11:25   ` Ulf Hansson
2020-05-06  9:56 ` [PATCH v4 1/4] powercap/drivers/idle_inject: Specify idle state max latency Amit Kucheria

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=20200429103644.5492-4-daniel.lezcano@linaro.org \
    --to=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=lukasz.luba@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;
as well as URLs for NNTP newsgroup(s).