linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH] usb: hub: try old enumeration scheme first for high speed devices
  2018-08-10 15:01 [PATCH] usb: hub: try old enumeration scheme first for high speed devices Zeng Tao
@ 2018-08-10 10:50 ` Roger Quadros
  2018-08-10 14:19   ` Alan Stern
  2018-08-14  7:33   ` Zengtao (B)
  0 siblings, 2 replies; 13+ messages in thread
From: Roger Quadros @ 2018-08-10 10:50 UTC (permalink / raw)
  To: Zeng Tao, gregkh, stern, mathias.nyman, drinkcat, felipe.balbi,
	drake, mike.looijmans, joe
  Cc: linux-usb, linux-kernel

Hi,

On 10/08/18 18:01, Zeng Tao wrote:
> The new scheme is required just to support legacy low and full-speed
> devices. For high speed devices, it will slower the enumeration speed.
> So in this patch we try the "old" enumeration scheme first for high speed
> devices.

How slow does it get? Is it significant?
Do we risk breaking existing HS devices that work? I don't think we can
be sure till we run this through testing.

> 
> Signed-off-by: Zeng Tao <prime.zeng@hisilicon.com>
> ---
>  drivers/usb/core/hub.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
> index 1fb2668..d265b19 100644
> --- a/drivers/usb/core/hub.c
> +++ b/drivers/usb/core/hub.c
> @@ -2661,10 +2661,13 @@ static bool use_new_scheme(struct usb_device *udev, int retry,
>  	int old_scheme_first_port =
>  		port_dev->quirks & USB_PORT_QUIRK_OLD_SCHEME;
>  
> +	int quick_enumeration = (udev->speed == USB_SPEED_HIGH);
> +
>  	if (udev->speed >= USB_SPEED_SUPER)
>  		return false;

how about replacing the above if with

	if (udev->speed >= USB_SPEED_HIGH)
		return false;
>  
> -	return USE_NEW_SCHEME(retry, old_scheme_first_port || old_scheme_first);
> +	return USE_NEW_SCHEME(retry, old_scheme_first_port || old_scheme_first
> +			      || quick_enumeration);
>  }

Now we no longer respect the "old_scheme_first" parameter for most of the devices.

It should be clarified in Documentation/admin/kernel-parameters.txt that
"old_scheme_first" is only applicable to LOW/FULL speed devices.

>  
>  /* Is a USB 3.0 port in the Inactive or Compliance Mode state?
> 

-- 
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH] usb: hub: try old enumeration scheme first for high speed devices
  2018-08-10 10:50 ` Roger Quadros
@ 2018-08-10 14:19   ` Alan Stern
  2018-08-14  7:35     ` Zengtao (B)
  2018-08-14  7:33   ` Zengtao (B)
  1 sibling, 1 reply; 13+ messages in thread
From: Alan Stern @ 2018-08-10 14:19 UTC (permalink / raw)
  To: Roger Quadros
  Cc: Zeng Tao, gregkh, mathias.nyman, drinkcat, felipe.balbi, drake,
	mike.looijmans, joe, linux-usb, linux-kernel

On Fri, 10 Aug 2018, Roger Quadros wrote:

> Hi,
> 
> On 10/08/18 18:01, Zeng Tao wrote:
> > The new scheme is required just to support legacy low and full-speed
> > devices. For high speed devices, it will slower the enumeration speed.
> > So in this patch we try the "old" enumeration scheme first for high speed
> > devices.
> 
> How slow does it get? Is it significant?
> Do we risk breaking existing HS devices that work? I don't think we can
> be sure till we run this through testing.

Indeed.  I am extremely skeptical about a patch like this, unless
somebody can show that Windows uses the "old" scheme for high-speed 
devices.

Alan Stern


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH] usb: hub: try old enumeration scheme first for high speed devices
@ 2018-08-10 15:01 Zeng Tao
  2018-08-10 10:50 ` Roger Quadros
  0 siblings, 1 reply; 13+ messages in thread
From: Zeng Tao @ 2018-08-10 15:01 UTC (permalink / raw)
  To: gregkh, stern, mathias.nyman, drinkcat, felipe.balbi, drake,
	mike.looijmans, joe
  Cc: Zeng Tao, linux-usb, linux-kernel

The new scheme is required just to support legacy low and full-speed
devices. For high speed devices, it will slower the enumeration speed.
So in this patch we try the "old" enumeration scheme first for high speed
devices.

Signed-off-by: Zeng Tao <prime.zeng@hisilicon.com>
---
 drivers/usb/core/hub.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
