aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNikita Travkin <nikita@trvn.ru>2024-04-03 16:31:40 +0500
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2024-04-03 16:32:14 +0200
commit1057c4c36ef8b236a2e28edef301da0801338c5f (patch)
tree95f29667ea69cca2e2bcebabd4438301b4df909f
parent39cd87c4eb2b893354f3b850f916353f2658ae6f (diff)
downloadregulator-1057c4c36ef8b236a2e28edef301da0801338c5f.tar.gz
thermal: gov_power_allocator: Allow binding without cooling devices
IPA was recently refactored to split out memory allocation into a separate funciton. That funciton was made to return -EINVAL if there is zero power_actors and thus no memory to allocate. This causes IPA to fail probing when the thermal zone has no attached cooling devices. Since cooling devices can attach after the thermal zone is created and the governer is attached to it, failing probe due to the lack of cooling devices is incorrect. Change the allocate_actors_buffer() to return success when there is no cooling devices present. Fixes: 912e97c67cc3 ("thermal: gov_power_allocator: Move memory allocation out of throttle()") Signed-off-by: Nikita Travkin <nikita@trvn.ru> Reviewed-by: Lukasz Luba <lukasz.luba@arm.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
-rw-r--r--drivers/thermal/gov_power_allocator.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/thermal/gov_power_allocator.c b/drivers/thermal/gov_power_allocator.c
index 1b17dc4c219cc9..ec637071ef1fad 100644
--- a/drivers/thermal/gov_power_allocator.c
+++ b/drivers/thermal/gov_power_allocator.c
@@ -606,7 +606,7 @@ static int allocate_actors_buffer(struct power_allocator_params *params,
/* There might be no cooling devices yet. */
if (!num_actors) {
- ret = -EINVAL;
+ ret = 0;
goto clean_state;
}