linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH RFC v2 00/16] PM / Domains: Generic PM domains for CPUs
@ 2015-06-27  3:02 Lina Iyer
  2015-06-27  3:02 ` [PATCH RFC v2 01/16] PM / Domains: Allocate memory outside domain locks Lina Iyer
                   ` (15 more replies)
  0 siblings, 16 replies; 30+ messages in thread
From: Lina Iyer @ 2015-06-27  3:02 UTC (permalink / raw)
  To: linux-arm-kernel

Changes since v1 [1]:

- Address review comments on v1.
- Incorporate Kevin's arch/arm/domain.c changes
- Drop drivers/base/power/cpu_domain.c 
- Rebase on top of linux-next (to date)
- Reference implemantation added.

This patchset fashions CPU clusters as generic PM domains. CPUs in most new
SOCs are grouped together as a cluster, along with some supporting hardware,
GIC, L2 caches etc. When all these devices in a cluster is powered off, the
power domain may also be powered off. 

GenPD framework provides the necessary backend to build a cluster hierarchy
through devices, domains and nested domains. When devices and sub-domains of a
genpd are suspended, the genpd may also be suspended and resumed before the
first of the devices resumes. This works well for most devices and domains.
However, not all devices operate in a process context. Devices that suspend and
resume when IRQs are disabled, are defined as IRQ safe devices and domains that
have IRQ safe devices are never powered off. The reason being, genpd uses
mutexes to lock domains and IRQ safe devices may operate in atomic contexts,
therefore cannot sleep. So even when all the devices are suspended, the domain
remains powered on.

Since CPUIdle frameworks calls the CPU's idle functions with IRQs disabled, the
CPU devices have to be IRQ safe. A cluster fashioned as genpd be attached to
IRQ safe CPU devices and possibly other devices that may or may not be IRQ
safe. However, even when all these devices are suspended, the genpd would never
be powered off. This is a significant part of the cluster's idle power
consumption.

These patches attempt to save some runtime idle power of CPU clusters by
allowing the genpd to suspend even when the attached devices are IRQ safe. The
approach here is simple, allow genpd domains to specify the type of locking the
domain would use. A genpd that can suspend and resume in an IRQ safe context,
would initialize a spinlock as the genpd lock instead of a mutex. Therefore,
IRQ safe devices may initiate a genpd suspend when the last active device goes
idle. In a CPU domain, the last CPU powering down, may now program the domain
hardware to suspend, when the CPU enters idle. Thus when all the CPUs, caches,
peripheral cluster hardware are in idle, the cluster domain would also be in a
low power state.

These patches also bring in a generalized way to represent CPU clusters on an
ARM platform. Platform drivers specify the CPU domain providers in their DT and
a genpd is initialized for every domain provider specified for the CPU.
Optionally, the platform may register their callback to perform SoC specific
functions when the domains are suspended/resumed. Currently, only CPU devices
are attached to the CPU genpd by default. Devices representing L2, GIC,
peripheral hardware that depend on the PM domain, may also be attached to the
genpd in the future.

This RFC is based on Ulf's clean up of genpd intermediate states [2] and
Kevin's WIP on generic PM domains for ARM CPU cluster. CPU domain definition
for the QCOM DB platform is provided as reference (patch 11/16 onwards).

Thanks,
Lina

[1]. http://www.spinics.net/lists/arm-kernel/msg423430.html
[2]. https://patches.linaro.org/50047/


Kevin Hilman (1):
  WIP: ARM: PM domains for CPUs/clusters

