]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
thermal: gov_bang_bang: Adjust states of all uninitialized instances
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Mon, 26 Aug 2024 16:23:49 +0000 (18:23 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 4 Oct 2024 14:32:25 +0000 (16:32 +0200)
commit43ebb3039527ad3ba68c4118b935028015462482
tree19ae8a0a24ba96bfa9bf1c5f9e731078ca3e0032
parent9d06c6b2aee7d689a3c0f0ab88432aa2c903a1f4
thermal: gov_bang_bang: Adjust states of all uninitialized instances

[ Upstream commit 15cb56bd529868d9242b22812fc69bd144bfdc94 ]

If a cooling device is registered after a thermal zone it should be
bound to and the trip point it should be bound to has already been
crossed by the zone temperature on the way up, the cooling device's
state may need to be adjusted, but the Bang-bang governor will not
do that because its .manage() callback only looks at thermal instances
for trip points whose thresholds are below or at the zone temperature.

Address this by updating bang_bang_manage() to look at all of the
uninitialized thermal instances and setting their target states in
accordance with the position of the zone temperature with respect to
the threshold of the given trip point.

Fixes: 5f64b4a1ab1b ("thermal: gov_bang_bang: Add .manage() callback")
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Reviewed-by: Lukasz Luba <lukasz.luba@arm.com>
Link: https://patch.msgid.link/6103874.lOV4Wx5bFT@rjwysocki.net
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/thermal/gov_bang_bang.c