drivers: thermal: notify at least one thermal zone if no trips are violated

During any sensor threshold notification, the of-thermal framework
checks whether any trip of each thermal zone for that sensor is
violated or not. It requests thermal zone re-evaluation only for
those thermal zones those trip is violated. If trips are violated
for none of thermal zones due to some reason, then of-thermal ignores
that sensor notification and it leads to no active trip threshold
for that sensor forever.

Notify and request thermal zone re-evaluation for at least one thermal
zone for that sensor if trips are violated for none in of-thermal.
It makes sure that for every sensor notification, thermal zone
aggregate and set next active trip.

Change-Id: If9955977fe32929d853815ddb9408385291b3c58
Signed-off-by: Manaf Meethalavalappu Pallikunhi <manafm@codeaurora.org>
This commit is contained in:
Manaf Meethalavalappu Pallikunhi 2020-08-31 22:18:52 +05:30
commit 9c1e47be30

View file

@ -732,6 +732,7 @@ static void handle_thermal_trip(struct device *dev,
struct __thermal_zone *data = tzd->devdata;
int idx = 0;
struct __sensor_param *sens_param = NULL;
bool notify = false;
idx = find_sensor_index(dev, data);
if (idx < 0)
@ -750,10 +751,19 @@ static void handle_thermal_trip(struct device *dev,
} else {
if (!of_thermal_is_trips_triggered(zone, trip_temp))
continue;
notify = true;
thermal_zone_device_update_temp(zone,
THERMAL_EVENT_UNSPECIFIED, trip_temp);
}
}
/*
* It is better to notify at least one thermal zone if trip is violated
* for none.
*/
if (temp_valid && !notify)
thermal_zone_device_update_temp(tzd, THERMAL_EVENT_UNSPECIFIED,
trip_temp);
}
/*