linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: Fw: usbcore missing parentheses in USE_NEW_SCHEME
       [not found] ` <S5_bTeKG4QYpmSUODHFha_LSjMOM5NMirKYBTHik11iEynJ-WjOAofdiOboo502BpM9CV2Z9xkU93MnoqGz7zdCzwLY7fpqiL5PZZ0-ByQk=@protonmail.com>
@ 2020-01-01 16:38   ` Randy Dunlap
  2020-01-02 15:22     ` Alan Stern
  0 siblings, 1 reply; 5+ messages in thread
From: Randy Dunlap @ 2020-01-01 16:38 UTC (permalink / raw)
  To: atmgnd, linux-kernel, USB list

[adding linux-usb mailing list]

On 1/1/20 6:46 AM, atmgnd wrote:
> I think there is missing parentheses in macro USE_NEW_SCHEME, it should be:
> #define USE_NEW_SCHEME(i, scheme)      ((i) / 2 == (int)(scheme))
> 
> causes a fail wiht "device descriptor read/64, error -110" using my usb drive on vmware using usb 3.0 hub.
> from https://github.com/torvalds/linux/commit/25244227158e1502062041365a439a54cb8fe673#diff-28615d62e1250eadc353d804f49bc6d6
> 
> someone changed USE_NEW_SCHEME, but without parentheses for second parameter. as result. in fuction use_new_scheme when old_scheme_first is 1, use_new_scheme will return 1 always(actullay is should return 0). it also make https://github.com/torvalds/linux/commit/bd0e6c9614b95352eb31d0207df16dc156c527fa#diff-28615d62e1250eadc353d804f49bc6d6 fails.
> 
> I cannot use git send-mail, there some issue with my network provider. patch below, :
> 
> 
> From 85f01b89d050a988f4d9fc78232de47e793c6a7c Mon Sep 17 00:00:00 2001
> From: atmgnd <atmgnd@outlook.com>
> Date: Wed, 1 Jan 2020 21:27:13 +0800
> Subject: [PATCH] usb: hub: missing parentheses in USE_NEW_SCHEME
> 
> accroding to bd0e6c9#diff-28615d62e1250eadc353d804f49bc6d6, will try old enumeration
> scheme first for high speed devices. for example, when a high speed device pluged in,
> line 2720 should expand to 0 at the first time. USE_NEW_SCHEME(0, 0 || 0 || 1) === 0.
> but it wrongly expand to 1(alway expand to 1 for high speed device), and change
> USE_NEW_SCHEME to USE_NEW_SCHEME((i) % 2 == (int)(scheme)) may be better ?
> 
> Signed-off-by: atmgnd <atmgnd@outlook.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 f229ad6952c0..7d17deca7021 100644
> --- a/drivers/usb/core/hub.c
> +++ b/drivers/usb/core/hub.c
> @@ -2692,7 +2692,7 @@ static unsigned hub_is_wusb(struct usb_hub *hub)
>  #define SET_ADDRESS_TRIES 2
>  #define GET_DESCRIPTOR_TRIES 2
>  #define SET_CONFIG_TRIES (2 * (use_both_schemes + 1))
> -#define USE_NEW_SCHEME(i, scheme) ((i) / 2 == (int)scheme)
> +#define USE_NEW_SCHEME(i, scheme) ((i) / 2 == (int)(scheme))
> 
>  #define HUB_ROOT_RESET_TIME 60 /* times are in msec */
>  #define HUB_SHORT_RESET_TIME 10
> --
> 2.17.1
> 


-- 
~Randy


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

* Re: Fw: usbcore missing parentheses in USE_NEW_SCHEME
  2020-01-01 16:38   ` Fw: usbcore missing parentheses in USE_NEW_SCHEME Randy Dunlap
