We're seeing a large number of problems with devices not appreciating USB autosuspend, especially printers and scanners. According to http://www.microsoft.com/whdc/system/bus/USB/USBFAQ_intro.mspx 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 device. Signed-off-by: Matthew Garrett <mjg59@srcf.ucam.org> --- 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; +#ifdef CONFIG_USB_SUSPEND + /* 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_WIRELESS_CONTROLLER: + case USB_CLASS_HUB: + break; + default: + udev->autosuspend_disabled = 1; + } +#endif + /* Determine quirks */ usb_detect_quirks(udev); -- Matthew Garrett | mjg59@srcf.ucam.org -
| Davide Libenzi | Re: [patch 7/8] fdmap v2 - implement sys_socket2 |
| Bart Van Assche | Integration of SCST in the mainstream Linux kernel |
| Greg Kroah-Hartman | [PATCH 005/196] Chinese: add translation of SubmittingDrivers |
| Mariusz Kozlowski | [KJ PATCHES] mostly kmalloc + memset conversion to k[cz]alloc |
git: | |
| KOSAKI Motohiro | [bug?] tg3: Failed to load firmware "tigon/tg3_tso.bin" |
| Stefan Richter | Re: [GIT]: Networking |
| David Miller | Re: [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock(). |
| Gerrit Renker | [PATCH 0/37] dccp: Feature negotiation - last call for comments |
