[lkml]   [2007]   [Aug]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
    Patch in this message
    Subject[PATCH] USB: Only enable autosuspend by default on certain device classes
    We're seeing a large number of problems with devices not appreciating 
    USB autosuspend, especially printers and scanners. According to only a
    subset of drivers support it in Windows XP, meaning that most devices
    are probably untested in this situation. This patch alters the behaviour
    to match that of Windows. Userspace can still whitelist devices as
    appropriate, and the set of classes supporting autosuspend probably
    covers pretty much every driver likely to be found on any portable

    Signed-off-by: Matthew Garrett <>


    diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
    index caaa46f..12ba789 100644
    --- a/drivers/usb/core/hub.c
    +++ b/drivers/usb/core/hub.c
    @@ -1278,6 +1278,22 @@ int usb_new_device(struct usb_device *udev)
    int err;

    + /* Disable autosuspend for most devices - Windows only enables it
    + for a small subset of classes, so most hardware hasn't been tested
    + with it. Userspace can always reenable at a later point */
    + switch (udev->descriptor.bDeviceClass) {
    + case USB_CLASS_HID:
    + case USB_CLASS_COMM:
    + case USB_CLASS_HUB:
    + break;
    + default:
    + udev->autosuspend_disabled = 1;
    + }
    /* Determine quirks */

    Matthew Garrett |
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to
    More majordomo info at
    Please read the FAQ at
     \ /
      Last update: 2007-08-03 01:59    [W:0.065 / U:146.280 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site