Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3397343b authored by Manaf Meethalavalappu Pallikunhi's avatar Manaf Meethalavalappu Pallikunhi Committed by Gerrit - the friendly Code Review server
Browse files

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: default avatarManaf Meethalavalappu Pallikunhi <manafm@codeaurora.org>
parent c6d2596d
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -637,6 +637,7 @@ static void handle_thermal_trip(struct thermal_zone_device *tz,
	struct thermal_zone_device *zone;
	struct __thermal_zone *data = tz->devdata;
	struct list_head *head;
	bool notify = false;

	head = &data->senps->first_tz;
	list_for_each_entry(data, head, list) {
@@ -649,10 +650,19 @@ static void handle_thermal_trip(struct thermal_zone_device *tz,
		} 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(tz, THERMAL_EVENT_UNSPECIFIED,
				trip_temp);
}

/*