Skip to content

Commit 04bf1fe

Browse files
thierryredingdlezcano
authored andcommitted
thermal: Allow selecting the bang-bang governor as default
For many setups the bang-bang governor is exactly what we want. Many ARM SoC-based devices use fans to cool down the entire SoC and that works well only with the bang-bang governor because it uses the hysteresis in order to let the fan run for a while to cool the SoC down below the trip point before switching it off again. The step-wise governor will behave strangely in these situations. It doesn't use the hysteresis, so it can lead to situations where the fan is turned on for only a very brief period and then is switched back off, only to get switched back on again very quickly because the SoC hasn't cooled down very much. Signed-off-by: Thierry Reding <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Daniel Lezcano <[email protected]>
1 parent 598e1af commit 04bf1fe

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

drivers/thermal/Kconfig

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,14 @@ config THERMAL_DEFAULT_GOV_POWER_ALLOCATOR
130130
system and device power allocation. This governor can only
131131
operate on cooling devices that implement the power API.
132132

133+
config THERMAL_DEFAULT_GOV_BANG_BANG
134+
bool "bang_bang"
135+
depends on THERMAL_GOV_BANG_BANG
136+
help
137+
Use the bang_bang governor as default. This throttles the
138+
devices one step at the time, taking into account the trip
139+
point hysteresis.
140+
133141
endchoice
134142

135143
config THERMAL_GOV_FAIR_SHARE

drivers/thermal/thermal_core.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323
#define DEFAULT_THERMAL_GOVERNOR "user_space"
2424
#elif defined(CONFIG_THERMAL_DEFAULT_GOV_POWER_ALLOCATOR)
2525
#define DEFAULT_THERMAL_GOVERNOR "power_allocator"
26+
#elif defined(CONFIG_THERMAL_DEFAULT_GOV_BANG_BANG)
27+
#define DEFAULT_THERMAL_GOVERNOR "bang_bang"
2628
#endif
2729

2830
/* Initial state of a cooling device during binding */

0 commit comments

Comments
 (0)