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

     Subject: [PATCH 2/11] USB: more autosuspend timer stuff

to my gregkh-2.6 tree.  Its filename is

     usb-more-autosuspend-timer-stuff.patch

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


>From [EMAIL PROTECTED] Thu Apr  5 13:03:59 2007
From: Alan Stern <[EMAIL PROTECTED]>
Date: Thu, 5 Apr 2007 16:03:49 -0400 (EDT)
Subject: [PATCH 2/11] USB: more autosuspend timer stuff
To: Greg KH <[EMAIL PROTECTED]>
Cc: USB development list <[email protected]>
Message-ID: <[EMAIL PROTECTED]>


This patch (as879) ties up some loose ends from an earlier patch.
These are things I didn't think to include at the time but which
clearly belonged there.

        If an autosuspend fails because driver activity races with
        the autosuspend call, restart the autosuspend timer.

        When a device is resumed by an external request, it counts
        as device activity and should update the last_busy time so
        that the next autoresume won't occur immediately.

Signed-off-by: Alan Stern <[EMAIL PROTECTED]>
Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>

---
 drivers/usb/core/driver.c |   18 ++++++++++++++----
 1 file changed, 14 insertions(+), 4 deletions(-)

--- a/drivers/usb/core/driver.c
+++ b/drivers/usb/core/driver.c
@@ -983,7 +983,10 @@ static int autosuspend_check(struct usb_
 
 #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_d
                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_d
                        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 us
        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


Patches currently in gregkh-2.6 which might be from [EMAIL PROTECTED] are

driver/sysfs-add-sysfs_dirent-s_name.patch
driver/sysfs-add-sysfs_dirent-s_parent.patch
driver/sysfs-allocate-inode-number-using-ida.patch
driver/sysfs-consolidate-sysfs_dirent-creation-functions.patch
driver/sysfs-fix-error-handling-in-binattr-write.patch
driver/sysfs-flatten-and-fix-sysfs_rename_dir-error-handling.patch
driver/sysfs-flatten-cleanup-paths-in-sysfs_add_link-and-create_dir.patch
driver/sysfs-implement-bin_buffer.patch
driver/sysfs-implement-kobj_sysfs_assoc_lock.patch
driver/sysfs-implement-sysfs_dirent-active-reference-and-immediate-disconnect.patch
driver/sysfs-kill-attribute-file-orphaning.patch
driver/sysfs-kill-unnecessary-attribute-owner.patch
driver/sysfs-make-sysfs_dirent-s_element-a-union.patch
driver/sysfs-make-sysfs_put-ignore-null-sd.patch
driver/sysfs-move-release_sysfs_dirent-to-dir.c.patch
driver/sysfs-reimplement-syfs_drop_dentry.patch
driver/sysfs-reimplement-symlink-using-sysfs_dirent-tree.patch
driver/sysfs-separate-out-sysfs_attach_dentry.patch
driver/ida-implement-idr-based-id-allocator.patch
driver/idr-fix-obscure-bug-in-allocation-path.patch
driver/idr-separate-out-idr_mark_full.patch
usb/usb-remove-unneeded-warn_on.patch
usb/usb-make-the-autosuspend-workqueue-thread-freezable.patch
usb/usb-more-autosuspend-timer-stuff.patch
usb/usb-set-the-correct-interrupt-interval-in-usb_bulk_msg.patch
usb/ehci-fix-problem-with-bios-handoff.patch

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to