Skip to content

Commit

Permalink
thermal: gov_power_allocator: Allow binding without cooling devices
Browse files Browse the repository at this point in the history
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: 912e97c ("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>
  • Loading branch information
Nikita Travkin authored and Rafael J. Wysocki committed Apr 3, 2024
1 parent 39cd87c commit 1057c4c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/thermal/gov_power_allocator.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 1057c4c

Please sign in to comment.