]> www.infradead.org Git - users/jedix/linux-maple.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)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Thu, 5 Sep 2024 10:32:54 +0000 (12:32 +0200)
commit15cb56bd529868d9242b22812fc69bd144bfdc94
tree55970bbdf3a0e2119e44e7d21796c48598f90b12
parent874b6476fa888e79e41daf7653384c8d70927b90
thermal: gov_bang_bang: Adjust states of all uninitialized instances

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
drivers/thermal/gov_bang_bang.c