Re: [PATCH] Re: [PATCH v3] USB: hub.c: decrease the number of attempts of enumeration scheme

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Sep 21, 2020 at 11:03:42PM +0900, Yasushi Asano wrote:
> From: Yasushi Asano <yasano@xxxxxxxxxxxxxx>
> 
> Dear Alan
> 
> Thank you very much for providing the patch.
> I really appreciate your kindness.
> 
> When I added a pseudo error code and checked it,
> the for statement of the "operation" in the new scheme
> runs unconditionally three times. Therefore It doesn't
> seem to meet the requirements (30seconds).
> 
> After applying your patch, I added a patch that can
> change the loop number of "operation" as shown below,
> and it worked fine in the pseudo error environment.
> Is this modification acceptable?

Ah, I missed that change.  Yes, this is the right approach.

> If it is good, I'll add this patch and test it.
> Since the PET tool is only in the customer,
> I will ask the customer to test it. I will report the
> result when I receive the results.
> 
> Signed-off-by: Yasushi Asano <yasano@xxxxxxxxxxxxxx>
> ---
>  drivers/usb/core/hub.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
> index 61effd5..2f07f7c 100644
> --- a/drivers/usb/core/hub.c
> +++ b/drivers/usb/core/hub.c
> @@ -2709,12 +2709,14 @@ static unsigned hub_is_wusb(struct usb_hub *hub)
>  #define PORT_RESET_TRIES	2
>  #define SET_ADDRESS_TRIES	1
>  #define GET_DESCRIPTOR_TRIES	1
> +#define GET_DESCRIPTOR_OPERATIONS	1
>  #define PORT_INIT_TRIES		5
>  
>  #else
>  #define PORT_RESET_TRIES	5
>  #define SET_ADDRESS_TRIES	2
>  #define GET_DESCRIPTOR_TRIES	2
> +#define GET_DESCRIPTOR_OPERATIONS	3
>  #define PORT_INIT_TRIES		4
>  #endif	/* CONFIG_USB_FEW_INIT_RETRIES */
>  
> @@ -4699,7 +4701,7 @@ hub_port_init(struct usb_hub *hub, struct usb_device *udev, int port1,
>  			 * 255 is for WUSB devices, we actually need to use
>  			 * 512 (WUSB1.0[4.8.1]).
>  			 */
> -			for (operations = 0; operations < 3; ++operations) {
> +			for (operations = 0; operations < GET_DESCRIPTOR_OPERATIONS; ++operations) {
>  				buf->bMaxPacketSize0 = 0;
>  				r = usb_control_msg(udev, usb_rcvaddr0pipe(),
>  					USB_REQ_GET_DESCRIPTOR, USB_DIR_IN,

Okay.  I will merge your change into my patch.

Alan Stern



[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux