lkml.org 
[lkml]   [2015]   [Mar]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] PM / sleep: Don't unset parent's direct_complete
Date
If a device isn't going to be fully-suspended because there isn't an
implementation of the suspend callback, there's no need to make sure
that its parent is going to be fully-suspended as well.

Without this change, USB interface devices will always prevent the
proper USB device to stay in runtime suspension when the system
suspends.

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
---

Hi,

I'm not sure if this is the right fix, because I don't see why the USB
interface devices are in the dpm_list in the first place, so any comments will
be welcome.

Thanks,

Tomeu

---
drivers/base/power/main.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/base/power/main.c b/drivers/base/power/main.c
index 3d874ec..6bac53f 100644
--- a/drivers/base/power/main.c
+++ b/drivers/base/power/main.c
@@ -1438,7 +1438,9 @@ static int __device_suspend(struct device *dev, pm_message_t state, bool async)
if (parent) {
spin_lock_irq(&parent->power.lock);

- dev->parent->power.direct_complete = false;
+ if (callback)
+ parent->power.direct_complete = false;
+
if (dev->power.wakeup_path
&& !dev->parent->power.ignore_children)
dev->parent->power.wakeup_path = true;
--
2.1.0


\
 
 \ /
  Last update: 2015-03-25 16:41    [W:0.036 / U:0.368 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site