[RFC PATCH] USB: enable "power/wakeup" to control remote wakeup in the runtime suspend

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

 



Currently, "power/wakeup" sysfs file can't control remote wakeup in the runtime
suspend. It only depends on "usb_interface->needs_remote_wakeup" to determine
whether enable remote wakeup or not when runtime suspending. Usr space has no
choice. This patch is to enable "power/wakeup" to control remote wakeup in the
runtime suspend.

Signed-off-by: Lan Tianyu <tianyu.lan@xxxxxxxxx>
---
 drivers/usb/core/driver.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/usb/core/driver.c b/drivers/usb/core/driver.c
index 6978101..e79b95e 100644
--- a/drivers/usb/core/driver.c
+++ b/drivers/usb/core/driver.c
@@ -1692,7 +1692,7 @@ static int autosuspend_check(struct usb_device *udev)
 	 * any interface drivers require remote wakeup but it isn't available.
 	 */
 	w = 0;
-	if (udev->actconfig) {
+	if (udev->actconfig && device_may_wakeup(&udev->dev)) {
 		for (i = 0; i < udev->actconfig->desc.bNumInterfaces; i++) {
 			intf = udev->actconfig->interface[i];
 
-- 
1.7.6.rc2.8.g28eb

--
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