Commit 5a623db8 authored by Vikram Mulukutla's avatar Vikram Mulukutla Committed by Gerrit - the friendly Code Review server
Browse files

msm: acpuclock-krait: Pre-emptively vote for the L2 HFPLL regulators



It is necessary that the L2 level computation and the setting
of the L2 rate happen atomically, so that the computed level
is still valid when the L2 rate is set. A spinlock protected
critical section is needed for these operations. However, the
votes for the HFPLLs necessitate invocation of the RPM
regulator APIs from a non-atomic context.

To solve this, we must first note that the problem only exists
when:
1. The L2 frequency is being switched away from an HFPLL source
   to a non-HFPLL source, or
   the L2 frequency is being switched away from a non-HFPLL
   source to an HFPLL source.
			--AND--
2. The CPU frequency switch (the cause of the L2 switch) is
   being performed as a result of cpufreq invoking the switch or
   hotplug onlining/offlining a core, since HFPLL regulator
   voting does not take place in the power-collapse and resume
   paths.

The solution is to pre-emptively vote for the L2 HFPLL regulators
if the target CPU frequency's required L2 level is sourced off of
an HFPLL. These votes are only removed after the spinlock
protected critical section completes, and only if the previous
CPU frequency's required L2 level was already sourced off of an
HFPLL source.

One further optimization is to disable only pre-emption, and
not interrupts in the afore-mentioned critical section.

Change-Id: I7b01f274f773ce513300ed3e4b074bae63e84c64
Signed-off-by: default avatarVikram Mulukutla <markivx@codeaurora.org>
parent 81796c02
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment