[PATCH] USB: disable autosuspend by default for non-hubs

Alan Stern <[email protected]>
Newsgroups gmane.linux.usb.devel
Message-ID <[email protected]>
This patch (as965) disables autosuspend by default for all USB devices
other than hubs.  We are seeing too many devices that can't suspend or
resume properly, the blacklist is growing unreasonably quickly, and
this sort of thing should be handled in userspace.

Signed-off-by: Alan Stern <[email protected]>

---

Once this is added there isn't much point in keeping the
USB_QUIRK_NO_AUTOSUSPEND flag or usbcore's "autosuspend" parameter.
But one thing at a time.

It would be a good idea to put this in 2.6.23.  If it turns out not to
be necessary we can always remove it later; the conservative course for
now is to avoid breaking lots of devices all at once.

Alan Stern


Index: usb-2.6/drivers/usb/core/quirks.c
===================================================================
--- usb-2.6.orig/drivers/usb/core/quirks.c
+++ usb-2.6/drivers/usb/core/quirks.c
@@ -120,4 +120,10 @@ void usb_detect_quirks(struct usb_device
 	/* do any special quirk handling here if needed */
 	if (udev->quirks & USB_QUIRK_NO_AUTOSUSPEND)
 		usb_autosuspend_quirk(udev);
+
+	/* By default, disable autosuspend for all non-hubs */
+#ifdef	CONFIG_USB_SUSPEND
+	if (udev->descriptor.bDeviceClass != USB_CLASS_HUB)
+		udev->autosuspend_delay = -1;
+#endif
 }


-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.