[PATCH v2 09/14] PM / Runtime: hold device active during device_wakeup_{enable|disable}

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



usbcore blocks powering off hub ports while a downstream source is
wakeup enabled.  Once wakeup is disabled usbcore can try again to turn
off the parent port.  Add a pm_runtime reference manipulation to retry a
port power down on disable, or pin the port active on enable.

Cc: Rafael J. Wysocki <rafael.j.wysocki@xxxxxxxxx>
Signed-off-by: Dan Williams <dan.j.williams@xxxxxxxxx>
---
 drivers/base/power/wakeup.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/drivers/base/power/wakeup.c b/drivers/base/power/wakeup.c
index 2d56f4113ae7..f784804137e7 100644
--- a/drivers/base/power/wakeup.c
+++ b/drivers/base/power/wakeup.c
@@ -14,6 +14,7 @@
 #include <linux/suspend.h>
 #include <linux/seq_file.h>
 #include <linux/debugfs.h>
+#include <linux/pm_runtime.h>
 #include <trace/events/power.h>
 
 #include "power.h"
@@ -335,10 +336,16 @@ EXPORT_SYMBOL_GPL(device_init_wakeup);
  */
 int device_set_wakeup_enable(struct device *dev, bool enable)
 {
+	int rc;
+
 	if (!dev || !dev->power.can_wakeup)
 		return -EINVAL;
 
-	return enable ? device_wakeup_enable(dev) : device_wakeup_disable(dev);
+	pm_runtime_get_sync(dev);
+	rc = enable ? device_wakeup_enable(dev) : device_wakeup_disable(dev);
+	pm_runtime_put_sync(dev);
+
+	return rc;
 }
 EXPORT_SYMBOL_GPL(device_set_wakeup_enable);
 

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux