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

Commit e461aa5f authored by Junjie Wu's avatar Junjie Wu
Browse files

qcom-cpufreq: Initialize workqueue for all CPUs in sync



qcom-cpufreq use a per-cpu work to scale CPU frequency. For CPUs
in sync, only the first CPU that is plugged in has its work
initialized. When that CPU goes offline, it hands over policy
to another CPU, which doesn't have its work initialized. If CPU
scaling happens then, an uninitialized work will be queued onto
workqueue, causing a crash.

Initialize workqueue for all CPUs in sync in msm_cpufreq_init().

Change-Id: I4c3bc08182c4088de4a3675c47a8e0e10c8e4f47
Signed-off-by: default avatarJunjie Wu <junjiew@codeaurora.org>
parent 7197af4f
Loading
Loading
Loading
Loading
+7 −6
Original line number Diff line number Diff line
@@ -191,13 +191,14 @@ static int msm_cpufreq_init(struct cpufreq_policy *policy)
	 * CPUs that share same clock, and mark them as controlled by
	 * same policy.
	 */
	for_each_possible_cpu(cpu)
		if (cpu_clk[cpu] == cpu_clk[policy->cpu])
	for_each_possible_cpu(cpu) {
		if (cpu_clk[cpu] == cpu_clk[policy->cpu]) {
			cpumask_set_cpu(cpu, policy->cpus);

	cpu_work = &per_cpu(cpufreq_work, policy->cpu);
			cpu_work = &per_cpu(cpufreq_work, cpu);
			INIT_WORK(&cpu_work->work, set_cpu_work);
			init_completion(&cpu_work->complete);
		}
	}

	if (cpufreq_frequency_table_cpuinfo(policy, table)) {
#ifdef CONFIG_MSM_CPU_FREQ_SET_MIN_MAX