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

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

Merge "drivers: cpu_cooling: Remove cooling list lock during post suspend handling"

parents be10f6c6 b7498c25
Loading
Loading
Loading
Loading
+3 −4
Original line number Diff line number Diff line
@@ -224,7 +224,7 @@ EXPORT_SYMBOL_GPL(cpufreq_cooling_get_level);
static int cpufreq_cooling_pm_notify(struct notifier_block *nb,
				unsigned long mode, void *_unused)
{
	struct cpufreq_cooling_device *cpufreq_dev;
	struct cpufreq_cooling_device *cpufreq_dev, *next;
	unsigned int cpu;

	switch (mode) {
@@ -236,8 +236,8 @@ static int cpufreq_cooling_pm_notify(struct notifier_block *nb,
	case PM_POST_HIBERNATION:
	case PM_POST_RESTORE:
	case PM_POST_SUSPEND:
		mutex_lock(&cooling_list_lock);
		list_for_each_entry(cpufreq_dev, &cpufreq_dev_list, node) {
		list_for_each_entry_safe(cpufreq_dev, next, &cpufreq_dev_list,
						node) {
			mutex_lock(&core_isolate_lock);
			if (cpufreq_dev->cpufreq_state ==
				cpufreq_dev->max_level) {
@@ -259,7 +259,6 @@ static int cpufreq_cooling_pm_notify(struct notifier_block *nb,
			}
			mutex_unlock(&core_isolate_lock);
		}
		mutex_unlock(&cooling_list_lock);

		atomic_set(&in_suspend, 0);
		break;
+18 −7
Original line number Diff line number Diff line
@@ -62,19 +62,30 @@ static void thermal_zone_trip_update(struct thermal_zone_device *tz, int trip)
		dev_dbg(&instance->cdev->device, "old_target=%d, target=%d\n",
					old_target, (int)instance->target);

		if (old_target == instance->target)
		if (instance->initialized && old_target == instance->target)
			continue;

		if (!instance->initialized) {
			if (instance->target != THERMAL_NO_TARGET) {
				trace_thermal_zone_trip(tz, trip, trip_type,
							true);
				tz->passive += 1;
			}
		} else {
			if (old_target == THERMAL_NO_TARGET &&
				instance->target != THERMAL_NO_TARGET) {
			trace_thermal_zone_trip(tz, trip, trip_type, true);
				trace_thermal_zone_trip(tz, trip, trip_type,
							true);
				tz->passive += 1;
			} else if (old_target != THERMAL_NO_TARGET &&
				instance->target == THERMAL_NO_TARGET) {
			trace_thermal_zone_trip(tz, trip, trip_type, false);
				trace_thermal_zone_trip(tz, trip, trip_type,
							false);
				tz->passive -= 1;
			}
		}

		instance->initialized = true;
		instance->cdev->updated = false; /* cdev needs update */
	}

+20 −10
Original line number Diff line number Diff line
@@ -190,16 +190,26 @@ static void thermal_zone_trip_update(struct thermal_zone_device *tz, int trip)
		if (instance->initialized && old_target == instance->target)
			continue;

		if (!instance->initialized) {
			if (instance->target != THERMAL_NO_TARGET) {
				trace_thermal_zone_trip(tz, trip, trip_type,
							true);
				update_passive_instance(tz, trip_type, 1);
			}
		} else {
			/* Activate a passive thermal instance */
			if (old_target == THERMAL_NO_TARGET &&
				instance->target != THERMAL_NO_TARGET) {
				trace_thermal_zone_trip(tz, trip, trip_type,
							true);
				update_passive_instance(tz, trip_type, 1);
			trace_thermal_zone_trip(tz, trip, trip_type, true);
			/* Deactivate a passive thermal instance */
			} else if (old_target != THERMAL_NO_TARGET &&
				instance->target == THERMAL_NO_TARGET) {
				trace_thermal_zone_trip(tz, trip, trip_type,
							false);
				update_passive_instance(tz, trip_type, -1);
			trace_thermal_zone_trip(tz, trip, trip_type, false);
			}
		}

		instance->initialized = true;