Re: [PATCH] USB Core hub.c: prevent re-enumeration on HNP

Alan Stern <[email protected]>
Newsgroups gmane.linux.usb.devel
Message-ID <[email protected]>
On Wed, 23 May 2007, Pandita, Vikram wrote:

> New proposed patch based on your inputs:
> 
> Patch is to prevent the OTG host of doing 3 times enumeration of device when the Host suspends for HNP. The error code used in this case is ENOTSUPP.
> 
> Signed-off-by: Vikram Pandita <[email protected]>
> ---
> diff -purN -X ./dontdiff a/drivers/usb/core/hub.c c/drivers/usb/core/hub.c
> --- a/drivers/usb/core/hub.c    2007-05-13 14:24:43.000000000 +0530
> +++ c/drivers/usb/core/hub.c    2007-05-23 11:58:40.000000000 +0530
> @@ -1361,7 +1361,7 @@ int usb_new_device(struct usb_device *ud
>                         if (err < 0)
>                                 dev_dbg(&udev->dev, "HNP fail, %d\n", err);
>                 }
> -               err = -ENODEV;
> +               err = -ENOTSUPP;
>                 goto fail;
>         }
>  #endif
> @@ -2571,7 +2571,7 @@ loop:
>                 ep0_reinit(udev);
>                 release_address(udev);
>                 usb_put_dev(udev);
> -               if (status == -ENOTCONN)
> +               if ((status == -ENOTCONN) || (status == -ENOTSUPP))
>                         break;
>         }

This looks good.

Acked-by: Alan Stern <[email protected]>

Alan Stern


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.