diff options
author | Rafael J. Wysocki <rjw@sisk.pl> | 2011-08-25 15:37:04 +0200 |
---|---|---|
committer | Rafael J. Wysocki <rjw@sisk.pl> | 2011-08-25 15:37:04 +0200 |
commit | 0aa2a221696cc8ea20a4cdca01315d3b6b4ecc4d (patch) | |
tree | e2af809c44ff7ec93299170fc7ee6871be25108e /include/linux/pm_domain.h | |
parent | b5e8d269d814763d597ccc0108d1fa6639ad35a1 (diff) | |
download | blackbird-obmc-linux-0aa2a221696cc8ea20a4cdca01315d3b6b4ecc4d.tar.gz blackbird-obmc-linux-0aa2a221696cc8ea20a4cdca01315d3b6b4ecc4d.zip |
PM / Domains: Preliminary support for devices with power.irq_safe set
The generic PM domains framework currently doesn't work with devices
whose power.irq_safe flag is set, because runtime PM callbacks for
such devices are run with interrupts disabled and the callbacks
provided by the generic PM domains framework use domain mutexes
and may sleep. However, such devices very well may belong to
power domains on some systems, so the generic PM domains framework
should take them into account.
For this reason, modify the generic PM domains framework so that the
domain .power_off() and .power_on() callbacks are never executed for
a domain containing devices with power.irq_safe set, although the
.stop_device() and .start_device() callbacks are still run for them.
Additionally, introduce a flag allowing the creator of a
struct generic_pm_domain object to indicate that its .stop_device()
and .start_device() callbacks may be run in interrupt context
(might_sleep_if() triggers if that flag is not set and one of those
callbacks is run in interrupt context).
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Diffstat (limited to 'include/linux/pm_domain.h')
-rw-r--r-- | include/linux/pm_domain.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/pm_domain.h b/include/linux/pm_domain.h index 5cce46c2d926..2538d906bcd1 100644 --- a/include/linux/pm_domain.h +++ b/include/linux/pm_domain.h @@ -42,6 +42,7 @@ struct generic_pm_domain { unsigned int suspended_count; /* System suspend device counter */ unsigned int prepared_count; /* Suspend counter of prepared devices */ bool suspend_power_off; /* Power status before system suspend */ + bool dev_irq_safe; /* Device callbacks are IRQ-safe */ int (*power_off)(struct generic_pm_domain *domain); int (*power_on)(struct generic_pm_domain *domain); int (*start_device)(struct device *dev); |