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

Commit 3be793c5 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "thermal-core: Add a lock to tz_notify_trip()"

parents ebf056a1 383ac33a
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -292,7 +292,7 @@ static void sensor_update_work(struct work_struct *work)
	mutex_unlock(&sensor->lock);
}

/* May be called in an interrupt context.
/* Should not be called in an interrupt context.
 * Do NOT call sensor_set_trip from this function
 */
int thermal_sensor_trip(struct thermal_zone_device *tz,
@@ -308,6 +308,8 @@ int thermal_sensor_trip(struct thermal_zone_device *tz,
	if (list_empty(&tz->sensor.threshold_list))
		return 0;

	mutex_lock(&tz->sensor.lock);

	list_for_each_entry_safe(pos, var, &tz->sensor.threshold_list, list) {
		if ((pos->trip != trip) || (!pos->active))
			continue;
@@ -326,6 +328,8 @@ int thermal_sensor_trip(struct thermal_zone_device *tz,
		}
	}

	mutex_unlock(&tz->sensor.lock);

	schedule_work(&tz->sensor.work);

	return ret;