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

Commit e4789198 authored by Vikram Mulukutla's avatar Vikram Mulukutla
Browse files

qcom: clock-cpu-8994: Don't set CPU clocks to HANDOFF_ENABLED_CLK



Setting the cluster clock's refcount to 1 during handoff will cause
the clock framework's late_initcall_sync logic to decrement
the refcount to zero - if all the CPUs in the cluster are either
power collapsed or hotplugged out before late_initcall_sync.

Since the cluster clock muxes cannot be switched when the cluster
is in power collapse, it is wrong for a context outside of the
hotplug notifiers or the low power mode driver to decrement
the refcount on the cluster clocks to zero; this will cause a
mux switch without any guarantee that the cluster is not power
collapsed at that point.

Therefore, always return HANDOFF_DISABLED_CLK for the cluster
clocks. The probe() function will increment the cluster clock
refcount for each online CPU either way.

Change-Id: I615e44a006d249eb8f0f548fc7ebca9f293f159c
Signed-off-by: default avatarVikram Mulukutla <markivx@codeaurora.org>
parent b5a909ab
Loading
Loading
Loading
Loading
+0 −12
Original line number Diff line number Diff line
@@ -591,22 +591,10 @@ static inline struct cpu_clk_8994 *to_cpu_clk_8994(struct clk *c)
	return container_of(c, struct cpu_clk_8994, c);
}

static struct clk *logical_cpu_to_clk(int cpu);

static enum handoff cpu_clk_8994_handoff(struct clk *c)
{
	int cpu;

	c->rate = clk_get_rate(c->parent);

	/*
	 * Don't unnecessarily turn on the parents for an offline CPU and
	 * then have them turned off at late init.
	 */
	for_each_online_cpu(cpu) {
		if (logical_cpu_to_clk(cpu) == c)
			return HANDOFF_ENABLED_CLK;
	}
	return HANDOFF_DISABLED_CLK;
}