USB: Enable LPM after a failed probe.
authorSarah Sharp <sarah.a.sharp@linux.intel.com>
Thu, 4 Oct 2012 16:53:43 +0000 (09:53 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 28 Oct 2012 17:56:14 +0000 (10:56 -0700)
commit094c5b6410392321492c59603879f8ec7d87358a
tree693386a5229b281a7f3f74bc71987e8895f817cb
parent6a154bb60bfcbc91b515a94ee68e35c3b4b01b7c
USB: Enable LPM after a failed probe.

commit d01f87c0ffa96cb44faa78710711eb6e974b891c upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/core/driver.c