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

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

Merge "cpufreq: Avoid using inactive policies"

parents 8d9fcbe4 803ca5d9
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -1654,7 +1654,10 @@ unsigned int cpufreq_get(unsigned int cpu)

	if (policy) {
		down_read(&policy->rwsem);

		if (!policy_is_inactive(policy))
			ret_freq = __cpufreq_get(policy);

		up_read(&policy->rwsem);

		cpufreq_cpu_put(policy);
@@ -2397,6 +2400,11 @@ int cpufreq_update_policy(unsigned int cpu)

	down_write(&policy->rwsem);

	if (policy_is_inactive(policy)) {
		ret = -ENODEV;
		goto unlock;
	}

	pr_debug("updating policy for CPU %u\n", cpu);
	memcpy(&new_policy, policy, sizeof(*policy));
	new_policy.min = policy->user_policy.min;