usb: core: hub: Enable/disable U1/U2 in configured state
SET_FEATURE(U1/U2_ENABLE) and CLEAR_FEATURE(U1/U2) only apply while the device is in configured state. Add proper check in usb_disable_lpm() and usb_enable_lpm() for enabling/disabling device-initiated U1/U2. Signed-off-by: Thinh Nguyen <thinhn@synopsys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
d991f855cb
commit
fea3af5e03
@ -4139,7 +4139,7 @@ int usb_disable_lpm(struct usb_device *udev)
|
||||
if (!udev || !udev->parent ||
|
||||
udev->speed < USB_SPEED_SUPER ||
|
||||
!udev->lpm_capable ||
|
||||
udev->state < USB_STATE_DEFAULT)
|
||||
udev->state < USB_STATE_CONFIGURED)
|
||||
return 0;
|
||||
|
||||
hcd = bus_to_hcd(udev->bus);
|
||||
@ -4198,7 +4198,7 @@ void usb_enable_lpm(struct usb_device *udev)
|
||||
if (!udev || !udev->parent ||
|
||||
udev->speed < USB_SPEED_SUPER ||
|
||||
!udev->lpm_capable ||
|
||||
udev->state < USB_STATE_DEFAULT)
|
||||
udev->state < USB_STATE_CONFIGURED)
|
||||
return;
|
||||
|
||||
udev->lpm_disable_count--;
|
||||
|
Loading…
Reference in New Issue
Block a user