aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb
diff options
context:
space:
mode:
authorSarah Sharp <sarah.a.sharp@linux.intel.com>2012-10-04 12:53:43 -0400
committerSarah Sharp <sarah.a.sharp@linux.intel.com>2012-10-08 14:47:40 -0400
commitd01f87c0ffa96cb44faa78710711eb6e974b891c (patch)
tree9016b46d3d84a9deaf402de534c48820787fd266 /drivers/usb
parentecefbd94b834fa32559d854646d777c56749ef1c (diff)
USB: Enable LPM after a failed probe.
Before a driver is probed, we want to disable USB 3.0 Link Power Management (LPM), in case the driver needs hub-initiated LPM disabled. After the probe finishes, we want to attempt to re-enable LPM, order to balance the LPM ref count. When a probe fails (such as when libusual doesn't want to bind to a USB 3.0 mass storage device), make sure to balance the LPM ref counts by re-enabling LPM. This patch should be backported to kernels as old as 3.5, that contain the commit 8306095fd2c1100e8244c09bf560f97aca5a311d "USB: Disable USB 3.0 LPM in critical sections." Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com> Cc: stable@vger.kernel.org
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/core/driver.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/usb/core/driver.c b/drivers/usb/core/driver.c
index ddd820d25288..6056db7af410 100644
--- a/drivers/usb/core/driver.c
+++ b/drivers/usb/core/driver.c
@@ -367,6 +367,10 @@ static int usb_probe_interface(struct device *dev)
367 intf->condition = USB_INTERFACE_UNBOUND; 367 intf->condition = USB_INTERFACE_UNBOUND;
368 usb_cancel_queued_reset(intf); 368 usb_cancel_queued_reset(intf);
369 369
370 /* If the LPM disable succeeded, balance the ref counts. */
371 if (!lpm_disable_error)
372 usb_unlocked_enable_lpm(udev);
373
370 /* Unbound interfaces are always runtime-PM-disabled and -suspended */ 374 /* Unbound interfaces are always runtime-PM-disabled and -suspended */
371 if (driver->supports_autosuspend) 375 if (driver->supports_autosuspend)
372 pm_runtime_disable(dev); 376 pm_runtime_disable(dev);