diff options
| author | mkarthik <mkarthik@nvidia.com> | 2020-06-17 08:01:11 -0400 |
|---|---|---|
| committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2020-09-15 11:39:29 -0400 |
| commit | f9d1658833bbd2dfd5b24bb8cfff4da88db658ce (patch) | |
| tree | c6ec514c8f0e7f8d1473e895790f3ab70c6d6607 /include/linux | |
| parent | 8d0f7dcdc17f692894c11684c8cfb672d6881492 (diff) | |
therm-fan-est: Add support for Tmargin to drive fan
Why?
Tmargin method of fan control allows multiple groups of
therma-fan-est devices temperatures to be considered for
the fan control algorithm/fan curve. The limitation of the
existing max temp algorithm in therm-fan-est driver is that
devices with different fan curves cannot be accomodated in
the driver. In case, there are multple fan curves, the device
which has the steepest curve wins the algoritm. Hence, taking
the temperatures as a reference from their respective critical
temperatures and using that value to drive the fan will help in
accomodating both the devices' fan curves.
How?
* Calculate the effective crit temp of all the thermal zones
during probe.
* In the polling cycles, calculate the effective temperatures
of the individual groups and use the tmargin formula to
calculate the current temperature.
* Since the Tmargin temp trip values are in reverse order, we
need to use the reverse order in the pwm-fan dt profile.
* The hysterysis is subtracted from the temp in cooling scenario
to avoid frequent switching at trip temps. Since the tmargin
trip values are taken in the decending order, hysterysis temps
in dt should be given as negative values.
Bug 200627962
Change-Id: Ideba4bfdb3d3306d1b4aff15093bcfac13d7bb86
Signed-off-by: Mantravadi Karthik <mkarthik@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2362354
Reviewed-by: automaticguardword <automaticguardword@nvidia.com>
Reviewed-by: Rajkumar Kasirajan <rkasirajan@nvidia.com>
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: Rajkumar Kasirajan <rkasirajan@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/therm_est.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/therm_est.h b/include/linux/therm_est.h index fa1ea7ffc..8b1786ea8 100644 --- a/include/linux/therm_est.h +++ b/include/linux/therm_est.h | |||
| @@ -235,6 +235,8 @@ struct therm_fan_estimator { | |||
| 235 | /* allow cooling device to turn off at higher temperature if sleep */ | 235 | /* allow cooling device to turn off at higher temperature if sleep */ |
| 236 | bool sleep_mode; | 236 | bool sleep_mode; |
| 237 | int nonsleep_hyst; | 237 | int nonsleep_hyst; |
| 238 | bool use_tmargin; | ||
| 239 | long crit_temp[MAX_SUBDEVICE_GROUP]; | ||
| 238 | 240 | ||
| 239 | bool is_continuous_gov; | 241 | bool is_continuous_gov; |
| 240 | }; | 242 | }; |
