All of lore.kernel.org
 help / color / mirror / Atom feed
From: "thermal-bot for Lukasz Luba" <tip-bot2@linutronix.de>
To: linux-pm@vger.kernel.org
Cc: Lukasz Luba <lukasz.luba@arm.com>,
	Daniel Lezcano <daniel.lezcano@linaro.org>,
	rui.zhang@intel.com, amitk@kernel.org
Subject: [thermal: thermal/next] thermal: power_allocator: Respect upper and lower bounds for cooling device
Date: Tue, 24 Nov 2020 09:36:44 -0000	[thread overview]
Message-ID: <160621060492.11115.4305995116543175135.tip-bot2@tip-bot2> (raw)
In-Reply-To: <20201015112441.4056-3-lukasz.luba@arm.com>

The following commit has been merged into the thermal/next branch of thermal:

Commit-ID:     8132df3a06a41823aa370dbb4ff08f48fa07f6df
Gitweb:        https://git.kernel.org/pub/scm/linux/kernel/git/thermal/linux.git//8132df3a06a41823aa370dbb4ff08f48fa07f6df
Author:        Lukasz Luba <lukasz.luba@arm.com>
AuthorDate:    Thu, 15 Oct 2020 12:24:39 +01:00
Committer:     Daniel Lezcano <daniel.lezcano@linaro.org>
CommitterDate: Tue, 27 Oct 2020 09:44:32 +01:00

thermal: power_allocator: Respect upper and lower bounds for cooling device

The thermal cooling device specified in DT might be instantiated for
a thermal zone trip point with a limited set of OPPs to operate on. This
configuration should be supported by Intelligent Power Allocation (IPA),
since it is a standard for other governors. Change the code and allow IPA
to get power value of lower and upper bound set for a given cooling
device.

Signed-off-by: Lukasz Luba <lukasz.luba@arm.com>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Link: https://lore.kernel.org/r/20201015112441.4056-3-lukasz.luba@arm.com
---
 drivers/thermal/gov_power_allocator.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/thermal/gov_power_allocator.c b/drivers/thermal/gov_power_allocator.c
index ab0be26..eb8c9af 100644
--- a/drivers/thermal/gov_power_allocator.c
+++ b/drivers/thermal/gov_power_allocator.c
@@ -96,7 +96,10 @@ static u32 estimate_sustainable_power(struct thermal_zone_device *tz)
 		if (instance->trip != params->trip_max_desired_temperature)
 			continue;
 
-		if (power_actor_get_min_power(cdev, &min_power))
+		if (!cdev_is_power_actor(cdev))
+			continue;
+
+		if (cdev->ops->state2power(cdev, instance->upper, &min_power))
 			continue;
 
 		sustainable_power += min_power;
@@ -398,7 +401,8 @@ static int allocate_power(struct thermal_zone_device *tz,
 
 		weighted_req_power[i] = frac_to_int(weight * req_power[i]);
 
-		if (power_actor_get_max_power(cdev, &max_power[i]))
+		if (cdev->ops->state2power(cdev, instance->lower,
+					   &max_power[i]))
 			continue;
 
 		total_req_power += req_power[i];

  reply	other threads:[~2020-11-24  9:36 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-15 11:24 [PATCH v2 0/4] Add upper and lower limits in IPA power budget calculation Lukasz Luba
2020-10-15 11:24 ` [PATCH v2 1/4] thermal: core: add upper and lower limits to power_actor_set_power Lukasz Luba
2020-10-15 11:24 ` [PATCH v2 2/4] thermal: power_allocator: respect upper and lower bounds for cooling device Lukasz Luba
2020-11-24  9:36   ` thermal-bot for Lukasz Luba [this message]
2020-10-15 11:24 ` [PATCH v2 3/4] thermal: core: remove unused functions in power actor section Lukasz Luba
2020-11-24  9:36   ` [thermal: thermal/next] thermal: core: Remove " thermal-bot for Lukasz Luba
2020-10-15 11:24 ` [PATCH v2 4/4] thermal: move power_actor_set_power into IPA Lukasz Luba
2020-11-24  9:36   ` [thermal: thermal/next] thermal: core: Move " thermal-bot for Lukasz Luba
2020-10-26 20:42 ` [PATCH v2 0/4] Add upper and lower limits in IPA power budget calculation Daniel Lezcano
2020-11-02  9:00   ` Lukasz Luba

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=160621060492.11115.4305995116543175135.tip-bot2@tip-bot2 \
    --to=tip-bot2@linutronix.de \
    --cc=amitk@kernel.org \
    --cc=daniel.lezcano@linaro.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=lukasz.luba@arm.com \
    --cc=rui.zhang@intel.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 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.