@ 2020-01-02 15:22     ` Alan Stern
  2020-01-04  3:21       ` atmgnd
  2020-01-04  3:24       ` atmgnd
  0 siblings, 2 replies; 5+ messages in thread
From: Alan Stern @ 2020-01-02 15:22 UTC (permalink / raw)
  To: atmgnd, Randy Dunlap; +Cc: linux-kernel, USB list

On Wed, 1 Jan 2020, Randy Dunlap wrote:

> [adding linux-usb mailing list]
> 
> On 1/1/20 6:46 AM, atmgnd wrote:
> > I think there is missing parentheses in macro USE_NEW_SCHEME, it should be:
> > #define USE_NEW_SCHEME(i, scheme)      ((i) / 2 == (int)(scheme))
> > 
> > causes a fail wiht "device descriptor read/64, error -110" using my usb drive on vmware using usb 3.0 hub.
> > from https://github.com/torvalds/linux/commit/25244227158e1502062041365a439a54cb8fe673#diff-28615d62e1250eadc353d804f49bc6d6
> > 
> > someone changed USE_NEW_SCHEME, but without parentheses for second parameter. as result. in fuction use_new_scheme when old_scheme_first is 1, use_new_scheme will return 1 always(actullay is should return 0). it also make https://github.com/torvalds/linux/commit/bd0e6c9614b95352eb31d0207df16dc156c527fa#diff-28615d62e1250eadc353d804f49bc6d6 fails.
> > 
> > I cannot use git send-mail, there some issue with my network provider. patch below, :
> > 
> > 
> > From 85f01b89d050a988f4d9fc78232de47e793c6a7c Mon Sep 17 00:00:00 2001
> > From: atmgnd <atmgnd@outlook.com>
> > Date: Wed, 1 Jan 2020 21:27:13 +0800
> > Subject: [PATCH] usb: hub: missing parentheses in USE_NEW_SCHEME
> > 
> > accroding to bd0e6c9#diff-28615d62e1250eadc353d804f49bc6d6, will try old enumeration
> > scheme first for high speed devices. for example, when a high speed device pluged in,
> > line 2720 should expand to 0 at the first time. USE_NEW_SCHEME(0, 0 || 0 || 1) === 0.
> > but it wrongly expand to 1(alway expand to 1 for high speed device), and change
> > USE_NEW_SCHEME to USE_NEW_SCHEME((i) % 2 == (int)(scheme)) may be better ?
> > 
> > Signed-off-by: atmgnd <atmgnd@outlook.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 f229ad6952c0..7d17deca7021 100644
> > --- a/drivers/usb/core/hub.c
> > +++ b/drivers/usb/core/hub.c
> > @@ -2692,7 +2692,7 @@ static unsigned hub_is_wusb(struct usb_hub *hub)
> >  #define SET_ADDRESS_TRIES 2
> >  #define GET_DESCRIPTOR_TRIES 2
> >  #define SET_CONFIG_TRIES (2 * (use_both_schemes + 1))
> > -#define USE_NEW_SCHEME(i, scheme) ((i) / 2 == (int)scheme)
> > +#define USE_NEW_SCHEME(i, scheme) ((i) / 2 == (int)(scheme))
> > 
> >  #define HUB_ROOT_RESET_TIME 60 /* times are in msec */
> >  #define HUB_SHORT_RESET_TIME 10
> > --
> > 2.17.1

atmgnd:

Please resend this patch to Greg Kroah-Hartman
<gregkh@linuxfoundation.org> with the appropriate CC's.  Also, your
Signed-off-by: line should contain a real name, not an email userid
(you probably don't use "atmgnd" as your signature on legal
documents!).

When you resend the patch, you can include:

Acked-by: Alan Stern <stern@rowland.harvard.edu>

Alan Stern


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

* Re: Fw: usbcore missing parentheses in USE_NEW_SCHEME
  2020-01-02 15:22     ` Alan Stern
@ 2020-01-04  3:21       ` atmgnd
  2020-01-04  3:24       ` atmgnd
  1 sibling, 0 replies; 5+ messages in thread
From: atmgnd @ 2020-01-04  3:21 UTC (permalink / raw)
  To: Alan Stern; +Cc: Randy Dunlap, linux-kernel, USB list

Greg Kroah-Hartman:
here is the new patch:


From 85f01b89d050a988f4d9fc78232de47e793c6a7c Mon Sep 17 00:00:00 2001
From: Qi.Zhou <atmgnd@outlook.com>
Date: Wed, 1 Jan 2020 21:27:13 +0800
Subject: [PATCH] usb: hub: missing parentheses in USE_NEW_SCHEME