Lina Iyer (15):
  PM / Domains: Allocate memory outside domain locks
  PM / Domains: Remove dev->driver check for runtime PM
  PM / Domains: Support IRQ safe PM domains
  arm: domain: Remove hack to add dev->driver.
  arm: domain: Make CPU genpd IRQ safe
  arm: domain: Synchronize CPU device runtime PM usage with idle state
  arm: domain: Handle CPU online reference counting
  arm: domain: Add platform callbacks for domain power on/off
  drivers: cpuidle: Add runtime PM support for CPUIdle
  drivers: qcom: spm: Support cache and coherency SPMs
  drivers: qcom: spm: Enable runtime suspend/resume of CPU PM domain
  drivers: qcom: spm: Add 8084 L2 SPM register data
  arm: dts: Add L2 power-controller device bindings for APQ8084
  arm: dts: Add power domain device bindings for APQ8084
  drivers: qcom: Enable genpd on selecting QCOM_PM

 .../devicetree/bindings/arm/msm/qcom,saw2.txt      |   1 +
 Documentation/power/devices.txt                    |  11 +-
 arch/arm/boot/dts/exynos5420.dtsi                  |  18 ++
 arch/arm/boot/dts/qcom-apq8084.dtsi                |  10 +-
 arch/arm/include/asm/cpu.h                         |   1 -
 arch/arm/include/asm/pm_domain.h                   |  27 +++
 arch/arm/kernel/Makefile                           |   1 +
 arch/arm/kernel/domains.c                          | 243 +++++++++++++++++++++
 drivers/base/power/domain.c                        | 230 ++++++++++++++-----
 drivers/cpuidle/cpuidle-arm.c                      |  11 +
 drivers/soc/qcom/Kconfig                           |   3 +
 drivers/soc/qcom/spm.c                             | 156 ++++++++++++-
 include/linux/pm_domain.h                          |  11 +-
 13 files changed, 649 insertions(+), 74 deletions(-)
 create mode 100644 arch/arm/include/asm/pm_domain.h
 create mode 100644 arch/arm/kernel/domains.c

-- 
2.1.4

^ permalink raw reply	[flat|nested] 30+ messages in thread

end of thread, other threads:[~2015-07-13 16:36 UTC | newest]

Thread overview: 30+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-06-27  3:02 [PATCH RFC v2 00/16] PM / Domains: Generic PM domains for CPUs Lina Iyer
2015-06-27  3:02 ` [PATCH RFC v2 01/16] PM / Domains: Allocate memory outside domain locks Lina Iyer
2015-06-29  0:26   ` Krzysztof Kozlowski
2015-06-29 16:36     ` Lina Iyer
2015-06-27  3:02 ` [PATCH RFC v2 02/16] PM / Domains: Remove dev->driver check for runtime PM Lina Iyer
2015-06-29  0:40   ` Krzysztof Kozlowski
2015-06-27  3:02 ` [PATCH RFC v2 03/16] PM / Domains: Support IRQ safe PM domains Lina Iyer
2015-06-29 13:06   ` Geert Uytterhoeven
2015-06-29 13:10   ` Geert Uytterhoeven
2015-06-27  3:02 ` [PATCH RFC v2 04/16] WIP: ARM: PM domains for CPUs/clusters Lina Iyer
2015-06-27  3:02 ` [PATCH RFC v2 05/16] arm: domain: Remove hack to add dev->driver Lina Iyer
2015-06-27  3:02 ` [PATCH RFC v2 06/16] arm: domain: Make CPU genpd IRQ safe Lina Iyer
2015-06-27  3:02 ` [PATCH RFC v2 07/16] arm: domain: Synchronize CPU device runtime PM usage with idle state Lina Iyer
2015-06-29 13:13   ` Geert Uytterhoeven
2015-06-27  3:02 ` [PATCH RFC v2 08/16] arm: domain: Handle CPU online reference counting Lina Iyer
2015-06-27  3:02 ` [PATCH RFC v2 09/16] arm: domain: Add platform callbacks for domain power on/off Lina Iyer
2015-06-29 13:36   ` Geert Uytterhoeven
2015-06-29 16:32     ` Lina Iyer
2015-06-30 15:10       ` Geert Uytterhoeven
2015-07-02 19:38         ` Lina Iyer
2015-07-03 11:36           ` Geert Uytterhoeven
2015-07-06 15:18             ` Lina Iyer
2015-07-13 16:36               ` Lina Iyer
2015-06-27  3:02 ` [PATCH RFC v2 10/16] drivers: cpuidle: Add runtime PM support for CPUIdle Lina Iyer
2015-06-27  3:02 ` [PATCH RFC v2 11/16] drivers: qcom: spm: Support cache and coherency SPMs Lina Iyer
2015-06-27  3:02 ` [PATCH RFC v2 12/16] drivers: qcom: spm: Enable runtime suspend/resume of CPU PM domain Lina Iyer
2015-06-27  3:02 ` [PATCH RFC v2 13/16] drivers: qcom: spm: Add 8084 L2 SPM register data Lina Iyer
2015-06-27  3:02 ` [PATCH RFC v2 14/16] arm: dts: Add L2 power-controller device bindings for APQ8084 Lina Iyer
2015-06-27  3:02 ` [PATCH RFC v2 15/16] arm: dts: Add power domain " Lina Iyer
2015-06-27  3:02 ` [PATCH RFC v2 16/16] drivers: qcom: Enable genpd on selecting QCOM_PM Lina Iyer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).