]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
thermal: gov_power_allocator: Allow binding without cooling devices
authorNikita Travkin <nikita@trvn.ru>
Wed, 3 Apr 2024 11:31:40 +0000 (16:31 +0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 10 Apr 2024 14:38:13 +0000 (16:38 +0200)
commit626bd679369458eac63b0a8a929fafc00d1cf9df
tree5b9b701693cc246640fb215cff86fd481103cc52
parent47b6af87610a7ba013ee8b0573ddafaf7ad3a7d3
thermal: gov_power_allocator: Allow binding without cooling devices

[ Upstream commit 1057c4c36ef8b236a2e28edef301da0801338c5f ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/thermal/gov_power_allocator.c