[PATCH v8 15/18] usb: hub_handle_remote_wakeup() depends on CONFIG_PM_RUNTIME=y

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

 



Per Alan:
"You mean from within hub_handle_remote_wakeup()?  That routine will
never get called if CONFIG_PM_RUNTIME isn't enabled, because khubd
never sees wakeup requests if they arise during system suspend.

In fact, that routine ought to go inside the "#ifdef CONFIG_PM_RUNTIME"
portion of hub.c, along with the other suspend/resume code."

Suggested-by: Alan Stern <stern@xxxxxxxxxxxxxxxxxxx>
Signed-off-by: Dan Williams <dan.j.williams@xxxxxxxxx>
---
 drivers/usb/core/hub.c |    4 ++++
 drivers/usb/core/usb.h |    5 -----
 2 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
index 250663edc701..cfb6ac835c39 100644
--- a/drivers/usb/core/hub.c
+++ b/drivers/usb/core/hub.c
@@ -4690,6 +4690,7 @@ static void hub_port_connect_change(struct usb_hub *hub, int port1,
 	usb_lock_port(port_dev);
 }
 
+#ifdef CONFIG_PM_RUNTIME
 /* Returns 1 if there was a remote wakeup and a connect status change. */
 static int hub_handle_remote_wakeup(struct usb_hub *hub, unsigned int port,
 		u16 portstatus, u16 portchange)
@@ -4730,6 +4731,7 @@ static int hub_handle_remote_wakeup(struct usb_hub *hub, unsigned int port,
 	dev_dbg(&port_dev->dev, "resume, status %d\n", ret);
 	return connect_change;
 }
+#endif
 
 static void port_event(struct usb_hub *hub, int port1)
 		__must_hold(&port_dev->status_lock)
@@ -4807,8 +4809,10 @@ static void port_event(struct usb_hub *hub, int port1)
 	if (!pm_runtime_active(&port_dev->dev))
 		return;
 
+#ifdef CONFIG_PM_RUNTIME
 	if (hub_handle_remote_wakeup(hub, port1, portstatus, portchange))
 		connect_change = 1;
+#endif
 
 	/*
 	 * Warm reset a USB3 protocol port if it's in
diff --git a/drivers/usb/core/usb.h b/drivers/usb/core/usb.h
index 98dc08e13448..d9d08720c386 100644
--- a/drivers/usb/core/usb.h
+++ b/drivers/usb/core/usb.h
@@ -107,11 +107,6 @@ static inline int usb_autoresume_device(struct usb_device *udev)
 	return 0;
 }
 
-static inline int usb_remote_wakeup(struct usb_device *udev)
-{
-	return 0;
-}
-
 static inline int usb_set_usb2_hardware_lpm(struct usb_device *udev, int enable)
 {
 	return 0;

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