summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/thermal/gov_power_allocator.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/thermal/gov_power_allocator.c b/drivers/thermal/gov_power_allocator.c
index b29e21c56a4f..2e20085ed217 100644
--- a/drivers/thermal/gov_power_allocator.c
+++ b/drivers/thermal/gov_power_allocator.c
@@ -134,6 +134,7 @@ static void estimate_pid_constants(struct thermal_zone_device *tz,
int ret;
int switch_on_temp;
u32 temperature_threshold;
+ s32 k_i;
ret = tz->ops->get_trip_temp(tz, trip_switch_on, &switch_on_temp);
if (ret)
@@ -159,8 +160,11 @@ static void estimate_pid_constants(struct thermal_zone_device *tz,
tz->tzp->k_pu = int_to_frac(2 * sustainable_power) /
temperature_threshold;
- if (!tz->tzp->k_i || force)
- tz->tzp->k_i = int_to_frac(10) / 1000;
+ if (!tz->tzp->k_i || force) {
+ k_i = tz->tzp->k_pu / 10;
+ tz->tzp->k_i = k_i > 0 ? k_i : 1;
+ }
+
/*
* The default for k_d and integral_cutoff is 0, so we can
* leave them as they are.