accroding to bd0e6c9#diff-28615d62e1250eadc353d804f49bc6d6, will try old enumeration
scheme first for high speed devices. for example, when a high speed device pluged in,
line 2720 should expand to 0 at the first time. USE_NEW_SCHEME(0, 0 || 0 || 1) === 0.
but it wrongly expand to 1(alway expand to 1 for high speed device), and change
USE_NEW_SCHEME to USE_NEW_SCHEME((i) % 2 == (int)(scheme)) may be better ?

Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Qi.Zhou <atmgnd@outlook.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 f229ad6952c0..7d17deca7021 100644
--- a/drivers/usb/core/hub.c
+++ b/drivers/usb/core/hub.c
@@ -2692,7 +2692,7 @@ static unsigned hub_is_wusb(struct usb_hub *hub)
 #define SET_ADDRESS_TRIES	2
 #define GET_DESCRIPTOR_TRIES	2
 #define SET_CONFIG_TRIES	(2 * (use_both_schemes + 1))
-#define USE_NEW_SCHEME(i, scheme)	((i) / 2 == (int)scheme)
+#define USE_NEW_SCHEME(i, scheme)	((i) / 2 == (int)(scheme))

 #define HUB_ROOT_RESET_TIME	60	/* times are in msec */
 #define HUB_SHORT_RESET_TIME	10
--
2.17.1



Sent with ProtonMail Secure Email.

‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
On Thursday, January 2, 2020 11:22 PM, Alan Stern <stern@rowland.harvard.edu> wrote:

> On Wed, 1 Jan 2020, Randy Dunlap wrote:
>
> > [adding linux-usb mailing list]
> > On 1/1/20 6:46 AM, atmgnd wrote:
> >
> > > I think there is missing parentheses in macro USE_NEW_SCHEME, it should be:
> > > #define USE_NEW_SCHEME(i, scheme) ((i) / 2 == (int)(scheme))
> > > causes a fail wiht "device descriptor read/64, error -110" using my usb drive on vmware using usb 3.0 hub.
> > > from https://github.com/torvalds/linux/commit/25244227158e1502062041365a439a54cb8fe673#diff-28615d62e1250eadc353d804f49bc6d6
> > > someone changed USE_NEW_SCHEME, but without parentheses for second parameter. as result. in fuction use_new_scheme when old_scheme_first is 1, use_new_scheme will return 1 always(actullay is should return 0). it also make https://github.com/torvalds/linux/commit/bd0e6c9614b95352eb31d0207df16dc156c527fa#diff-28615d62e1250eadc353d804f49bc6d6 fails.
> > > I cannot use git send-mail, there some issue with my network provider. patch below, :
> > > From 85f01b89d050a988f4d9fc78232de47e793c6a7c Mon Sep 17 00:00:00 2001
> > > From: atmgnd atmgnd@outlook.com
> > > Date: Wed, 1 Jan 2020 21:27:13 +0800
> > > Subject: [PATCH] usb: hub: missing parentheses in USE_NEW_SCHEME
> > > accroding to bd0e6c9#diff-28615d62e1250eadc353d804f49bc6d6, will try old enumeration
> > > scheme first for high speed devices. for example, when a high speed device pluged in,
> > > line 2720 should expand to 0 at the first time. USE_NEW_SCHEME(0, 0 || 0 || 1) === 0.
> > > but it wrongly expand to 1(alway expand to 1 for high speed device), and change
> > > USE_NEW_SCHEME to USE_NEW_SCHEME((i) % 2 == (int)(scheme)) may be better ?
> > >
> > > Signed-off-by: atmgnd atmgnd@outlook.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 f229ad6952c0..7d17deca7021 100644
> > > --- a/drivers/usb/core/hub.c
> > > +++ b/drivers/usb/core/hub.c
> > > @@ -2692,7 +2692,7 @@ static unsigned hub_is_wusb(struct usb_hub *hub)
> > > #define SET_ADDRESS_TRIES 2
> > > #define GET_DESCRIPTOR_TRIES 2
> > > #define SET_CONFIG_TRIES (2 * (use_both_schemes + 1))
> > > -#define USE_NEW_SCHEME(i, scheme) ((i) / 2 == (int)scheme)
> > > +#define USE_NEW_SCHEME(i, scheme) ((i) / 2 == (int)(scheme))
> > >
> > > #define HUB_ROOT_RESET_TIME 60 /* times are in msec */
> > > #define HUB_SHORT_RESET_TIME 10
> > >
> > > ---------------------------------------------------------------------------------------
> > >
> > > 2.17.1
>
> atmgnd:
>
> Please resend this patch to Greg Kroah-Hartman
> gregkh@linuxfoundation.org with the appropriate CC's. Also, your
> Signed-off-by: line should contain a real name, not an email userid
> (you probably don't use "atmgnd" as your signature on legal
> documents!).
>
> When you resend the patch, you can include:
>
> Acked-by: Alan Stern stern@rowland.harvard.edu
>
> Alan Stern



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

