[PATCH] PM / sleep: Don't unset parent's direct_complete
From: Tomeu Vizoso
Date: Wed Mar 25 2015 - 11:28:30 EST
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@xxxxxxxxxxxxx>
---
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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/