]> asedeno.scripts.mit.edu Git - linux.git/commit
PM / Domains: Support IRQ safe PM domains
authorLina Iyer <lina.iyer@linaro.org>
Fri, 14 Oct 2016 17:47:55 +0000 (10:47 -0700)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Fri, 21 Oct 2016 20:20:56 +0000 (22:20 +0200)
commitd716f4798ff8c65ace4a6ab291f9a4ff265df4ba
treeac3d04985805e3628e2a0dd2cd30457af9e21122
parent35241d12f750d2f1556a9c85f175ce7044716881
PM / Domains: Support IRQ safe PM domains

Generic Power Domains currently support turning on/off only in process
context. This prevents the usage of PM domains for domains that could be
powered on/off in a context where IRQs are disabled. Many such domains
exist today and do not get powered off, when the IRQ safe devices in
that domain are powered off, because of this limitation.

However, not all domains can operate in IRQ safe contexts. Genpd
therefore, has to support both cases where the domain may or may not
operate in IRQ safe contexts. Configuring genpd to use an appropriate
lock for that domain, would allow domains that have IRQ safe devices to
runtime suspend and resume, in atomic context.

To achieve domain specific locking, set the domain's ->flag to
GENPD_FLAG_IRQ_SAFE while defining the domain. This indicates that genpd
should use a spinlock instead of a mutex for locking the domain. Locking
is abstracted through genpd_lock() and genpd_unlock() functions that use
the flag to determine the appropriate lock to be used for that domain.

Domains that have lower latency to suspend and resume and can operate
with IRQs disabled may now be able to save power, when the component
devices and sub-domains are idle at runtime.

The restriction this imposes on the domain hierarchy is that non-IRQ
safe domains may not have IRQ-safe subdomains, but IRQ safe domains may
have IRQ safe and non-IRQ safe subdomains and devices.

Signed-off-by: Lina Iyer <lina.iyer@linaro.org>
Acked-by: Ulf Hansson <ulf.hansson@linaro.org>
Reviewed-by: Kevin Hilman <khilman@baylibre.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/base/power/domain.c
include/linux/pm_domain.h