From: Lukasz Luba <lukasz.luba@arm.com>
To: linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org
Cc: daniel.lezcano@linaro.org, amitk@kernel.org,
Dietmar.Eggemann@arm.com, lukasz.luba@arm.com,
michael.kao@mediatek.com, rui.zhang@intel.com
Subject: [PATCH 1/3] thermal: power_allocator: respect upper and lower bounds for cooling device
Date: Wed, 7 Oct 2020 13:22:54 +0100 [thread overview]
Message-ID: <20201007122256.28080-2-lukasz.luba@arm.com> (raw)
In-Reply-To: <20201007122256.28080-1-lukasz.luba@arm.com>
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>
---
drivers/thermal/gov_power_allocator.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/thermal/gov_power_allocator.c b/drivers/thermal/gov_power_allocator.c
index dd59085f38f5..f9ee7787b325 100644
--- a/drivers/thermal/gov_power_allocator.c
+++ b/drivers/thermal/gov_power_allocator.c
@@ -96,7 +96,8 @@ 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, tz, &min_power))
+ if (cdev->ops->state2power(cdev, tz, instance->upper,
+ &min_power))
continue;
sustainable_power += min_power;
@@ -404,7 +405,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, tz, &max_power[i]))
+ if (cdev->ops->state2power(cdev, tz, instance->lower,
+ &max_power[i]))
continue;
total_req_power += req_power[i];
--
2.17.1
next prev parent reply other threads:[~2020-10-07 12:23 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-07 12:22 [PATCH 0/3] Add upper and lower limits in IPA power budget calculation Lukasz Luba
2020-10-07 12:22 ` Lukasz Luba [this message]
2020-10-14 12:31 ` [PATCH 1/3] thermal: power_allocator: respect upper and lower bounds for cooling device Daniel Lezcano
2020-10-14 16:05 ` Lukasz Luba
2020-10-07 12:22 ` [PATCH 2/3] thermal: core: remove unused functions in power actor section Lukasz Luba
2020-10-07 12:22 ` [PATCH 3/3] thermal: move power_actor_set_power into IPA Lukasz Luba
2020-10-14 12:45 ` [PATCH 0/3] Add upper and lower limits in IPA power budget calculation Daniel Lezcano
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=20201007122256.28080-2-lukasz.luba@arm.com \
--to=lukasz.luba@arm.com \
--cc=Dietmar.Eggemann@arm.com \
--cc=amitk@kernel.org \
--cc=daniel.lezcano@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=michael.kao@mediatek.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®