diff options
author | Sarah Sharp <sarah.a.sharp@linux.intel.com> | 2013-08-06 03:58:15 +0200 |
---|---|---|
committer | Sarah Sharp <sarah.a.sharp@linux.intel.com> | 2013-08-15 19:52:35 +0200 |
commit | d49dad3e11638f66be4e16573ffaa8c46a09e3b3 (patch) | |
tree | 45f27d72dc8b19ca52eb530084b831a751979938 /kernel/trace/trace_uprobe.c | |
parent | usb: don't check pm qos NO_POWER_OFF flag in usb_port_suspend() (diff) | |
download | linux-d49dad3e11638f66be4e16573ffaa8c46a09e3b3.tar.xz linux-d49dad3e11638f66be4e16573ffaa8c46a09e3b3.zip |
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 ad493e5e580546e6c3024b76a41535476da1546a "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>
Diffstat (limited to 'kernel/trace/trace_uprobe.c')
0 files changed, 0 insertions, 0 deletions