* Re: Fw: usbcore missing parentheses in USE_NEW_SCHEME
  2020-01-02 15:22     ` Alan Stern
  2020-01-04  3:21       ` atmgnd
@ 2020-01-04  3:24       ` atmgnd
  2020-01-04  8:46         ` gregkh
  1 sibling, 1 reply; 5+ messages in thread
From: atmgnd @ 2020-01-04  3:24 UTC (permalink / raw)
  To: Alan Stern; +Cc: Randy Dunlap, linux-kernel, USB list, gregkh

Greg Kroah-Hartman:
here is the new patch:


From 85f01b89d050a988f4d9fc78232de47e793c6a7c Mon Sep 17 00:00:00 2001
From: Qi.Zhou <atmgnd@outlook.com>
Date: Wed, 1 Jan 2020 21:27:13 +0800
Subject: [PATCH] usb: hub: missing parentheses in USE_NEW_SCHEME

accroding to bd0e6c9#diff-28615d62e1250eadc353d804f49bc6d6, will try old enumeration
scheme first for high speed devices. for example, when a high speed device pluged in,
line 2720 should expand to 0 at the first time. USE_NEW_SCHEME(0, 0 || 0 || 1) === 0.
but it wrongly expand to 1(alway expand to 1 for high speed device), and change
USE_NEW_SCHEME to USE_NEW_SCHEME((i) % 2 == (int)(scheme)) may be better ?

Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Qi.Zhou <atmgnd@outlook.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 f229ad6952c0..7d17deca7021 100644
--- a/drivers/usb/core/hub.c
+++ b/drivers/usb/core/hub.c
@@ -2692,7 +2692,7 @@ static unsigned hub_is_wusb(struct usb_hub *hub)
 #define SET_ADDRESS_TRIES	2
 #define GET_DESCRIPTOR_TRIES	2
 #define SET_CONFIG_TRIES	(2 * (use_both_schemes + 1))
-#define USE_NEW_SCHEME(i, scheme)	((i) / 2 == (int)scheme)
+#define USE_NEW_SCHEME(i, scheme)	((i) / 2 == (int)(scheme))

 #define HUB_ROOT_RESET_TIME	60	/* times are in msec */
 #define HUB_SHORT_RESET_TIME	10
--
2.17.1



Sent with ProtonMail Secure Email.

‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
On Thursday, January 2, 2020 11:22 PM, Alan Stern <stern@rowland.harvard.edu> wrote:

