From: Lukasz Luba <lukasz.luba@arm.com>
To: linux-kernel@vger.kernel.org, daniel.lezcano@linaro.org,
rafael@kernel.org
Cc: linux-pm@vger.kernel.org, rui.zhang@intel.com, lukasz.luba@arm.com
Subject: [PATCH 3/7] thermal: gov_power_allocator: Check the cooling devices only for trip_max
Date: Wed, 25 Oct 2023 20:22:21 +0100 [thread overview]
Message-ID: <20231025192225.468228-4-lukasz.luba@arm.com> (raw)
In-Reply-To: <20231025192225.468228-1-lukasz.luba@arm.com>
The throttling logic takes care only for the last passive trip point and
attached cooling devices to it. Therefore, there is no need to bail out if
other trip points have a cooling device which is not a supported by IPA.
Check the cooling devices only for the 'trip_max' during the binding.
Signed-off-by: Lukasz Luba <lukasz.luba@arm.com>
---
drivers/thermal/gov_power_allocator.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/drivers/thermal/gov_power_allocator.c b/drivers/thermal/gov_power_allocator.c
index 0dfc5b5ab5235..4b9ef04577a9a 100644
--- a/drivers/thermal/gov_power_allocator.c
+++ b/drivers/thermal/gov_power_allocator.c
@@ -578,6 +578,7 @@ static void allow_maximum_power(struct thermal_zone_device *tz, bool update)
* check_power_actors() - Check all cooling devices and warn when they are
* not power actors
* @tz: thermal zone to operate on
+ * @params: power allocator private data
*
* Check all cooling devices in the @tz and warn every time they are missing
* power actor API. The warning should help to investigate the issue, which
@@ -586,12 +587,16 @@ static void allow_maximum_power(struct thermal_zone_device *tz, bool update)
* Return: 0 on success, -EINVAL if any cooling device does not implement
* the power actor API.
*/
-static int check_power_actors(struct thermal_zone_device *tz)
+static int check_power_actors(struct thermal_zone_device *tz,
+ struct power_allocator_params *params)
{
struct thermal_instance *instance;
int ret = 0;
list_for_each_entry(instance, &tz->thermal_instances, tz_node) {
+ if (instance->trip != params->trip_max)
+ continue;
+
if (!cdev_is_power_actor(instance->cdev)) {
dev_warn(&tz->device, "power_allocator: %s is not a power actor\n",
instance->cdev->type);
@@ -628,7 +633,7 @@ static int power_allocator_bind(struct thermal_zone_device *tz)
return -EINVAL;
}
- ret = check_power_actors(tz);
+ ret = check_power_actors(tz, params);
if (ret) {
dev_warn(&tz->device, "power_allocator: binding failed\n");
kfree(params);
--
2.25.1
next prev parent reply other threads:[~2023-10-25 19:21 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-25 19:22 [PATCH 0/7] Minor cleanup for thermal gov power allocator Lukasz Luba
2023-10-25 19:22 ` [PATCH 1/7] thermal: gov_power_allocator: Rename trip_max_desired_temperature Lukasz Luba
2023-10-25 19:22 ` [PATCH 2/7] thermal: gov_power_allocator: Setup trip points earlier Lukasz Luba
2023-10-25 19:22 ` Lukasz Luba [this message]
2023-10-25 19:22 ` [PATCH 4/7] thermal: gov_power_allocator: Rearrange the order of variables Lukasz Luba
2023-10-25 19:22 ` [PATCH 5/7] thermal: gov_power_allocator: Use shorter variable when possible Lukasz Luba
2023-10-25 19:22 ` [PATCH 6/7] thermal: gov_power_allocator: Remove unneeded local variables Lukasz Luba
2023-10-25 19:22 ` [PATCH 7/7] thermal: gov_power_allocator: Clean needed variables at the beginning Lukasz Luba
2023-10-26 8:54 ` [PATCH 0/7] Minor cleanup for thermal gov power allocator Rafael J. Wysocki
2023-10-26 12:22 ` Lukasz Luba
2023-11-23 15:19 ` Lukasz Luba
2023-11-23 19:50 ` Rafael J. Wysocki
2023-11-24 7:45 ` Lukasz Luba
2023-11-28 15:17 ` Rafael J. Wysocki
2023-11-28 15:32 ` 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=20231025192225.468228-4-lukasz.luba@arm.com \
--to=lukasz.luba@arm.com \
--cc=daniel.lezcano@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=rafael@kernel.org \
--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