index 1fb2668..d265b19 100644
--- a/drivers/usb/core/hub.c
+++ b/drivers/usb/core/hub.c
@@ -2661,10 +2661,13 @@ static bool use_new_scheme(struct usb_device *udev, int retry,
 	int old_scheme_first_port =
 		port_dev->quirks & USB_PORT_QUIRK_OLD_SCHEME;
 
+	int quick_enumeration = (udev->speed == USB_SPEED_HIGH);
+
 	if (udev->speed >= USB_SPEED_SUPER)
 		return false;
 
-	return USE_NEW_SCHEME(retry, old_scheme_first_port || old_scheme_first);
+	return USE_NEW_SCHEME(retry, old_scheme_first_port || old_scheme_first
+			      || quick_enumeration);
 }
 
 /* Is a USB 3.0 port in the Inactive or Compliance Mode state?
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* RE: [PATCH] usb: hub: try old enumeration scheme first for high speed devices
  2018-08-10 10:50 ` Roger Quadros
  2018-08-10 14:19   ` Alan Stern
@ 2018-08-14  7:33   ` Zengtao (B)
  2018-08-16  7:31     ` Roger Quadros
  1 sibling, 1 reply; 13+ messages in thread
From: Zengtao (B) @ 2018-08-14  7:33 UTC (permalink / raw)
  To: Roger Quadros, gregkh, stern, mathias.nyman, drinkcat,
	felipe.balbi, drake, mike.looijmans, joe
  Cc: linux-usb, linux-kernel

Hi Roger:

Thank you for review

>-----Original Message-----
>From: Roger Quadros [mailto:rogerq@ti.com]
>Sent: Friday, August 10, 2018 6:51 PM
>To: Zengtao (B) <prime.zeng@hisilicon.com>; gregkh@linuxfoundation.org;
>stern@rowland.harvard.edu; mathias.nyman@linux.intel.com;
>drinkcat@chromium.org; felipe.balbi@linux.intel.com; drake@endlessm.com;
>mike.looijmans@topic.nl; joe@perches.com
>Cc: linux-usb@vger.kernel.org; linux-kernel@vger.kernel.org
>Subject: Re: [PATCH] usb: hub: try old enumeration scheme first for high speed
>devices
>
>Hi,
>
>On 10/08/18 18:01, Zeng Tao wrote:
>> The new scheme is required just to support legacy low and full-speed
>> devices. For high speed devices, it will slower the enumeration speed.
>> So in this patch we try the "old" enumeration scheme first for high
>> speed devices.
>
>How slow does it get? Is it significant?
>Do we risk breaking existing HS devices that work? I don't think we can be sure
>till we run this through testing.
>

We added the new scheme because this is what the windows did , and mainly for 
legacy low and full speed devices.
Now for new windows version(8.1 and later), the second port reset has already been
removed for high speed devices for better enumeration speed.
And In this patch if use_both_schemes is true, it will fallback to new scheme if the old
scheme fails.

So I think it's reasonable to follow the windows behavior again.

>>
>> Signed-off-by: Zeng Tao <prime.zeng@hisilicon.com>
>> ---
>>  drivers/usb/core/hub.c | 5 ++++-
>>  1 file changed, 4 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c index
>> 1fb2668..d265b19 100644
>> --- a/drivers/usb/core/hub.c
>> +++ b/drivers/usb/core/hub.c
>> @@ -2661,10 +2661,13 @@ static bool use_new_scheme(struct usb_device
>*udev, int retry,
>>  	int old_scheme_first_port =
>>  		port_dev->quirks & USB_PORT_QUIRK_OLD_SCHEME;
>>
>> +	int quick_enumeration = (udev->speed == USB_SPEED_HIGH);
>> +
>>  	if (udev->speed >= USB_SPEED_SUPER)
>>  		return false;
>
>how about replacing the above if with
>
>	if (udev->speed >= USB_SPEED_HIGH)
>		return false;

No, for SS device, only use old scheme, but for speed device, we can fallback to new 
scheme if the old fails.

>>
>> -	return USE_NEW_SCHEME(retry, old_scheme_first_port ||
>old_scheme_first);
>> +	return USE_NEW_SCHEME(retry, old_scheme_first_port ||
>old_scheme_first
>> +			      || quick_enumeration);
>>  }
>
>Now we no longer respect the "old_scheme_first" parameter for most of the
>devices.
>
>It should be clarified in Documentation/admin/kernel-parameters.txt that
>"old_scheme_first" is only applicable to LOW/FULL speed devices.
>

On the contrary, new scheme is only applicable for LOW/FULL speed devices? 

>>
>>  /* Is a USB 3.0 port in the Inactive or Compliance Mode state?
>>
>
>--
>Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
>Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki

^ permalink raw reply	[flat|nested] 13+ messages in thread

* RE: [PATCH] usb: hub: try old enumeration scheme first for high speed devices
  2018-08-10 14:19   ` Alan Stern
@ 2018-08-14  7:35     ` Zengtao (B)
  2018-08-14 14:39       ` Alan Stern
  0 siblings, 1 reply; 13+ messages in thread
From: Zengtao (B) @ 2018-08-14  7:35 UTC (permalink / raw)
  To: Alan Stern, Roger Quadros
  Cc: gregkh, mathias.nyman, drinkcat, felipe.balbi, drake,
	mike.looijmans, joe, linux-usb, linux-kernel

Hi alan: 

>-----Original Message-----
>From: linux-usb-owner@vger.kernel.org
>[mailto:linux-usb-owner@vger.kernel.org] On Behalf Of Alan Stern
>Sent: Friday, August 10, 2018 10:20 PM
>To: Roger Quadros <rogerq@ti.com>
>Cc: Zengtao (B) <prime.zeng@hisilicon.com>; gregkh@linuxfoundation.org;
>mathias.nyman@linux.intel.com; drinkcat@chromium.org;
>felipe.balbi@linux.intel.com; drake@endlessm.com; mike.looijmans@topic.nl;
>joe@perches.com; linux-usb@vger.kernel.org; linux-kernel@vger.kernel.org
>Subject: Re: [PATCH] usb: hub: try old enumeration scheme first for high speed
>devices
>
>On Fri, 10 Aug 2018, Roger Quadros wrote:
>
>> Hi,
>>
>> On 10/08/18 18:01, Zeng Tao wrote:
>> > The new scheme is required just to support legacy low and full-speed
>> > devices. For high speed devices, it will slower the enumeration speed.
>> > So in this patch we try the "old" enumeration scheme first for high
>> > speed devices.
>>
>> How slow does it get? Is it significant?
>> Do we risk breaking existing HS devices that work? I don't think we
>> can be sure till we run this through testing.
>
>Indeed.  I am extremely skeptical about a patch like this, unless somebody can
>show that Windows uses the "old" scheme for high-speed devices.

Yes, this is what the windows has done, you can refer to 
https://blogs.msdn.microsoft.com/usbcoreblog/2013/04/11/usb-2-1-2-0-1-1-device-enumeration-changes-in-windows-8/

>
>Alan Stern


^ permalink raw reply	[flat|nested] 13+ messages in thread

* RE: [PATCH] usb: hub: try old enumeration scheme first for high speed devices
  2018-08-14  7:35     ` Zengtao (B)
@ 2018-08-14 14:39       ` Alan Stern
  2018-08-16  6:21         ` Zengtao (B)
  0 siblings, 1 reply; 13+ messages in thread
From: Alan Stern @ 2018-08-14 14:39 UTC (permalink / raw)
  To: Zengtao (B)
  Cc: Roger Quadros, gregkh, mathias.nyman, drinkcat, felipe.balbi,
	drake, mike.looijmans, joe, linux-usb, linux-kernel

On Tue, 14 Aug 2018, Zengtao (B) wrote:

> Hi alan: 
> 
> >-----Original Message-----
> >From: linux-usb-owner@vger.kernel.org
> >[mailto:linux-usb-owner@vger.kernel.org] On Behalf Of Alan Stern
> >Sent: Friday, August 10, 2018 10:20 PM
> >To: Roger Quadros <rogerq@ti.com>
> >Cc: Zengtao (B) <prime.zeng@hisilicon.com>; gregkh@linuxfoundation.org;
> >mathias.nyman@linux.intel.com; drinkcat@chromium.org;
> >felipe.balbi@linux.intel.com; drake@endlessm.com; mike.looijmans@topic.nl;
> >joe@perches.com; linux-usb@vger.kernel.org; linux-kernel@vger.kernel.org
> >Subject: Re: [PATCH] usb: hub: try old enumeration scheme first for high speed
> >devices
> >
> >On Fri, 10 Aug 2018, Roger Quadros wrote:
> >
> >> Hi,
> >>
> >> On 10/08/18 18:01, Zeng Tao wrote:
> >> > The new scheme is required just to support legacy low and full-speed
> >> > devices. For high speed devices, it will slower the enumeration speed.
> >> > So in this patch we try the "old" enumeration scheme first for high
> >> > speed devices.
> >>
> >> How slow does it get? Is it significant?
> >> Do we risk breaking existing HS devices that work? I don't think we
> >> can be sure till we run this through testing.
> >
> >Indeed.  I am extremely skeptical about a patch like this, unless somebody can
> >show that Windows uses the "old" scheme for high-speed devices.
> 
> Yes, this is what the windows has done, you can refer to 
> https://blogs.msdn.microsoft.com/usbcoreblog/2013/04/11/usb-2-1-2-0-1-1-device-enumeration-changes-in-windows-8/

And that blog post is 5 years old!

Okay, I think we can go ahead and make this change.  However, you 
should update the patch description to mention what Microsoft did in 
Windows 8 and say that the new behavior matches theirs.

Also, as Roger mentioned, you should update the documentation to say 
that the old_scheme_first module parameter now applies only to low- and 
full-speed devices, since high- and SuperSpeed devices always use the 
old scheme first.

Alan Stern


^ permalink raw reply	[flat|nested] 13+ messages in thread

* RE: [PATCH] usb: hub: try old enumeration scheme first for high speed devices
  2018-08-14 14:39       ` Alan Stern
@ 2018-08-16  6:21         ` Zengtao (B)
  2018-08-16  7:16           ` Roger Quadros
  0 siblings, 1 reply; 13+ messages in thread
From: Zengtao (B) @ 2018-08-16  6:21 UTC (permalink / raw)
  To: Alan Stern
  Cc: Roger Quadros, gregkh, mathias.nyman, drinkcat, felipe.balbi,
	drake, mike.looijmans, joe, linux-usb, linux-kernel

Hi alan:

>-----Original Message-----
>From: Alan Stern [mailto:stern@rowland.harvard.edu]
>Sent: Tuesday, August 14, 2018 10:40 PM
>To: Zengtao (B) <prime.zeng@hisilicon.com>
>Cc: Roger Quadros <rogerq@ti.com>; gregkh@linuxfoundation.org;
>mathias.nyman@linux.intel.com; drinkcat@chromium.org;
>felipe.balbi@linux.intel.com; drake@endlessm.com; mike.looijmans@topic.nl;
>joe@perches.com; linux-usb@vger.kernel.org; linux-kernel@vger.kernel.org
>Subject: RE: [PATCH] usb: hub: try old enumeration scheme first for high speed
>devices
>
>On Tue, 14 Aug 2018, Zengtao (B) wrote:
>
>> Hi alan:
>>
>> >-----Original Message-----
>> >From: linux-usb-owner@vger.kernel.org
>> >[mailto:linux-usb-owner@vger.kernel.org] On Behalf Of Alan Stern
>> >Sent: Friday, August 10, 2018 10:20 PM
>> >To: Roger Quadros <rogerq@ti.com>
>> >Cc: Zengtao (B) <prime.zeng@hisilicon.com>;
>> >gregkh@linuxfoundation.org; mathias.nyman@linux.intel.com;
>> >drinkcat@chromium.org; felipe.balbi@linux.intel.com;
>> >drake@endlessm.com; mike.looijmans@topic.nl; joe@perches.com;
>> >linux-usb@vger.kernel.org; linux-kernel@vger.kernel.org
>> >Subject: Re: [PATCH] usb: hub: try old enumeration scheme first for
>> >high speed devices
>> >
>> >On Fri, 10 Aug 2018, Roger Quadros wrote:
>> >
>> >> Hi,
>> >>
>> >> On 10/08/18 18:01, Zeng Tao wrote:
>> >> > The new scheme is required just to support legacy low and
>> >> > full-speed devices. For high speed devices, it will slower the enumeration
>speed.
>> >> > So in this patch we try the "old" enumeration scheme first for
>> >> > high speed devices.
>> >>
>> >> How slow does it get? Is it significant?
>> >> Do we risk breaking existing HS devices that work? I don't think we
>> >> can be sure till we run this through testing.
>> >
>> >Indeed.  I am extremely skeptical about a patch like this, unless
>> >somebody can show that Windows uses the "old" scheme for high-speed
>devices.
>>
>> Yes, this is what the windows has done, you can refer to
>> https://blogs.msdn.microsoft.com/usbcoreblog/2013/04/11/usb-2-1-2-0-1-
>> 1-device-enumeration-changes-in-windows-8/
>
>And that blog post is 5 years old!
>
>Okay, I think we can go ahead and make this change.  However, you should
>update the patch description to mention what Microsoft did in Windows 8 and
>say that the new behavior matches theirs.
>
Okay, I will update it the change log in v2.

>Also, as Roger mentioned, you should update the documentation to say that the
>old_scheme_first module parameter now applies only to low- and full-speed
>devices, since high- and SuperSpeed devices always use the old scheme first.
>

Since we should have dedicated enumeration flow for SS, HIGH, low and full speed devices,
So I think the old_scheme_first and use_both_schemes parameters should be removed.
What do you think about it?

>Alan Stern


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH] usb: hub: try old enumeration scheme first for high speed devices
  2018-08-16  6:21         ` Zengtao (B)
@ 2018-08-16  7:16           ` Roger Quadros
  2018-08-16 10:59             ` Zengtao (B)
  0 siblings, 1 reply; 13+ messages in thread
From: Roger Quadros @ 2018-08-16  7:16 UTC (permalink / raw)
  To: Zengtao (B), Alan Stern
  Cc: gregkh, mathias.nyman, drinkcat, felipe.balbi, drake,
	mike.looijmans, joe, linux-usb, linux-kernel

On 16/08/18 09:21, Zengtao (B) wrote:
> Hi alan:
> 
>> -----Original Message-----
>> From: Alan Stern [mailto:stern@rowland.harvard.edu]
>> Sent: Tuesday, August 14, 2018 10:40 PM
>> To: Zengtao (B) <prime.zeng@hisilicon.com>
>> Cc: Roger Quadros <rogerq@ti.com>; gregkh@linuxfoundation.org;
>> mathias.nyman@linux.intel.com; drinkcat@chromium.org;
>> felipe.balbi@linux.intel.com; drake@endlessm.com; mike.looijmans@topic.nl;
>> joe@perches.com; linux-usb@vger.kernel.org; linux-kernel@vger.kernel.org
>> Subject: RE: [PATCH] usb: hub: try old enumeration scheme first for high speed
>> devices
>>
>> On Tue, 14 Aug 2018, Zengtao (B) wrote:
>>
>>> Hi alan:
>>>
>>>> -----Original Message-----
>>>> From: linux-usb-owner@vger.kernel.org
>>>> [mailto:linux-usb-owner@vger.kernel.org] On Behalf Of Alan Stern
>>>> Sent: Friday, August 10, 2018 10:20 PM
>>>> To: Roger Quadros <rogerq@ti.com>
>>>> Cc: Zengtao (B) <prime.zeng@hisilicon.com>;
>>>> gregkh@linuxfoundation.org; mathias.nyman@linux.intel.com;
>>>> drinkcat@chromium.org; felipe.balbi@linux.intel.com;
>>>> drake@endlessm.com; mike.looijmans@topic.nl; joe@perches.com;
>>>> linux-usb@vger.kernel.org; linux-kernel@vger.kernel.org
>>>> Subject: Re: [PATCH] usb: hub: try old enumeration scheme first for
>>>> high speed devices
>>>>
>>>> On Fri, 10 Aug 2018, Roger Quadros wrote:
>>>>
>>>>> Hi,
>>>>>
>>>>> On 10/08/18 18:01, Zeng Tao wrote:
>>>>>> The new scheme is required just to support legacy low and
>>>>>> full-speed devices. For high speed devices, it will slower the enumeration
>> speed.
>>>>>> So in this patch we try the "old" enumeration scheme first for
>>>>>> high speed devices.
>>>>>
>>>>> How slow does it get? Is it significant?
>>>>> Do we risk breaking existing HS devices that work? I don't think we
>>>>> can be sure till we run this through testing.
>>>>
>>>> Indeed.  I am extremely skeptical about a patch like this, unless
>>>> somebody can show that Windows uses the "old" scheme for high-speed
>> devices.
>>>
>>> Yes, this is what the windows has done, you can refer to
>>> https://blogs.msdn.microsoft.com/usbcoreblog/2013/04/11/usb-2-1-2-0-1-
>>> 1-device-enumeration-changes-in-windows-8/
>>
>> And that blog post is 5 years old!
>>
>> Okay, I think we can go ahead and make this change.  However, you should
>> update the patch description to mention what Microsoft did in Windows 8 and
>> say that the new behavior matches theirs.
>>
> Okay, I will update it the change log in v2.
> 
>> Also, as Roger mentioned, you should update the documentation to say that the
>> old_scheme_first module parameter now applies only to low- and full-speed
>> devices, since high- and SuperSpeed devices always use the old scheme first.
>>
> 
> Since we should have dedicated enumeration flow for SS, HIGH, low and full speed devices,
> So I think the old_scheme_first and use_both_schemes parameters should be removed.
> What do you think about it?

I think we should retain them as some host controllers can have issues
and these parameters give some control to system integrators to workaround if required.

I'm aware of one errata [1] that requires the old_scheme_first to be set in certain
circumstances.

[1] http://www.ti.com/lit/er/sprz429l/sprz429l.pdf
Section i897

-- 
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH] usb: hub: try old enumeration scheme first for high speed devices
  2018-08-14  7:33   ` Zengtao (B)
@ 2018-08-16  7:31     ` Roger Quadros
  0 siblings, 0 replies; 13+ messages in thread
From: Roger Quadros @ 2018-08-16  7:31 UTC (permalink / raw)
  To: Zengtao (B),
	gregkh, stern, mathias.nyman, drinkcat, felipe.balbi, drake,
	mike.looijmans, joe
  Cc: linux-usb, linux-kernel

On 14/08/18 10:33, Zengtao (B) wrote:
> Hi Roger:
> 
> Thank you for review
> 
>> -----Original Message-----
>> From: Roger Quadros [mailto:rogerq@ti.com]
>> Sent: Friday, August 10, 2018 6:51 PM
>> To: Zengtao (B) <prime.zeng@hisilicon.com>; gregkh@linuxfoundation.org;
>> stern@rowland.harvard.edu; mathias.nyman@linux.intel.com;
>> drinkcat@chromium.org; felipe.balbi@linux.intel.com; drake@endlessm.com;
>> mike.looijmans@topic.nl; joe@perches.com
>> Cc: linux-usb@vger.kernel.org; linux-kernel@vger.kernel.org
>> Subject: Re: [PATCH] usb: hub: try old enumeration scheme first for high speed
>> devices
>>
>> Hi,
>>
>> On 10/08/18 18:01, Zeng Tao wrote:
>>> The new scheme is required just to support legacy low and full-speed
>>> devices. For high speed devices, it will slower the enumeration speed.
>>> So in this patch we try the "old" enumeration scheme first for high
>>> speed devices.
>>
>> How slow does it get? Is it significant?
>> Do we risk breaking existing HS devices that work? I don't think we can be sure
>> till we run this through testing.
>>
> 
> We added the new scheme because this is what the windows did , and mainly for 
> legacy low and full speed devices.
> Now for new windows version(8.1 and later), the second port reset has already been
> removed for high speed devices for better enumeration speed.
> And In this patch if use_both_schemes is true, it will fallback to new scheme if the old
> scheme fails.
> 
> So I think it's reasonable to follow the windows behavior again.
> 
>>>
>>> Signed-off-by: Zeng Tao <prime.zeng@hisilicon.com>
>>> ---
>>>  drivers/usb/core/hub.c | 5 ++++-
>>>  1 file changed, 4 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c index
>>> 1fb2668..d265b19 100644
>>> --- a/drivers/usb/core/hub.c
>>> +++ b/drivers/usb/core/hub.c
>>> @@ -2661,10 +2661,13 @@ static bool use_new_scheme(struct usb_device
>> *udev, int retry,
>>>  	int old_scheme_first_port =
>>>  		port_dev->quirks & USB_PORT_QUIRK_OLD_SCHEME;
>>>
>>> +	int quick_enumeration = (udev->speed == USB_SPEED_HIGH);
>>> +
>>>  	if (udev->speed >= USB_SPEED_SUPER)
>>>  		return false;
>>
>> how about replacing the above if with
>>
>> 	if (udev->speed >= USB_SPEED_HIGH)
>> 		return false;
> 
> No, for SS device, only use old scheme, but for speed device, we can fallback to new 
> scheme if the old fails.

You are correct.
> 
>>>
>>> -	return USE_NEW_SCHEME(retry, old_scheme_first_port ||
>> old_scheme_first);
>>> +	return USE_NEW_SCHEME(retry, old_scheme_first_port ||
>> old_scheme_first
>>> +			      || quick_enumeration);
>>>  }
>>
>> Now we no longer respect the "old_scheme_first" parameter for most of the
>> devices.
>>
>> It should be clarified in Documentation/admin/kernel-parameters.txt that
>> "old_scheme_first" is only applicable to LOW/FULL speed devices.
>>
> 
> On the contrary, new scheme is only applicable for LOW/FULL speed devices? 

No. What I meant is that the "old_scheme_first" module parameter is now
only applicable for LOW/FULL speed devices.

As HIGH_SPEED devices will always use old scheme first after this patch.

cheers,
-roger

-- 
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki

^ permalink raw reply	[flat|nested] 13+ messages in thread

* RE: [PATCH] usb: hub: try old enumeration scheme first for high speed devices
  2018-08-16  7:16           ` Roger Quadros
@ 2018-08-16 10:59             ` Zengtao (B)
  2018-08-16 11:13               ` Roger Quadros
  0 siblings, 1 reply; 13+ messages in thread
From: Zengtao (B) @ 2018-08-16 10:59 UTC (permalink / raw)
  To: Roger Quadros, Alan Stern
  Cc: gregkh, mathias.nyman, drinkcat, felipe.balbi, drake,
	mike.looijmans, joe, linux-usb, linux-kernel

Hi Roger:

>-----Original Message-----
>From: Roger Quadros [mailto:rogerq@ti.com]
>Sent: Thursday, August 16, 2018 3:17 PM
>To: Zengtao (B) <prime.zeng@hisilicon.com>; Alan Stern
><stern@rowland.harvard.edu>
>Cc: gregkh@linuxfoundation.org; mathias.nyman@linux.intel.com;
>drinkcat@chromium.org; felipe.balbi@linux.intel.com;
>drake@endlessm.com; mike.looijmans@topic.nl; joe@perches.com;
>linux-usb@vger.kernel.org; linux-kernel@vger.kernel.org
>Subject: Re: [PATCH] usb: hub: try old enumeration scheme first for high
>speed devices
>
>On 16/08/18 09:21, Zengtao (B) wrote:
>> Hi alan:
>>
>>> -----Original Message-----
>>> From: Alan Stern [mailto:stern@rowland.harvard.edu]
>>> Sent: Tuesday, August 14, 2018 10:40 PM
>>> To: Zengtao (B) <prime.zeng@hisilicon.com>
>>> Cc: Roger Quadros <rogerq@ti.com>; gregkh@linuxfoundation.org;
>>> mathias.nyman@linux.intel.com; drinkcat@chromium.org;
>>> felipe.balbi@linux.intel.com; drake@endlessm.com;
>>> mike.looijmans@topic.nl; joe@perches.com; linux-usb@vger.kernel.org;
>>> linux-kernel@vger.kernel.org
>>> Subject: RE: [PATCH] usb: hub: try old enumeration scheme first for
>>> high speed devices
>>>
>>> On Tue, 14 Aug 2018, Zengtao (B) wrote:
>>>
>>>> Hi alan:
>>>>
>>>>> -----Original Message-----
>>>>> From: linux-usb-owner@vger.kernel.org
>>>>> [mailto:linux-usb-owner@vger.kernel.org] On Behalf Of Alan Stern
>>>>> Sent: Friday, August 10, 2018 10:20 PM
>>>>> To: Roger Quadros <rogerq@ti.com>
>>>>> Cc: Zengtao (B) <prime.zeng@hisilicon.com>;
>>>>> gregkh@linuxfoundation.org; mathias.nyman@linux.intel.com;
>>>>> drinkcat@chromium.org; felipe.balbi@linux.intel.com;
>>>>> drake@endlessm.com; mike.looijmans@topic.nl; joe@perches.com;
>>>>> linux-usb@vger.kernel.org; linux-kernel@vger.kernel.org
>>>>> Subject: Re: [PATCH] usb: hub: try old enumeration scheme first for
>>>>> high speed devices
>>>>>
>>>>> On Fri, 10 Aug 2018, Roger Quadros wrote:
>>>>>
>>>>>> Hi,
>>>>>>
>>>>>> On 10/08/18 18:01, Zeng Tao wrote:
>>>>>>> The new scheme is required just to support legacy low and
>>>>>>> full-speed devices. For high speed devices, it will slower the
>>>>>>> enumeration
>>> speed.
>>>>>>> So in this patch we try the "old" enumeration scheme first for
>>>>>>> high speed devices.
>>>>>>
>>>>>> How slow does it get? Is it significant?
>>>>>> Do we risk breaking existing HS devices that work? I don't think
>>>>>> we can be sure till we run this through testing.
>>>>>
>>>>> Indeed.  I am extremely skeptical about a patch like this, unless
>>>>> somebody can show that Windows uses the "old" scheme for
>high-speed
>>> devices.
>>>>
>>>> Yes, this is what the windows has done, you can refer to
>>>>
>https://blogs.msdn.microsoft.com/usbcoreblog/2013/04/11/usb-2-1-2-0-
>>>> 1- 1-device-enumeration-changes-in-windows-8/
>>>
>>> And that blog post is 5 years old!
>>>
>>> Okay, I think we can go ahead and make this change.  However, you
>>> should update the patch description to mention what Microsoft did in
>>> Windows 8 and say that the new behavior matches theirs.
>>>
>> Okay, I will update it the change log in v2.
>>
>>> Also, as Roger mentioned, you should update the documentation to say
>>> that the old_scheme_first module parameter now applies only to low-
>>> and full-speed devices, since high- and SuperSpeed devices always use
>the old scheme first.
>>>
>>
>> Since we should have dedicated enumeration flow for SS, HIGH, low and
>> full speed devices, So I think the old_scheme_first and use_both_schemes
>parameters should be removed.
>> What do you think about it?
>
>I think we should retain them as some host controllers can have issues and
>these parameters give some control to system integrators to workaround if
>required.
>
>I'm aware of one errata [1] that requires the old_scheme_first to be set in
>certain circumstances.
>
>[1] http://www.ti.com/lit/er/sprz429l/sprz429l.pdf
>Section i897

I 'd rather to use a quirk to workaround.
And the main idea is to keep the enumeration flow as simple as possible.

>
>--
>Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
>Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH] usb: hub: try old enumeration scheme first for high speed devices
  2018-08-16 10:59             ` Zengtao (B)
@ 2018-08-16 11:13               ` Roger Quadros
  2018-08-17  2:15                 ` Zengtao (B)
  0 siblings, 1 reply; 13+ messages in thread
From: Roger Quadros @ 2018-08-16 11:13 UTC (permalink / raw)
  To: Zengtao (B), Alan Stern
  Cc: gregkh, mathias.nyman, drinkcat, felipe.balbi, drake,
	mike.looijmans, joe, linux-usb, linux-kernel

On 16/08/18 13:59, Zengtao (B) wrote:
> Hi Roger:
> 
>> -----Original Message-----
>> From: Roger Quadros [mailto:rogerq@ti.com]
>> Sent: Thursday, August 16, 2018 3:17 PM
>> To: Zengtao (B) <prime.zeng@hisilicon.com>; Alan Stern
>> <stern@rowland.harvard.edu>
>> Cc: gregkh@linuxfoundation.org; mathias.nyman@linux.intel.com;
>> drinkcat@chromium.org; felipe.balbi@linux.intel.com;
>> drake@endlessm.com; mike.looijmans@topic.nl; joe@perches.com;
>> linux-usb@vger.kernel.org; linux-kernel@vger.kernel.org
>> Subject: Re: [PATCH] usb: hub: try old enumeration scheme first for high
>> speed devices
>>
>> On 16/08/18 09:21, Zengtao (B) wrote:
>>> Hi alan:
>>>
>>>> -----Original Message-----
>>>> From: Alan Stern [mailto:stern@rowland.harvard.edu]
>>>> Sent: Tuesday, August 14, 2018 10:40 PM
>>>> To: Zengtao (B) <prime.zeng@hisilicon.com>
>>>> Cc: Roger Quadros <rogerq@ti.com>; gregkh@linuxfoundation.org;
>>>> mathias.nyman@linux.intel.com; drinkcat@chromium.org;
>>>> felipe.balbi@linux.intel.com; drake@endlessm.com;
>>>> mike.looijmans@topic.nl; joe@perches.com; linux-usb@vger.kernel.org;
>>>> linux-kernel@vger.kernel.org
>>>> Subject: RE: [PATCH] usb: hub: try old enumeration scheme first for
>>>> high speed devices
>>>>
>>>> On Tue, 14 Aug 2018, Zengtao (B) wrote:
>>>>
>>>>> Hi alan:
>>>>>
>>>>>> -----Original Message-----
>>>>>> From: linux-usb-owner@vger.kernel.org
>>>>>> [mailto:linux-usb-owner@vger.kernel.org] On Behalf Of Alan Stern
>>>>>> Sent: Friday, August 10, 2018 10:20 PM
>>>>>> To: Roger Quadros <rogerq@ti.com>
>>>>>> Cc: Zengtao (B) <prime.zeng@hisilicon.com>;
>>>>>> gregkh@linuxfoundation.org; mathias.nyman@linux.intel.com;
>>>>>> drinkcat@chromium.org; felipe.balbi@linux.intel.com;
>>>>>> drake@endlessm.com; mike.looijmans@topic.nl; joe@perches.com;
>>>>>> linux-usb@vger.kernel.org; linux-kernel@vger.kernel.org
>>>>>> Subject: Re: [PATCH] usb: hub: try old enumeration scheme first for
>>>>>> high speed devices
>>>>>>
>>>>>> On Fri, 10 Aug 2018, Roger Quadros wrote:
>>>>>>
>>>>>>> Hi,
>>>>>>>
>>>>>>> On 10/08/18 18:01, Zeng Tao wrote:
>>>>>>>> The new scheme is required just to support legacy low and
>>>>>>>> full-speed devices. For high speed devices, it will slower the
>>>>>>>> enumeration
>>>> speed.
>>>>>>>> So in this patch we try the "old" enumeration scheme first for
>>>>>>>> high speed devices.
>>>>>>>
>>>>>>> How slow does it get? Is it significant?
>>>>>>> Do we risk breaking existing HS devices that work? I don't think
>>>>>>> we can be sure till we run this through testing.
>>>>>>
>>>>>> Indeed.  I am extremely skeptical about a patch like this, unless
>>>>>> somebody can show that Windows uses the "old" scheme for
>> high-speed
>>>> devices.
>>>>>
>>>>> Yes, this is what the windows has done, you can refer to
>>>>>
>> https://blogs.msdn.microsoft.com/usbcoreblog/2013/04/11/usb-2-1-2-0-
>>>>> 1- 1-device-enumeration-changes-in-windows-8/
>>>>
>>>> And that blog post is 5 years old!
>>>>
>>>> Okay, I think we can go ahead and make this change.  However, you
>>>> should update the patch description to mention what Microsoft did in
>>>> Windows 8 and say that the new behavior matches theirs.
>>>>
>>> Okay, I will update it the change log in v2.
>>>
>>>> Also, as Roger mentioned, you should update the documentation to say
>>>> that the old_scheme_first module parameter now applies only to low-
>>>> and full-speed devices, since high- and SuperSpeed devices always use
>> the old scheme first.
>>>>
>>>
>>> Since we should have dedicated enumeration flow for SS, HIGH, low and
>>> full speed devices, So I think the old_scheme_first and use_both_schemes
>> parameters should be removed.
>>> What do you think about it?
>>
>> I think we should retain them as some host controllers can have issues and
>> these parameters give some control to system integrators to workaround if
>> required.
>>
>> I'm aware of one errata [1] that requires the old_scheme_first to be set in
>> certain circumstances.
>>
>> [1] http://www.ti.com/lit/er/sprz429l/sprz429l.pdf
>> Section i897
> 
> I 'd rather to use a quirk to workaround.
> And the main idea is to keep the enumeration flow as simple as possible.

The workaround isn't always required. Only in certain circumstances decided
by the user.
How can a user set the quirk? Now it is as easy as setting it
in the kernel command line.

One option would be to use the old_scheme_first_port via sysfs.
/sys/bus/usb/devices/.../(hub interface)/portX/quirks

But that won't work if devices are hard-wired in the system and get enumerated
before user gets access to sysfs. We need a way to force one type of scheme
before devices are enumerated.

-- 
cheers,
-roger

Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki

^ permalink raw reply	[flat|nested] 13+ messages in thread

* RE: [PATCH] usb: hub: try old enumeration scheme first for high speed devices
  2018-08-16 11:13               ` Roger Quadros
@ 2018-08-17  2:15                 ` Zengtao (B)
  0 siblings, 0 replies; 13+ messages in thread
From: Zengtao (B) @ 2018-08-17  2:15 UTC (permalink / raw)
  To: Roger Quadros, Alan Stern
  Cc: gregkh, mathias.nyman, drinkcat, felipe.balbi, drake,
	mike.looijmans, joe, linux-usb, linux-kernel

Hi Roger:

>-----Original Message-----
>From: Roger Quadros [mailto:rogerq@ti.com]
>Sent: Thursday, August 16, 2018 7:14 PM
>To: Zengtao (B) <prime.zeng@hisilicon.com>; Alan Stern
><stern@rowland.harvard.edu>
>Cc: gregkh@linuxfoundation.org; mathias.nyman@linux.intel.com;
>drinkcat@chromium.org; felipe.balbi@linux.intel.com;
>drake@endlessm.com; mike.looijmans@topic.nl; joe@perches.com;
>linux-usb@vger.kernel.org; linux-kernel@vger.kernel.org
>Subject: Re: [PATCH] usb: hub: try old enumeration scheme first for high
>speed devices
>
>On 16/08/18 13:59, Zengtao (B) wrote:
>> Hi Roger:
>>
>>> -----Original Message-----
>>> From: Roger Quadros [mailto:rogerq@ti.com]
>>> Sent: Thursday, August 16, 2018 3:17 PM
>>> To: Zengtao (B) <prime.zeng@hisilicon.com>; Alan Stern
>>> <stern@rowland.harvard.edu>
>>> Cc: gregkh@linuxfoundation.org; mathias.nyman@linux.intel.com;
>>> drinkcat@chromium.org; felipe.balbi@linux.intel.com;
>>> drake@endlessm.com; mike.looijmans@topic.nl; joe@perches.com;
>>> linux-usb@vger.kernel.org; linux-kernel@vger.kernel.org
>>> Subject: Re: [PATCH] usb: hub: try old enumeration scheme first for
>>> high speed devices
>>>
>>> On 16/08/18 09:21, Zengtao (B) wrote:
>>>> Hi alan:
>>>>
>>>>> -----Original Message-----
>>>>> From: Alan Stern [mailto:stern@rowland.harvard.edu]
>>>>> Sent: Tuesday, August 14, 2018 10:40 PM
>>>>> To: Zengtao (B) <prime.zeng@hisilicon.com>
>>>>> Cc: Roger Quadros <rogerq@ti.com>; gregkh@linuxfoundation.org;
>>>>> mathias.nyman@linux.intel.com; drinkcat@chromium.org;
>>>>> felipe.balbi@linux.intel.com; drake@endlessm.com;
>>>>> mike.looijmans@topic.nl; joe@perches.com;
>>>>> linux-usb@vger.kernel.org; linux-kernel@vger.kernel.org
>>>>> Subject: RE: [PATCH] usb: hub: try old enumeration scheme first for
>>>>> high speed devices
>>>>>
>>>>> On Tue, 14 Aug 2018, Zengtao (B) wrote:
>>>>>
>>>>>> Hi alan:
>>>>>>
>>>>>>> -----Original Message-----
>>>>>>> From: linux-usb-owner@vger.kernel.org
>>>>>>> [mailto:linux-usb-owner@vger.kernel.org] On Behalf Of Alan Stern
>>>>>>> Sent: Friday, August 10, 2018 10:20 PM
>>>>>>> To: Roger Quadros <rogerq@ti.com>
>>>>>>> Cc: Zengtao (B) <prime.zeng@hisilicon.com>;
>>>>>>> gregkh@linuxfoundation.org; mathias.nyman@linux.intel.com;
>>>>>>> drinkcat@chromium.org; felipe.balbi@linux.intel.com;
>>>>>>> drake@endlessm.com; mike.looijmans@topic.nl;
>joe@perches.com;
>>>>>>> linux-usb@vger.kernel.org; linux-kernel@vger.kernel.org
>>>>>>> Subject: Re: [PATCH] usb: hub: try old enumeration scheme first
>>>>>>> for high speed devices
>>>>>>>
>>>>>>> On Fri, 10 Aug 2018, Roger Quadros wrote:
>>>>>>>
>>>>>>>> Hi,
>>>>>>>>
>>>>>>>> On 10/08/18 18:01, Zeng Tao wrote:
>>>>>>>>> The new scheme is required just to support legacy low and
>>>>>>>>> full-speed devices. For high speed devices, it will slower the
>>>>>>>>> enumeration
>>>>> speed.
>>>>>>>>> So in this patch we try the "old" enumeration scheme first for
>>>>>>>>> high speed devices.
>>>>>>>>
>>>>>>>> How slow does it get? Is it significant?
>>>>>>>> Do we risk breaking existing HS devices that work? I don't think
>>>>>>>> we can be sure till we run this through testing.
>>>>>>>
>>>>>>> Indeed.  I am extremely skeptical about a patch like this, unless
>>>>>>> somebody can show that Windows uses the "old" scheme for
>>> high-speed
>>>>> devices.
>>>>>>
>>>>>> Yes, this is what the windows has done, you can refer to
>>>>>>
>>> https://blogs.msdn.microsoft.com/usbcoreblog/2013/04/11/usb-2-1-2-0-
>>>>>> 1- 1-device-enumeration-changes-in-windows-8/
>>>>>
>>>>> And that blog post is 5 years old!
>>>>>
>>>>> Okay, I think we can go ahead and make this change.  However, you
>>>>> should update the patch description to mention what Microsoft did
>>>>> in Windows 8 and say that the new behavior matches theirs.
>>>>>
>>>> Okay, I will update it the change log in v2.
>>>>
>>>>> Also, as Roger mentioned, you should update the documentation to
>>>>> say that the old_scheme_first module parameter now applies only to
>>>>> low- and full-speed devices, since high- and SuperSpeed devices
>>>>> always use
>>> the old scheme first.
>>>>>
>>>>
>>>> Since we should have dedicated enumeration flow for SS, HIGH, low
>>>> and full speed devices, So I think the old_scheme_first and
>>>> use_both_schemes
>>> parameters should be removed.
>>>> What do you think about it?
>>>
>>> I think we should retain them as some host controllers can have
>>> issues and these parameters give some control to system integrators
>>> to workaround if required.
>>>
>>> I'm aware of one errata [1] that requires the old_scheme_first to be
>>> set in certain circumstances.
>>>
>>> [1] http://www.ti.com/lit/er/sprz429l/sprz429l.pdf
>>> Section i897
>>
>> I 'd rather to use a quirk to workaround.
>> And the main idea is to keep the enumeration flow as simple as possible.
>
>The workaround isn't always required. Only in certain circumstances
>decided by the user.
>How can a user set the quirk? Now it is as easy as setting it in the kernel
>command line.
>
>One option would be to use the old_scheme_first_port via sysfs.
>/sys/bus/usb/devices/.../(hub interface)/portX/quirks
>
>But that won't work if devices are hard-wired in the system and get
>enumerated before user gets access to sysfs. We need a way to force one
>type of scheme before devices are enumerated.
>

Okay, make sense, thank you for the explanation.

>--
>cheers,
>-roger
>
>Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
>Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH] usb: hub: try old enumeration scheme first for high speed devices
@ 2018-09-28 11:27 Zeng Tao
  0 siblings, 0 replies; 13+ messages in thread
From: Zeng Tao @ 2018-09-28 11:27 UTC (permalink / raw)
  To: gregkh, stern, mathias.nyman, drinkcat, felipe.balbi, drake,
	ravisadineni, joe
  Cc: prime.zeng, Jonathan Corbet, Thomas Gleixner, Ingo Molnar,
	Bjorn Helgaas, Kai-Heng Feng, Thymo van Beers, Jiri Kosina,
	Konrad Rzeszutek Wilk, Frederic Weisbecker, David Rientjes,
	linux-doc, linux-kernel, linux-usb

The new scheme is required just to support legacy low and full-speed
devices. For high speed devices, it will slower the enumeration speed.
So in this patch we try the "old" enumeration scheme first for high speed
devices, and this is what Windows does since Windows 8.

Signed-off-by: Zeng Tao <prime.zeng@hisilicon.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Reviewed-by: Roger Quadros <rogerq@ti.com>
---
 Documentation/admin-guide/kernel-parameters.txt | 3 ++-
 drivers/usb/core/hub.c                          | 4 +++-
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt
index 92eb1f4..151c527 100644
--- a/Documentation/admin-guide/kernel-parameters.txt
+++ b/Documentation/admin-guide/kernel-parameters.txt
@@ -4610,7 +4610,8 @@
 
 	usbcore.old_scheme_first=
 			[USB] Start with the old device initialization
-			scheme (default 0 = off).
+			scheme,  applies only to low and full-speed devices
+			 (default 0 = off).
 
 	usbcore.usbfs_memory_mb=
 			[USB] Memory limit (in MB) for buffers allocated by
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
index 462ce49..fb4e6bb 100644
--- a/drivers/usb/core/hub.c
+++ b/drivers/usb/core/hub.c
@@ -2660,11 +2660,13 @@ static bool use_new_scheme(struct usb_device *udev, int retry,
 {
 	int old_scheme_first_port =
 		port_dev->quirks & USB_PORT_QUIRK_OLD_SCHEME;
+	int quick_enumeration = (udev->speed == USB_SPEED_HIGH);
 
 	if (udev->speed >= USB_SPEED_SUPER)
 		return false;
 
-	return USE_NEW_SCHEME(retry, old_scheme_first_port || old_scheme_first);
+	return USE_NEW_SCHEME(retry, old_scheme_first_port || old_scheme_first
+			      || quick_enumeration);
 }
 
 /* Is a USB 3.0 port in the Inactive or Compliance Mode state?
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2018-09-28  3:24 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-10 15:01 [PATCH] usb: hub: try old enumeration scheme first for high speed devices Zeng Tao
2018-08-10 10:50 ` Roger Quadros
2018-08-10 14:19   ` Alan Stern
2018-08-14  7:35     ` Zengtao (B)
2018-08-14 14:39       ` Alan Stern
2018-08-16  6:21         ` Zengtao (B)
2018-08-16  7:16           ` Roger Quadros
2018-08-16 10:59             ` Zengtao (B)
2018-08-16 11:13               ` Roger Quadros
2018-08-17  2:15                 ` Zengtao (B)
2018-08-14  7:33   ` Zengtao (B)
2018-08-16  7:31     ` Roger Quadros
2018-09-28 11:27 Zeng Tao

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).