On Mon, 2 Sep 2013, Xenia Ragiadakou wrote:

> This patch adds a check to ensure that the device's state is not NOTATTACHED,
> ATTACHED, POWERED or RECONNECTING before trying to disable lpm, because if
> the device is in one of those states the control transfer to disable
> device-initiated LPM will fail (as well as any transfer, since 
> usb_submit_urb()
> will fail).
> 
> Signed-off-by: Xenia Ragiadakou <burzalod...@gmail.com>
> Reported-by: Martin MOKREJS <mmokr...@gmail.com>
> ---
>  drivers/usb/core/hub.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
> index fe8d95d..a6c10f0 100644
> --- a/drivers/usb/core/hub.c
> +++ b/drivers/usb/core/hub.c
> @@ -3716,7 +3716,7 @@ int usb_disable_lpm(struct usb_device *udev)
>  {
>       struct usb_hcd *hcd;
>  
> -     if (!udev || !udev->parent ||
> +     if (!udev || udev->state < USB_STATE_UNAUTHENTICATED || !udev->parent ||
>                       udev->speed != USB_SPEED_SUPER ||
>                       !udev->lpm_capable)
>               return 0;

You should ask Sarah to check this out, because link power management
is used only with USB-3 devices.

Alan Stern

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to