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

Commit 4d1f3a5b authored by Rafael J. Wysocki's avatar Rafael J. Wysocki
Browse files

cpufreq: Do not update related_cpus on every policy activation



The related_cpus mask includes CPUs whose cpufreq_cpu_data per-CPU
pointers have been set the the given policy.  Since those pointers
are only set at the policy creation time and unset when the policy
is deleted, the related_cpus should not be updated between those
two operations.

For this reason, avoid updating it whenever the first of the
"related" CPUs goes online.

Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
parent d9612a49
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -1251,12 +1251,12 @@ static int cpufreq_add_dev(struct device *dev, struct subsys_interface *sif)

	down_write(&policy->rwsem);

	/* related cpus should atleast have policy->cpus */
	if (!recover_policy) {
		/* related_cpus should at least include policy->cpus. */
		cpumask_or(policy->related_cpus, policy->related_cpus, policy->cpus);

	/* Remember which CPUs have been present at the policy creation time. */
	if (!recover_policy)
		/* Remember CPUs present at the policy creation time. */
		cpumask_and(policy->real_cpus, policy->cpus, cpu_present_mask);
	}

	/*
	 * affected cpus must always be the one, which are online. We aren't