msm: pm: Add support for System PC with multiple online cores.
The current power management code supports System PC during idle only on
the last online core. Rearchitect power management pm code to support
System PC when multiple cores are online.
The existing PM code relies on a levels table to determine the various
sleep modes including the system sleep states. Splitting them into cpu
and system specific levels is a more appropriate representation of the
existing system. As a part of this rearchitecture, the decision to enter
a low power mode is made within lpm_levels module.
To this effect, the lpm_levels directly registers with the cpuidle
framework instead of relying on a glue msm-cpuidle driver. The
functionality of the cpuidle driver was limited to calling into a pm
driver and without providing any additional functionality and is
encapsulated by the lpm-levels driver.
When more than one core is online, the current model prevents 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 sets a cpumask. The last core
to enter the deepest sleep mode will acquire a lock and will be
responsible for configuring the system low power modes. The last core
going down will configure the system wide resources with the lock held
to prevent race with another core waking up around the same time.
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. Also it should be noted power mode is significantly
lower than what was used for System PC with earlier representation. This
is because the cpu modes represent the latency associated with entering
a given CPU mode only and residency of the system modes are reflected in
the corresponding system level.
Change-Id: I474cc85c6220473fdaa87e14e3b0a199e95d7eb7
Signed-off-by:
Mahesh Sivasubramanian <msivasub@codeaurora.org>
Loading
Please register or sign in to comment