linux-uconsole/drivers/usb/core
Alan Stern 4cca966999 USB: Avoid runtime suspend loops for HCDs that can't handle suspend/resume
commit 8ef42ddd9a upstream.

Not all host controller drivers have bus-suspend and bus-resume
methods.  When one doesn't, it will cause problems if runtime PM is
enabled in the kernel.  The PM core will attempt to suspend the
controller's root hub, the suspend will fail because there is no
bus-suspend routine, and a -EBUSY error code will be returned to the
PM core.  This will cause the suspend attempt to be repeated shortly
thereafter, in a never-ending loop.

Part of the problem is that the original error code -ENOENT gets
changed to -EBUSY in usb_runtime_suspend(), on the grounds that the PM
core will interpret -ENOENT as meaning that the root hub has gotten
into a runtime-PM error state.  While this change is appropriate for
real USB devices, it's not such a good idea for a root hub.  In fact,
considering the root hub to be in a runtime-PM error state would not
be far from the truth.  Therefore this patch updates
usb_runtime_suspend() so that it adjusts error codes only for
non-root-hub devices.

Furthermore, the patch attempts to prevent the problem from occurring
in the first place by not enabling runtime PM by default for root hubs
whose host controller driver doesn't have bus_suspend and bus_resume
methods.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Reported-by: Will Deacon <will.deacon@arm.com>
Tested-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-06-11 12:03:26 -07:00
..
buffer.c USB: Core: Fix minor coding style issues 2011-01-22 19:35:39 -08:00
config.c usb: Make DELAY_INIT quirk wait 100ms between Get Configuration requests 2014-03-23 21:38:15 -07:00
devices.c Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2013-02-26 20:16:07 -08:00
devio.c usb/core/devio.c: Don't reject control message to endpoint with wrong direction bit 2013-10-05 07:13:11 -07:00
driver.c USB: Avoid runtime suspend loops for HCDs that can't handle suspend/resume 2014-06-11 12:03:26 -07:00
endpoint.c usb/endpoint: Set release callback in the struct device_type instead of in the device itself directly 2012-08-20 14:38:08 -07:00
file.c USB: rename the usb misc class from "usb" to "usbmisc" 2012-06-13 15:37:13 -07:00
generic.c USB: avoid error messages when a device is disconnected 2013-03-28 11:05:52 -07:00
hcd-pci.c USB: fix crash during hotplug of PCI USB controller card 2014-05-06 07:55:29 -07:00
hcd.c Revert "usbcore: set lpm_capable field for LPM capable root hubs" 2014-02-22 12:41:28 -08:00
hub.c USB: Avoid runtime suspend loops for HCDs that can't handle suspend/resume 2014-06-11 12:03:26 -07:00
hub.h USB: global suspend and remote wakeup don't mix 2013-08-04 16:50:50 +08:00
Kconfig USB: remove remaining instances of USB_SUSPEND 2013-05-15 13:44:44 -04:00
Makefile usb: Add driver/usb/core/(port.c,hub.h) files 2013-01-18 15:49:00 -08:00
message.c usb/core: consider link speed while looking at bMaxPower 2013-01-11 16:16:01 -08:00
notify.c usb: Add export.h for EXPORT_SYMBOL/THIS_MODULE where needed 2011-10-31 19:31:25 -04:00
otg_whitelist.h
port.c usb: Don't fail port power resume on device disconnect. 2013-09-26 17:18:12 -07:00
quirks.c usb: Add device quirk for Logitech HD Pro Webcams C920 and C930e 2014-03-23 21:38:15 -07:00
sysfs.c USB: remove CONFIG_USB_SUSPEND option 2013-03-28 11:10:22 -07:00
urb.c USB: fix urb-poison imbalance 2013-03-25 13:48:27 -07:00
usb-acpi.c usb/acpi: binding xhci root hub usb port with ACPI 2013-03-25 10:39:17 -07:00
usb.c USB patches for 3.10-rc1 2013-04-29 12:19:23 -07:00
usb.h USB: unbind all interfaces before rebinding any 2014-05-06 07:55:32 -07:00