Thermal: pid_thermal_gov: Fix passive polling stop issue
Jinyoung Park [Thu, 14 Mar 2013 06:28:41 +0000 (15:28 +0900)]
Fixed passive polling stop issue when old target state is not zero and
new target state is 0, even though zone temperature is higher than
passive trip temperature.

Bug 1200111

Change-Id: I7f9a1c371b3687a8cfcce47994a5fbe5291140a1
Signed-off-by: Jinyoung Park <jinyoungp@nvidia.com>
Reviewed-on: http://git-master/r/209448
Reviewed-by: Automatic_Commit_Validation_User
Tested-by: Diwakar Tundlam <dtundlam@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Diwakar Tundlam <dtundlam@nvidia.com>
Reviewed-by: Edward Riegelsberger <eriegels@nvidia.com>

drivers/thermal/pid_thermal_gov.c

index 1ae53e8..cce12d1 100644 (file)
@@ -335,18 +335,16 @@ static void pid_thermal_gov_stop(struct thermal_zone_device *tz)
 
 static void pid_thermal_gov_update_passive(struct thermal_zone_device *tz,
                                           enum thermal_trip_type trip_type,
-                                          unsigned long old_target,
-                                          unsigned long target)
+                                          unsigned long old,
+                                          unsigned long new)
 {
        if ((trip_type != THERMAL_TRIP_PASSIVE) &&
                        (trip_type != THERMAL_TRIPS_NONE))
                return;
 
-       if ((!old_target || old_target == THERMAL_NO_TARGET) &&
-                       (target && target != THERMAL_NO_TARGET))
+       if ((old == THERMAL_NO_TARGET) && (new != THERMAL_NO_TARGET))
                tz->passive++;
-       else if ((old_target && old_target != THERMAL_NO_TARGET) &&
-                       (!target || target == THERMAL_NO_TARGET))
+       else if ((old != THERMAL_NO_TARGET) && (new == THERMAL_NO_TARGET))
                tz->passive--;
 }