> On Wed, 1 Jan 2020, Randy Dunlap wrote:
>
> > [adding linux-usb mailing list]
> > On 1/1/20 6:46 AM, atmgnd wrote:
> >
> > > I think there is missing parentheses in macro USE_NEW_SCHEME, it should be:
> > > #define USE_NEW_SCHEME(i, scheme) ((i) / 2 == (int)(scheme))
> > > causes a fail wiht "device descriptor read/64, error -110" using my usb drive on vmware using usb 3.0 hub.
> > > from https://github.com/torvalds/linux/commit/25244227158e1502062041365a439a54cb8fe673#diff-28615d62e1250eadc353d804f49bc6d6
> > > someone changed USE_NEW_SCHEME, but without parentheses for second parameter. as result. in fuction use_new_scheme when old_scheme_first is 1, use_new_scheme will return 1 always(actullay is should return 0). it also make https://github.com/torvalds/linux/commit/bd0e6c9614b95352eb31d0207df16dc156c527fa#diff-28615d62e1250eadc353d804f49bc6d6 fails.
> > > I cannot use git send-mail, there some issue with my network provider. patch below, :
> > > From 85f01b89d050a988f4d9fc78232de47e793c6a7c Mon Sep 17 00:00:00 2001
> > > From: atmgnd atmgnd@outlook.com
> > > Date: Wed, 1 Jan 2020 21:27:13 +0800
> > > Subject: [PATCH] usb: hub: missing parentheses in USE_NEW_SCHEME
> > > accroding to bd0e6c9#diff-28615d62e1250eadc353d804f49bc6d6, will try old enumeration
> > > scheme first for high speed devices. for example, when a high speed device pluged in,
> > > line 2720 should expand to 0 at the first time. USE_NEW_SCHEME(0, 0 || 0 || 1) === 0.
> > > but it wrongly expand to 1(alway expand to 1 for high speed device), and change
> > > USE_NEW_SCHEME to USE_NEW_SCHEME((i) % 2 == (int)(scheme)) may be better ?
> > >
> > > Signed-off-by: atmgnd atmgnd@outlook.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 f229ad6952c0..7d17deca7021 100644
> > > --- a/drivers/usb/core/hub.c
> > > +++ b/drivers/usb/core/hub.c
> > > @@ -2692,7 +2692,7 @@ static unsigned hub_is_wusb(struct usb_hub *hub)
> > > #define SET_ADDRESS_TRIES 2
> > > #define GET_DESCRIPTOR_TRIES 2
> > > #define SET_CONFIG_TRIES (2 * (use_both_schemes + 1))
> > > -#define USE_NEW_SCHEME(i, scheme) ((i) / 2 == (int)scheme)
> > > +#define USE_NEW_SCHEME(i, scheme) ((i) / 2 == (int)(scheme))
> > >
> > > #define HUB_ROOT_RESET_TIME 60 /* times are in msec */
> > > #define HUB_SHORT_RESET_TIME 10
> > >
> > > ---------------------------------------------------------------------------------------
> > >
> > > 2.17.1
>
> atmgnd:
>
> Please resend this patch to Greg Kroah-Hartman
> gregkh@linuxfoundation.org with the appropriate CC's. Also, your
> Signed-off-by: line should contain a real name, not an email userid
> (you probably don't use "atmgnd" as your signature on legal
> documents!).
>
> When you resend the patch, you can include:
>
> Acked-by: Alan Stern stern@rowland.harvard.edu
>
> Alan Stern



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

* Re: Fw: usbcore missing parentheses in USE_NEW_SCHEME
  2020-01-04  3:24       ` atmgnd
@ 2020-01-04  8:46         ` gregkh
  0 siblings, 0 replies; 5+ messages in thread
From: gregkh @ 2020-01-04  8:46 UTC (permalink / raw)
  To: atmgnd; +Cc: Alan Stern, Randy Dunlap, linux-kernel, USB list

On Sat, Jan 04, 2020 at 03:24:04AM +0000, atmgnd wrote:
> Greg Kroah-Hartman:
> here is the new patch:
> 
> 
> >From 85f01b89d050a988f4d9fc78232de47e793c6a7c Mon Sep 17 00:00:00 2001
> From: Qi.Zhou <atmgnd@outlook.com>
> Date: Wed, 1 Jan 2020 21:27:13 +0800
> Subject: [PATCH] usb: hub: missing parentheses in USE_NEW_SCHEME

Please send this as a stand-alone patch, the header here should not be
in the body of the email.

Also, I doubt your name has a "." in it, right?  :)

See the many many examples of patches on the mailing list for examples
of how this all should look, as well as read
Documentation/SubmittingPatches.

thanks,

greg k-h

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

end of thread, other threads:[~2020-01-04  8:47 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <7sP4K0IcPrf4Z5urpZjWaiquSFhnNSNGLGsuYj8jbRl8aGGboUyknXW1w7DSBIYNUY308G2QnfDOTmblnyPKyoWMeiYwtqS6mdTxKZqfBO8=@protonmail.com>
     [not found] ` <S5_bTeKG4QYpmSUODHFha_LSjMOM5NMirKYBTHik11iEynJ-WjOAofdiOboo502BpM9CV2Z9xkU93MnoqGz7zdCzwLY7fpqiL5PZZ0-ByQk=@protonmail.com>
2020-01-01 16:38   ` Fw: usbcore missing parentheses in USE_NEW_SCHEME Randy Dunlap
2020-01-02 15:22     ` Alan Stern
2020-01-04  3:21       ` atmgnd
2020-01-04  3:24       ` atmgnd
2020-01-04  8:46         ` gregkh

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).