]> Git Repo - linux.git/commit
thermal: core: Move passive polling management to the core
authorRafael J. Wysocki <[email protected]>
Tue, 30 Apr 2024 15:52:33 +0000 (17:52 +0200)
committerRafael J. Wysocki <[email protected]>
Tue, 30 Apr 2024 19:16:13 +0000 (21:16 +0200)
commit042a3d80f118821c9e0b4c25021e32e45efe9b3a
treeda0b679927c5ed73d459a4c6085a4315267f1576
parent202aa0d4bb532338cd27bcc64c60abc2987a2be7
thermal: core: Move passive polling management to the core

Passive polling is enabled by setting the 'passive' field in
struct thermal_zone_device to a positive value so long as the
'passive_delay_jiffies' field is greater than zero.  It causes
the thermal core to actively check the thermal zone temperature
periodically which in theory should be done after crossing a
passive trip point on the way up in order to allow governors to
react more rapidly to temperature changes and adjust mitigation
more precisely.

However, the 'passive' field in struct thermal_zone_device is currently
managed by governors which is quite problematic.  First of all, only
two governors, Step-Wise and Power Allocator, update that field at
all, so the other governors do not benefit from passive polling,
although in principle they should.  Moreover, if the zone governor is
changed from, say, Step-Wise to Fair-Share after 'passive' has been
incremented by the former, it is not going to be reset back to zero by
the latter even if the zone temperature falls down below all passive
trip points.

For this reason, make handle_thermal_trip() increment 'passive'
to enable passive polling for the given thermal zone whenever a
passive trip point is crossed on the way up and decrement it
whenever a passive trip point is crossed on the way down.  Also
remove the 'passive' field updates from governors and additionally
clear it in thermal_zone_device_init() to prevent passive polling
from being enabled after a system resume just beacuse it was enabled
before suspending the system.

Signed-off-by: Rafael J. Wysocki <[email protected]>
Reviewed-by: Lukasz Luba <[email protected]>
Tested-by: Lukasz Luba <[email protected]>
drivers/thermal/gov_power_allocator.c
drivers/thermal/gov_step_wise.c
drivers/thermal/thermal_core.c
This page took 0.055003 seconds and 4 git commands to generate.