linux-stable/drivers/usb/core
Sarah Sharp d49dad3e11 usb: Don't fail port power resume on device disconnect.
Userspace can tell the kernel to power off any USB port, including ones
that are visible and connectible to users.  When an attached USB device
goes into suspend, the port will be powered off if the
pm_qos_no_port_poweroff file for its port is set to 0, the device does
not have remote wakeup enabled, and the device is marked as persistent.

If the user disconnects the USB device while the port is powered off,
the current code does not handle that properly.  If you disconnect a
device, and then run `lsusb -v -s` for the device, the device disconnect
does not get handled by the USB core.  The runtime resume of the port
fails, because hub_port_debounce_be_connected() returns -ETIMEDOUT.

This means the port resume fails and khubd doesn't handle the USB device
disconnect.  This leaves the device listed in lsusb, and the port's
runtime_status will be permanently marked as "error".

Fix this by ignoring the return value of hub_port_debounce_be_connected.
Users can disconnect USB devices while the ports are powered off, and we
must be able to handle that.

This patch should be backported to kernels as old as 3.9, that
contain the commit ad493e5e58 "usb: add
usb port auto power off mechanism"

Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Cc: Lan Tianyu <tianyu.lan@intel.com>
Cc: Alan Stern <stern@rowland.harvard.edu>
Cc: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Cc: stable@vger.kernel.org
Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
2013-08-15 10:52:35 -07:00
..
buffer.c
config.c usb: Fail a get config when the port is powered off. 2012-09-10 13:04:01 -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 Merge 3.10-rc5 into usb-next 2013-06-08 21:27:51 -07:00
driver.c PM / Runtime: Rework the "runtime idle" helper routine 2013-06-03 21:49:52 +02: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: fix PTR_ERR translation in init_usb_class() 2013-06-06 12:14:38 -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: improve port transitions when EHCI starts up 2013-03-28 14:45:57 -07:00
hcd.c Allow the USB HCD to create Wireless USB root hubs 2013-06-03 10:52:40 -07:00
hub.c usb: don't check pm qos NO_POWER_OFF flag in usb_port_suspend() 2013-08-15 10:52:33 -07:00
hub.h USB: global suspend and remote wakeup don't mix 2013-07-16 15:33:02 -07: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: message: Fixed parenthesis error in sizeof function. 2013-05-17 10:09:26 -07:00
notify.c
otg_whitelist.h
port.c usb: Don't fail port power resume on device disconnect. 2013-08-15 10:52:35 -07:00
quirks.c usb: add two quirky touchscreen 2013-08-14 12:49:27 -07:00
sysfs.c usb: add usb2 Link PM variables to sysfs and usb_device 2013-06-05 16:48:40 -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: ehci: Only sleep for post-resume handover if devices use persist 2013-05-20 11:28:55 -07:00
usb.h USB: remove CONFIG_USB_SUSPEND option 2013-03-28 11:10:22 -07:00