msm: lpm_levels: Support for RPM PC on all cores
When more than one core is online, the current model prevent entering
idle power collapse on all cores and the deepest sleep mode that a
cpu could enter is standalone power collapse. To achieve better power
savings when several cores are online all the time, it is important for
multiple cores to enter a deeper system sleep state by configuring L2
and RPM.
Each core entering the deepest sleep mode increments a counter. The
last core to enter the deepest sleep mode will acquire a lock and will
be responsible for configuring the system low power mode. cpus. The
last core going down will configure the system wide resources with the
lock held. If a core were to wakeup during this time, it would have to
wait for the lock to be released before it can continue to resume. The
last core releases the lock after configuring the system resources at
which point, the core that resumed from power collapse would reset the
system resources before continuing to run to ensure that the shared
resources are programmed for a safe state.
With this change the idle PC becomes more of a soft state where each
core identifies that its safe to enter a system sleep state. The
decision to enter a system sleep mode is based on the next wakeup event
across all cores. With not all cores encoutering latency associated with
system sleep modes, the residency of idle PC mode will be lower than
what it has been previously acheived. However, the residency of the
system sleep states should be unaffected.
Each core as its power collapsed disables the HFPLL and switches to
GFPLL in the event of a power collapse. During this time, each cores
removes its vote to keep L2 enabled. To ensure that there are enough
votes for keep L2 on, set the number of L2 votes to number of online
cpus in cpufreq.c
Change-Id: If6a8e181bdb9c7bae8066fb804de13caa48bad3b
Signed-off-by: Mahesh Sivasubramanian <msivasub@codeaurora.org>
8 files changed