patch usb-consolidate-remote-wakeup-routines.patch added to gregkh-2.6 tree

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

 



This is a note to let you know that I've just added the patch titled

    Subject: USB: consolidate remote wakeup routines

to my gregkh-2.6 tree.  Its filename is

    usb-consolidate-remote-wakeup-routines.patch

This tree can be found at 
    http://www.kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/patches/


>From stern@xxxxxxxxxxxxxxxxxxx  Fri Jan 15 13:38:51 2010
From: Alan Stern <stern@xxxxxxxxxxxxxxxxxxx>
Date: Fri, 8 Jan 2010 12:56:30 -0500 (EST)
Subject: USB: consolidate remote wakeup routines
To: Greg KH <greg@xxxxxxxxx>
Cc: USB list <linux-usb@xxxxxxxxxxxxxxx>
Message-ID: <Pine.LNX.4.44L0.1001081250180.4862-100000@xxxxxxxxxxxxxxxxxxxx>


This patch (as1324) makes a small change to the code used for remote
wakeup of root hubs.  hcd_resume_work() now calls the hub driver's
remote-wakeup routine instead of implementing its own version.

The patch is complicated by the need to rename remote_wakeup() to
usb_remote_wakeup(), make it non-static, and declare it in a header
file.  There's also the additional complication required to make
everything work when CONFIG_PM isn't set; the do-nothing inline
routine had to be moved into the header file.

Signed-off-by: Alan Stern <stern@xxxxxxxxxxxxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxx>

---
 drivers/usb/core/hcd.c |    3 +--
 drivers/usb/core/hub.c |   13 ++++---------
 drivers/usb/core/usb.h |    6 ++++++
 3 files changed, 11 insertions(+), 11 deletions(-)

--- a/drivers/usb/core/hcd.c
+++ b/drivers/usb/core/hcd.c
@@ -1865,8 +1865,7 @@ static void hcd_resume_work(struct work_
 	struct usb_device *udev = hcd->self.root_hub;
 
 	usb_lock_device(udev);
-	usb_mark_last_busy(udev);
-	usb_external_resume_device(udev, PMSG_REMOTE_RESUME);
+	usb_remote_wakeup(udev);
 	usb_unlock_device(udev);
 }
 
--- a/drivers/usb/core/hub.c
+++ b/drivers/usb/core/hub.c
@@ -2398,7 +2398,7 @@ int usb_port_resume(struct usb_device *u
 }
 
 /* caller has locked udev */
-static int remote_wakeup(struct usb_device *udev)
+int usb_remote_wakeup(struct usb_device *udev)
 {
 	int	status = 0;
 
@@ -2442,7 +2442,7 @@ int usb_port_resume(struct usb_device *u
 	return status;
 }
 
-static inline int remote_wakeup(struct usb_device *udev)
+int usb_remote_wakeup(struct usb_device *udev)
 {
 	return 0;
 }
@@ -2513,11 +2513,6 @@ EXPORT_SYMBOL_GPL(usb_root_hub_lost_powe
 
 #else	/* CONFIG_PM */
 
-static inline int remote_wakeup(struct usb_device *udev)
-{
-	return 0;
-}
-
 #define hub_suspend		NULL
 #define hub_resume		NULL
 #define hub_reset_resume	NULL
@@ -3016,7 +3011,7 @@ static void hub_port_connect_change(stru
 			/* For a suspended device, treat this as a
 			 * remote wakeup event.
 			 */
-			status = remote_wakeup(udev);
+			status = usb_remote_wakeup(udev);
 #endif
 
 		} else {
@@ -3362,7 +3357,7 @@ static void hub_events(void)
 					msleep(10);
 
 					usb_lock_device(udev);
-					ret = remote_wakeup(hdev->
+					ret = usb_remote_wakeup(hdev->
 							children[i-1]);
 					usb_unlock_device(udev);
 					if (ret < 0)
--- a/drivers/usb/core/usb.h
+++ b/drivers/usb/core/usb.h
@@ -63,6 +63,7 @@ extern int usb_external_suspend_device(s
 		pm_message_t msg);
 extern int usb_external_resume_device(struct usb_device *udev,
 		pm_message_t msg);
+extern int usb_remote_wakeup(struct usb_device *dev);
 
 static inline void usb_pm_lock(struct usb_device *udev)
 {
@@ -86,6 +87,11 @@ static inline int usb_port_resume(struct
 	return 0;
 }
 
+static inline int usb_remote_wakeup(struct usb_device *udev)
+{
+	return 0;
+}
+
 static inline void usb_pm_lock(struct usb_device *udev) {}
 static inline void usb_pm_unlock(struct usb_device *udev) {}
 

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