* [PATCH] PM Sleep: Don't extend wakeup paths to devices with ignore_children set
@ 2011-11-16 22:21 Rafael J. Wysocki
2011-11-16 23:52 ` [PATCH] PM Sleep: Don't extend wakeup paths to devices with Greg KH
0 siblings, 1 reply; 3+ messages in thread
From: Rafael J. Wysocki @ 2011-11-16 22:21 UTC (permalink / raw)
To: Linux PM list; +Cc: Linux-sh list, LKML, Magnus Damm, Greg Kroah-Hartman
From: Rafael J. Wysocki <rjw@sisk.pl>
Commit 4ca46ff3e0d8c234cb40ebb6457653b59584426c (PM / Sleep: Mark
devices involved in wakeup signaling during suspend) introduced
the power.wakeup_path field in struct dev_pm_info to mark devices
whose children are enabled to wake up the system from sleep states,
so that power domains containing the parents that provide their
children with wakeup power and/or relay their wakeup signals are not
turned off. Unfortunately, that introduced a PM regression on SH7372
whose power consumption in the system "memory sleep" state increased
as a result of it, because it prevented the power domain containing
the I2C controller from being turned off when some children of that
controller were enabled to wake up the system, although the
controller was not necessary for them to signal wakeup.
To fix this issue use the observation that devices whose
power.ignore_children flag is set for runtime PM should be treated
analogously during system suspend. Namely, they shouldn't be
included in wakeup paths going through their children. Since the
SH7372 I2C controller's power.ignore_children flag is set, doing so
will restore the previous behavior of that SOC.
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
---
drivers/base/power/main.c | 3 ++-
include/linux/device.h | 5 +++++
include/linux/pm.h | 2 +-
include/linux/pm_runtime.h | 6 ------
4 files changed, 8 insertions(+), 8 deletions(-)
Index: linux/include/linux/pm.h
=================================--- linux.orig/include/linux/pm.h
+++ linux/include/linux/pm.h
@@ -447,6 +447,7 @@ struct dev_pm_info {
unsigned int async_suspend:1;
bool is_prepared:1; /* Owned by the PM core */
bool is_suspended:1; /* Ditto */
+ bool ignore_children:1;
spinlock_t lock;
#ifdef CONFIG_PM_SLEEP
struct list_head entry;
@@ -464,7 +465,6 @@ struct dev_pm_info {
atomic_t usage_count;
atomic_t child_count;
unsigned int disable_depth:3;
- unsigned int ignore_children:1;
unsigned int idle_notification:1;
unsigned int request_pending:1;
unsigned int deferred_resume:1;
Index: linux/drivers/base/power/main.c
=================================--- linux.orig/drivers/base/power/main.c
+++ linux/drivers/base/power/main.c
@@ -920,7 +920,8 @@ static int __device_suspend(struct devic
End:
if (!error) {
dev->power.is_suspended = true;
- if (dev->power.wakeup_path && dev->parent)
+ if (dev->power.wakeup_path
+ && dev->parent && !dev->parent->power.ignore_children)
dev->parent->power.wakeup_path = true;
}
Index: linux/include/linux/pm_runtime.h
=================================--- linux.orig/include/linux/pm_runtime.h
+++ linux/include/linux/pm_runtime.h
@@ -54,11 +54,6 @@ static inline bool pm_children_suspended
|| !atomic_read(&dev->power.child_count);
}
-static inline void pm_suspend_ignore_children(struct device *dev, bool enable)
-{
- dev->power.ignore_children = enable;
-}
-
static inline void pm_runtime_get_noresume(struct device *dev)
{
atomic_inc(&dev->power.usage_count);
@@ -132,7 +127,6 @@ static inline void pm_runtime_allow(stru
static inline void pm_runtime_forbid(struct device *dev) {}
static inline bool pm_children_suspended(struct device *dev) { return false; }
-static inline void pm_suspend_ignore_children(struct device *dev, bool en) {}
static inline void pm_runtime_get_noresume(struct device *dev) {}
static inline void pm_runtime_put_noidle(struct device *dev) {}
static inline bool device_run_wake(struct device *dev) { return false; }
Index: linux/include/linux/device.h
=================================--- linux.orig/include/linux/device.h
+++ linux/include/linux/device.h
@@ -682,6 +682,11 @@ static inline bool device_async_suspend_
return !!dev->power.async_suspend;
}
+static inline void pm_suspend_ignore_children(struct device *dev, bool enable)
+{
+ dev->power.ignore_children = enable;
+}
+
static inline void device_lock(struct device *dev)
{
mutex_lock(&dev->mutex);
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] PM Sleep: Don't extend wakeup paths to devices with
2011-11-16 22:21 [PATCH] PM Sleep: Don't extend wakeup paths to devices with ignore_children set Rafael J. Wysocki
@ 2011-11-16 23:52 ` Greg KH
2011-11-17 20:16 ` [PATCH] PM Sleep: Don't extend wakeup paths to devices with ignore_children set Rafael J. Wysocki
0 siblings, 1 reply; 3+ messages in thread
From: Greg KH @ 2011-11-16 23:52 UTC (permalink / raw)
To: Rafael J. Wysocki; +Cc: Linux PM list, Linux-sh list, LKML, Magnus Damm
On Wed, Nov 16, 2011 at 11:21:58PM +0100, Rafael J. Wysocki wrote:
> From: Rafael J. Wysocki <rjw@sisk.pl>
>
> Commit 4ca46ff3e0d8c234cb40ebb6457653b59584426c (PM / Sleep: Mark
> devices involved in wakeup signaling during suspend) introduced
> the power.wakeup_path field in struct dev_pm_info to mark devices
> whose children are enabled to wake up the system from sleep states,
> so that power domains containing the parents that provide their
> children with wakeup power and/or relay their wakeup signals are not
> turned off. Unfortunately, that introduced a PM regression on SH7372
> whose power consumption in the system "memory sleep" state increased
> as a result of it, because it prevented the power domain containing
> the I2C controller from being turned off when some children of that
> controller were enabled to wake up the system, although the
> controller was not necessary for them to signal wakeup.
>
> To fix this issue use the observation that devices whose
> power.ignore_children flag is set for runtime PM should be treated
> analogously during system suspend. Namely, they shouldn't be
> included in wakeup paths going through their children. Since the
> SH7372 I2C controller's power.ignore_children flag is set, doing so
> will restore the previous behavior of that SOC.
>
> Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] PM Sleep: Don't extend wakeup paths to devices with ignore_children set
2011-11-16 23:52 ` [PATCH] PM Sleep: Don't extend wakeup paths to devices with Greg KH
@ 2011-11-17 20:16 ` Rafael J. Wysocki
0 siblings, 0 replies; 3+ messages in thread
From: Rafael J. Wysocki @ 2011-11-17 20:16 UTC (permalink / raw)
To: Greg KH; +Cc: Linux PM list, Linux-sh list, LKML, Magnus Damm
On Thursday, November 17, 2011, Greg KH wrote:
> On Wed, Nov 16, 2011 at 11:21:58PM +0100, Rafael J. Wysocki wrote:
> > From: Rafael J. Wysocki <rjw@sisk.pl>
> >
> > Commit 4ca46ff3e0d8c234cb40ebb6457653b59584426c (PM / Sleep: Mark
> > devices involved in wakeup signaling during suspend) introduced
> > the power.wakeup_path field in struct dev_pm_info to mark devices
> > whose children are enabled to wake up the system from sleep states,
> > so that power domains containing the parents that provide their
> > children with wakeup power and/or relay their wakeup signals are not
> > turned off. Unfortunately, that introduced a PM regression on SH7372
> > whose power consumption in the system "memory sleep" state increased
> > as a result of it, because it prevented the power domain containing
> > the I2C controller from being turned off when some children of that
> > controller were enabled to wake up the system, although the
> > controller was not necessary for them to signal wakeup.
> >
> > To fix this issue use the observation that devices whose
> > power.ignore_children flag is set for runtime PM should be treated
> > analogously during system suspend. Namely, they shouldn't be
> > included in wakeup paths going through their children. Since the
> > SH7372 I2C controller's power.ignore_children flag is set, doing so
> > will restore the previous behavior of that SOC.
> >
> > Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
>
> Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Thanks!
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2011-11-17 20:16 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-16 22:21 [PATCH] PM Sleep: Don't extend wakeup paths to devices with ignore_children set Rafael J. Wysocki
2011-11-16 23:52 ` [PATCH] PM Sleep: Don't extend wakeup paths to devices with Greg KH
2011-11-17 20:16 ` [PATCH] PM Sleep: Don't extend wakeup paths to devices with ignore_children set Rafael J. Wysocki
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox