From f468f7b9467b285b87ea61e2a3c8c0e641117b0e Mon Sep 17 00:00:00 2001 From: Sarah Sharp Date: Tue, 8 Oct 2013 08:28:43 -0700 Subject: usb: Push USB2 LPM disable on disconnect into USB core. The USB core currently handles enabling and disabling optional USB power management features during device transitions (device suspend/resume, driver bind/unbind, device reset, and device disconnect). Those optional power features include Latency Tolerance Messaging (LTM), USB 3.0 Link PM, and USB 2.0 Link PM. The USB core currently enables LPM on device enumeration and disables USB 2.0 Link PM when the device is reset. However, the xHCI driver disables LPM when the device is disconnected and the device context is freed. Push the call up into the USB core, in order to be consistent with the core handling all power management enabling and disabling. Signed-off-by: Sarah Sharp --- drivers/usb/core/message.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'drivers/usb/core/message.c') diff --git a/drivers/usb/core/message.c b/drivers/usb/core/message.c index 82927e1ed27d..bb315970e475 100644 --- a/drivers/usb/core/message.c +++ b/drivers/usb/core/message.c @@ -1182,8 +1182,12 @@ void usb_disable_device(struct usb_device *dev, int skip_ep0) put_device(&dev->actconfig->interface[i]->dev); dev->actconfig->interface[i] = NULL; } + + if (dev->usb2_hw_lpm_enabled == 1) + usb_set_usb2_hardware_lpm(dev, 0); usb_unlocked_disable_lpm(dev); usb_disable_ltm(dev); + dev->actconfig = NULL; if (dev->state == USB_STATE_CONFIGURED) usb_set_device_state(dev, USB_STATE_ADDRESS); -- cgit v1.2.3