]> git.karo-electronics.de Git - karo-tx-linux.git/commit
USB: Disable LPM while the device is unconfigured.
authorSarah Sharp <sarah.a.sharp@linux.intel.com>
Wed, 4 Jul 2012 06:22:38 +0000 (23:22 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 9 Aug 2012 15:22:50 +0000 (08:22 -0700)
commit9d8d9322bf9445bc2a9241a5c64fcd98f1cb41cd
tree60e3993c5562f5225e19f595b377787d2c02163f
parent4d86eca2853bfc96b7644b00a18236876984c732
USB: Disable LPM while the device is unconfigured.

commit 9cf65991dd93ac3d5f97f536171c388918b7c1a9 upstream.

The USB 3.0 Set/Clear Feature U1/U2 Enable cannot be sent to a device in
the Default or Addressed state.  It can only be sent to a configured
device.  Change the USB core to initialize the LPM disable count to 1
(disabled), which reflects this limitation.

Change usb_set_configuration() to ensure that if the device is
unconfigured on entry, usb_lpm_disable() is not called.  This avoids
sending the Clear Feature U1/U2 when the device is in the Addressed
state.  When usb_set_configuration() exits with a successfully installed
configuration, usb_lpm_enable() will be called.

Once the new configuration is installed, make sure
usb_set_configuration() only calls usb_enable_lpm() if the device moved
to the Configured state.  If we have unconfigured the device by sending
it a Set Configuration for config 0, don't enable LPM.

This commit 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/message.c
drivers/usb/core/usb.c