summaryrefslogtreecommitdiff
path: root/drivers/usb/core/driver.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2007-05-23 08:12:54 -0700
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-05-23 08:12:54 -0700
commit641e22e04c48af5d813f119c55336e02a22756f5 (patch)
tree9f7f693e8dd030e1d28585893e6e53bd86b1208c /drivers/usb/core/driver.c
parent31f6e1bd3b58c9a67e5ea0c2d372fbf5fc9e326d (diff)
parentfa91d43b914b77637653d984416e17e182f7b807 (diff)
Merge master.kernel.org:/pub/scm/linux/kernel/git/gregkh/usb-2.6
* master.kernel.org:/pub/scm/linux/kernel/git/gregkh/usb-2.6: (29 commits) USB: Add support for Olimex arm-usb-ocd JTAG interface serial port USB: Add support for Sierra Wireless Aircard 595U USB: ldusb bugfix USB: ftdi_sio: Add USB Product Id for OpenDCC USB: fix ratelimit call semantics USB: handle errors in power/level attribute USB: make the autosuspend workqueue thread freezable USB: Fix USB OHCI Subvendor for Toshiba Portege 4000 USB: usblp: Use correct DMA address in case of probe error USB: Fix debug output of ark3116 USB: Onetouch - switch to using input_dev->dev.parent USB: don't try to kzalloc 0 bytes USB: remove short initial timeout for device descriptor fetch USB: Deref URB after usbmon is done with it USB: Remove duplicate IDs from option card driver USB: auerswald: fix file release handler USB: fsl_usb2_udc: Fix UMTI_WIDE support and a compile warning USB: set the correct Interrupt interval in usb_bulk_msg USB: New device PID for ftdi_sio driver USB: remove unneeded WARN_ON ...
Diffstat (limited to 'drivers/usb/core/driver.c')
-rw-r--r--drivers/usb/core/driver.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/drivers/usb/core/driver.c b/drivers/usb/core/driver.c
index b9f7f90aef82..2619986e5300 100644
--- a/drivers/usb/core/driver.c
+++ b/drivers/usb/core/driver.c
@@ -983,7 +983,10 @@ static int autosuspend_check(struct usb_device *udev)
#else
-#define autosuspend_check(udev) 0
+static inline int autosuspend_check(struct usb_device *udev)
+{
+ return 0;
+}
#endif /* CONFIG_USB_SUSPEND */
@@ -1041,7 +1044,6 @@ static int usb_suspend_both(struct usb_device *udev, pm_message_t msg)
if (status < 0)
goto done;
}
- cancel_delayed_work(&udev->autosuspend);
/* Suspend all the interfaces and then udev itself */
if (udev->actconfig) {
@@ -1062,9 +1064,16 @@ static int usb_suspend_both(struct usb_device *udev, pm_message_t msg)
usb_resume_interface(intf);
}
+ /* Try another autosuspend when the interfaces aren't busy */
+ if (udev->auto_pm)
+ autosuspend_check(udev);
+
/* If the suspend succeeded, propagate it up the tree */
- } else if (parent)
- usb_autosuspend_device(parent);
+ } else {
+ cancel_delayed_work(&udev->autosuspend);
+ if (parent)
+ usb_autosuspend_device(parent);
+ }
done:
// dev_dbg(&udev->dev, "%s: status %d\n", __FUNCTION__, status);
@@ -1475,6 +1484,7 @@ int usb_external_resume_device(struct usb_device *udev)
usb_pm_lock(udev);
udev->auto_pm = 0;
status = usb_resume_both(udev);
+ udev->last_busy = jiffies;
usb_pm_unlock(udev);
/* Now that the device is awake, we can start trying to autosuspend