Re: [PATCH] usbcore: fix BABBLE failed enumeration of legacy USB2 devices on USB3 bus

2014-01-17 Thread Jérôme Carretero
Hi,


I encountered the same problem with another device.
If possible, it would be nice to pick Marius's patch for stable
kernels (tested here on v3.12.6).

There are chances that MacOSX is affected by a similar issue,
so if anybody has friends there...


Thanks,

-- 
Jérôme


On Wed, 8 Jan 2014 04:00:22 +
"Marius  Silaghi"  wrote:

> 
> Great observation,
> Sarah located a patch that is queued for the 3.14 kernel and that has
> a similar effect. So future kernels could work with that one as well.
> 
> The patch I provided (being very small and safe) can still be
> suggested for maintainers of older kernels in various long-term
> maintained distributions (if you know who is doing that).
> 
> Here are some versions of the patch I made for current kernels:
> 
> The next one was tested on Ubuntu, applied to the source for
> 3.5.0-17-generic (Ubuntu)
> 
> --- linux-3.5.0/drivers/usb/core/hub.c.orig   2014-01-07
> 18:16:01.997031650 -0500 +++
> linux-3.5.0/drivers/usb/core/hub.c2014-01-07
> 18:19:41.617022465 -0500 @@ -4043,7 +4043,11 @@ break;
>   }
>  
> - retval = usb_get_device_descriptor(udev, 8);
> + if (!USE_NEW_SCHEME(retry_counter))
> +   retval = usb_get_device_descriptor(udev, 8);
> + else
> +   retval = usb_get_device_descriptor(udev,
> + sizeof(struct usb_device_descriptor));
>   if (retval < 8) {
>   dev_err(>dev,
>   "device descriptor read/8,
> error %d\n",
> 
> 
> 
> For kernel 3.9.0-0.4
> 
> --- linux-3.5.0/drivers/usb/core/hub.c.orig   2014-01-07
> 18:16:01.997031650 -0500 +++
> linux-3.5.0/drivers/usb/core/hub.c2014-01-07
> 18:19:41.617022465 -0500 @@ -4043,7 +4043,11 @@ break;
>   }
>  
> - retval = usb_get_device_descriptor(udev, 8);
> + if (!USE_NEW_SCHEME(retry_counter))
> +   retval = usb_get_device_descriptor(udev, 8);
> + else
> +   retval = usb_get_device_descriptor(udev,
> + sizeof(struct usb_device_descriptor));
>   if (retval < 8) {
>   dev_err(>dev,
>   "device descriptor read/8,
> error %d\n",
> 
> 
> 
> For kernel 3.10.0-5.15
> 
> --- ubuntu-saucy/drivers/usb/core/hub.c.orig  2014-01-07
> 16:52:41.300835262 -0500 +++
> ubuntu-saucy/drivers/usb/core/hub.c   2014-01-07
> 16:54:53.612829730 -0500 @@ -4126,8 +4126,11 @@ if
> (USE_NEW_SCHEME(retry_counter) && !(hcd->driver->flags & HCD_USB3))
> break; }
> -
> - retval = usb_get_device_descriptor(udev, 8);
> + if (!USE_NEW_SCHEME(retry_counter))
> +   retval = usb_get_device_descriptor(udev, 8);
> + else
> +   retval = usb_get_device_descriptor(udev,
> + sizeof(struct usb_device_descriptor));
>   if (retval < 8) {
>   if (retval != -ENODEV)
>   dev_err(>dev,
> 
> 
> For kernel 3.11
> --- linux-3.11/drivers/usb/core/hub.c.orig2014-01-07
> 16:57:16.352823760 -0500 +++ linux-3.11/drivers/usb/core/hub.c
> 2014-01-07 16:58:10.168821508 -0500 @@ -4161,7 +4161,11 @@
>   break;
>   }
>  
> - retval = usb_get_device_descriptor(udev, 8);
> + if (!USE_NEW_SCHEME(retry_counter))
> +   retval = usb_get_device_descriptor(udev, 8);
> + else
> +   retval = usb_get_device_descriptor(udev,
> + sizeof(struct usb_device_descriptor));
>   if (retval < 8) {
>   if (retval != -ENODEV)
>   dev_err(>dev,
> 
> 
> ____
> From: linux-usb-ow...@vger.kernel.org
> [linux-usb-ow...@vger.kernel.org] on behalf of Greg Kroah-Hartman
> [gre...@linuxfoundation.org] Sent: Tuesday, January 07, 2014 19:32
> To: Marius  Silaghi Cc: Sarah Sharp; linux-...@vger.kernel.org;
> linux-kernel@vger.kernel.org; Alan Stern; Lan Tianyu; Xenia
> Ragiadakou; Jiri Kosina Subject: Re: [PATCH] usbcore: fix BABBLE
> failed enumeration of legacy USB2 devices on USB3 bus
> 
> On Tue, Dec 24, 2013 at 04:19:18AM +, Marius  Silaghi wrote:
> > From: Marius C Silaghi 
> >
> > This patch is generated against the last kernel version in the
> > github kernel repository.
> 

Re: [PATCH] usbcore: fix BABBLE failed enumeration of legacy USB2 devices on USB3 bus

2014-01-17 Thread Jérôme Carretero
Hi,


I encountered the same problem with another device.
If possible, it would be nice to pick Marius's patch for stable
kernels (tested here on v3.12.6).

There are chances that MacOSX is affected by a similar issue,
so if anybody has friends there...


Thanks,

-- 
Jérôme


On Wed, 8 Jan 2014 04:00:22 +
Marius  Silaghi msila...@fit.edu wrote:

 
 Great observation,
 Sarah located a patch that is queued for the 3.14 kernel and that has
 a similar effect. So future kernels could work with that one as well.
 
 The patch I provided (being very small and safe) can still be
 suggested for maintainers of older kernels in various long-term
 maintained distributions (if you know who is doing that).
 
 Here are some versions of the patch I made for current kernels:
 
 The next one was tested on Ubuntu, applied to the source for
 3.5.0-17-generic (Ubuntu)
 
 --- linux-3.5.0/drivers/usb/core/hub.c.orig   2014-01-07
 18:16:01.997031650 -0500 +++
 linux-3.5.0/drivers/usb/core/hub.c2014-01-07
 18:19:41.617022465 -0500 @@ -4043,7 +4043,11 @@ break;
   }
  
 - retval = usb_get_device_descriptor(udev, 8);
 + if (!USE_NEW_SCHEME(retry_counter))
 +   retval = usb_get_device_descriptor(udev, 8);
 + else
 +   retval = usb_get_device_descriptor(udev,
 + sizeof(struct usb_device_descriptor));
   if (retval  8) {
   dev_err(udev-dev,
   device descriptor read/8,
 error %d\n,
 
 
 
 For kernel 3.9.0-0.4
 
 --- linux-3.5.0/drivers/usb/core/hub.c.orig   2014-01-07
 18:16:01.997031650 -0500 +++
 linux-3.5.0/drivers/usb/core/hub.c2014-01-07
 18:19:41.617022465 -0500 @@ -4043,7 +4043,11 @@ break;
   }
  
 - retval = usb_get_device_descriptor(udev, 8);
 + if (!USE_NEW_SCHEME(retry_counter))
 +   retval = usb_get_device_descriptor(udev, 8);
 + else
 +   retval = usb_get_device_descriptor(udev,
 + sizeof(struct usb_device_descriptor));
   if (retval  8) {
   dev_err(udev-dev,
   device descriptor read/8,
 error %d\n,
 
 
 
 For kernel 3.10.0-5.15
 
 --- ubuntu-saucy/drivers/usb/core/hub.c.orig  2014-01-07
 16:52:41.300835262 -0500 +++
 ubuntu-saucy/drivers/usb/core/hub.c   2014-01-07
 16:54:53.612829730 -0500 @@ -4126,8 +4126,11 @@ if
 (USE_NEW_SCHEME(retry_counter)  !(hcd-driver-flags  HCD_USB3))
 break; }
 -
 - retval = usb_get_device_descriptor(udev, 8);
 + if (!USE_NEW_SCHEME(retry_counter))
 +   retval = usb_get_device_descriptor(udev, 8);
 + else
 +   retval = usb_get_device_descriptor(udev,
 + sizeof(struct usb_device_descriptor));
   if (retval  8) {
   if (retval != -ENODEV)
   dev_err(udev-dev,
 
 
 For kernel 3.11
 --- linux-3.11/drivers/usb/core/hub.c.orig2014-01-07
 16:57:16.352823760 -0500 +++ linux-3.11/drivers/usb/core/hub.c
 2014-01-07 16:58:10.168821508 -0500 @@ -4161,7 +4161,11 @@
   break;
   }
  
 - retval = usb_get_device_descriptor(udev, 8);
 + if (!USE_NEW_SCHEME(retry_counter))
 +   retval = usb_get_device_descriptor(udev, 8);
 + else
 +   retval = usb_get_device_descriptor(udev,
 + sizeof(struct usb_device_descriptor));
   if (retval  8) {
   if (retval != -ENODEV)
   dev_err(udev-dev,
 
 
 
 From: linux-usb-ow...@vger.kernel.org
 [linux-usb-ow...@vger.kernel.org] on behalf of Greg Kroah-Hartman
 [gre...@linuxfoundation.org] Sent: Tuesday, January 07, 2014 19:32
 To: Marius  Silaghi Cc: Sarah Sharp; linux-...@vger.kernel.org;
 linux-kernel@vger.kernel.org; Alan Stern; Lan Tianyu; Xenia
 Ragiadakou; Jiri Kosina Subject: Re: [PATCH] usbcore: fix BABBLE
 failed enumeration of legacy USB2 devices on USB3 bus
 
 On Tue, Dec 24, 2013 at 04:19:18AM +, Marius  Silaghi wrote:
  From: Marius C Silaghi msila...@fit.edu
 
  This patch is generated against the last kernel version in the
  github kernel repository.
 
 We work off of the git.kernel.org trees, not github :)
 
 
  Some older families of USB2 cameras (STC-XUSB) do not support
  querying only the first 8 bytes of their device descriptor and
  therefore fail at enumeration on USB3 HCDs, with babble error -75
  as they send more than the expected 8 bytes. The proposed patch
  extends the mechanism used for non USB3 HCDs in the first part of
  the same function, and  successively tries to query both the 8 byte
  prefix of the device

RE: [PATCH] usbcore: fix BABBLE failed enumeration of legacy USB2 devices on USB3 bus

2014-01-07 Thread Marius Silaghi

Great observation,
Sarah located a patch that is queued for the 3.14 kernel and that has a similar 
effect. So future kernels could work with that one as well.

The patch I provided (being very small and safe) can still be suggested for 
maintainers of older kernels in various long-term maintained distributions (if 
you know who is doing that).

Here are some versions of the patch I made for current kernels:

The next one was tested on Ubuntu, applied to the source for 3.5.0-17-generic 
(Ubuntu)

--- linux-3.5.0/drivers/usb/core/hub.c.orig 2014-01-07 18:16:01.997031650 
-0500
+++ linux-3.5.0/drivers/usb/core/hub.c  2014-01-07 18:19:41.617022465 -0500
@@ -4043,7 +4043,11 @@
break;
}
 
-   retval = usb_get_device_descriptor(udev, 8);
+   if (!USE_NEW_SCHEME(retry_counter))
+ retval = usb_get_device_descriptor(udev, 8);
+   else
+ retval = usb_get_device_descriptor(udev,
+   sizeof(struct usb_device_descriptor));
if (retval < 8) {
dev_err(>dev,
"device descriptor read/8, error %d\n",



For kernel 3.9.0-0.4

--- linux-3.5.0/drivers/usb/core/hub.c.orig 2014-01-07 18:16:01.997031650 
-0500
+++ linux-3.5.0/drivers/usb/core/hub.c  2014-01-07 18:19:41.617022465 -0500
@@ -4043,7 +4043,11 @@
break;
}
 
-   retval = usb_get_device_descriptor(udev, 8);
+   if (!USE_NEW_SCHEME(retry_counter))
+ retval = usb_get_device_descriptor(udev, 8);
+   else
+ retval = usb_get_device_descriptor(udev,
+   sizeof(struct usb_device_descriptor));
if (retval < 8) {
dev_err(>dev,
"device descriptor read/8, error %d\n",



For kernel 3.10.0-5.15

--- ubuntu-saucy/drivers/usb/core/hub.c.orig2014-01-07 16:52:41.300835262 
-0500
+++ ubuntu-saucy/drivers/usb/core/hub.c 2014-01-07 16:54:53.612829730 -0500
@@ -4126,8 +4126,11 @@
if (USE_NEW_SCHEME(retry_counter) && 
!(hcd->driver->flags & HCD_USB3))
break;
}
-
-   retval = usb_get_device_descriptor(udev, 8);
+   if (!USE_NEW_SCHEME(retry_counter))
+ retval = usb_get_device_descriptor(udev, 8);
+   else
+ retval = usb_get_device_descriptor(udev,
+   sizeof(struct usb_device_descriptor));
if (retval < 8) {
if (retval != -ENODEV)
dev_err(>dev,


For kernel 3.11
--- linux-3.11/drivers/usb/core/hub.c.orig  2014-01-07 16:57:16.352823760 
-0500
+++ linux-3.11/drivers/usb/core/hub.c   2014-01-07 16:58:10.168821508 -0500
@@ -4161,7 +4161,11 @@
break;
}
 
-   retval = usb_get_device_descriptor(udev, 8);
+   if (!USE_NEW_SCHEME(retry_counter))
+ retval = usb_get_device_descriptor(udev, 8);
+   else
+ retval = usb_get_device_descriptor(udev,
+   sizeof(struct usb_device_descriptor));
if (retval < 8) {
if (retval != -ENODEV)
dev_err(>dev,



From: linux-usb-ow...@vger.kernel.org [linux-usb-ow...@vger.kernel.org] on 
behalf of Greg Kroah-Hartman [gre...@linuxfoundation.org]
Sent: Tuesday, January 07, 2014 19:32
To: Marius  Silaghi
Cc: Sarah Sharp; linux-...@vger.kernel.org; linux-kernel@vger.kernel.org; Alan 
Stern; Lan Tianyu; Xenia Ragiadakou; Jiri Kosina
Subject: Re: [PATCH] usbcore: fix BABBLE failed enumeration of legacy USB2 
devices on USB3 bus

On Tue, Dec 24, 2013 at 04:19:18AM +, Marius  Silaghi wrote:
> From: Marius C Silaghi 
>
> This patch is generated against the last kernel version in the github kernel 
> repository.

We work off of the git.kernel.org trees, not github :)


> Some older families of USB2 cameras (STC-XUSB) do not support querying 
> only the first 8 bytes of their
> device descriptor and therefore fail at enumeration on USB3 HCDs, with babble 
> error -75 as they send more than
> the expected 8 bytes. The proposed patch extends the mechanism used for non 
> USB3 HCDs in the first part of
> the same function, and  successively tries to query both the 8 byte prefix of 
> the device descriptor, as well as
> the whole device descriptor (in case the old style query of the 8 byte prefix 
> fails).
> In fact

Re: [PATCH] usbcore: fix BABBLE failed enumeration of legacy USB2 devices on USB3 bus

2014-01-07 Thread Greg Kroah-Hartman
On Tue, Dec 24, 2013 at 04:19:18AM +, Marius  Silaghi wrote:
> From: Marius C Silaghi 
> 
> This patch is generated against the last kernel version in the github kernel 
> repository.

We work off of the git.kernel.org trees, not github :)


> Some older families of USB2 cameras (STC-XUSB) do not support querying 
> only the first 8 bytes of their 
> device descriptor and therefore fail at enumeration on USB3 HCDs, with babble 
> error -75 as they send more than
> the expected 8 bytes. The proposed patch extends the mechanism used for non 
> USB3 HCDs in the first part of 
> the same function, and  successively tries to query both the 8 byte prefix of 
> the device descriptor, as well as 
> the whole device descriptor (in case the old style query of the 8 byte prefix 
> fails).
> In fact, for the cameras I try to fix, the preferred condition is the 
> negation of the one in the proposed patch,  
> "if (!USE_NEW_SCHEME(retry_counter))", to try first the version successful on 
> this case, but I keep the 
> current order of the "if" branches to ensure clean continuation of support 
> for other supported devices.
> 
> Signed-off-by: Marius C Silaghi 

I'll let Sarah take this patch, if it passes her testing.

thanks,

greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] usbcore: fix BABBLE failed enumeration of legacy USB2 devices on USB3 bus

2014-01-07 Thread Greg Kroah-Hartman
On Tue, Dec 24, 2013 at 04:19:18AM +, Marius  Silaghi wrote:
 From: Marius C Silaghi msila...@fit.edu
 
 This patch is generated against the last kernel version in the github kernel 
 repository.

We work off of the git.kernel.org trees, not github :)


 Some older families of USB2 cameras (STC-XUSB) do not support querying 
 only the first 8 bytes of their 
 device descriptor and therefore fail at enumeration on USB3 HCDs, with babble 
 error -75 as they send more than
 the expected 8 bytes. The proposed patch extends the mechanism used for non 
 USB3 HCDs in the first part of 
 the same function, and  successively tries to query both the 8 byte prefix of 
 the device descriptor, as well as 
 the whole device descriptor (in case the old style query of the 8 byte prefix 
 fails).
 In fact, for the cameras I try to fix, the preferred condition is the 
 negation of the one in the proposed patch,  
 if (!USE_NEW_SCHEME(retry_counter)), to try first the version successful on 
 this case, but I keep the 
 current order of the if branches to ensure clean continuation of support 
 for other supported devices.
 
 Signed-off-by: Marius C Silaghi msila...@fit.edu

I'll let Sarah take this patch, if it passes her testing.

thanks,

greg k-h
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


RE: [PATCH] usbcore: fix BABBLE failed enumeration of legacy USB2 devices on USB3 bus

2014-01-07 Thread Marius Silaghi

Great observation,
Sarah located a patch that is queued for the 3.14 kernel and that has a similar 
effect. So future kernels could work with that one as well.

The patch I provided (being very small and safe) can still be suggested for 
maintainers of older kernels in various long-term maintained distributions (if 
you know who is doing that).

Here are some versions of the patch I made for current kernels:

The next one was tested on Ubuntu, applied to the source for 3.5.0-17-generic 
(Ubuntu)

--- linux-3.5.0/drivers/usb/core/hub.c.orig 2014-01-07 18:16:01.997031650 
-0500
+++ linux-3.5.0/drivers/usb/core/hub.c  2014-01-07 18:19:41.617022465 -0500
@@ -4043,7 +4043,11 @@
break;
}
 
-   retval = usb_get_device_descriptor(udev, 8);
+   if (!USE_NEW_SCHEME(retry_counter))
+ retval = usb_get_device_descriptor(udev, 8);
+   else
+ retval = usb_get_device_descriptor(udev,
+   sizeof(struct usb_device_descriptor));
if (retval  8) {
dev_err(udev-dev,
device descriptor read/8, error %d\n,



For kernel 3.9.0-0.4

--- linux-3.5.0/drivers/usb/core/hub.c.orig 2014-01-07 18:16:01.997031650 
-0500
+++ linux-3.5.0/drivers/usb/core/hub.c  2014-01-07 18:19:41.617022465 -0500
@@ -4043,7 +4043,11 @@
break;
}
 
-   retval = usb_get_device_descriptor(udev, 8);
+   if (!USE_NEW_SCHEME(retry_counter))
+ retval = usb_get_device_descriptor(udev, 8);
+   else
+ retval = usb_get_device_descriptor(udev,
+   sizeof(struct usb_device_descriptor));
if (retval  8) {
dev_err(udev-dev,
device descriptor read/8, error %d\n,



For kernel 3.10.0-5.15

--- ubuntu-saucy/drivers/usb/core/hub.c.orig2014-01-07 16:52:41.300835262 
-0500
+++ ubuntu-saucy/drivers/usb/core/hub.c 2014-01-07 16:54:53.612829730 -0500
@@ -4126,8 +4126,11 @@
if (USE_NEW_SCHEME(retry_counter)  
!(hcd-driver-flags  HCD_USB3))
break;
}
-
-   retval = usb_get_device_descriptor(udev, 8);
+   if (!USE_NEW_SCHEME(retry_counter))
+ retval = usb_get_device_descriptor(udev, 8);
+   else
+ retval = usb_get_device_descriptor(udev,
+   sizeof(struct usb_device_descriptor));
if (retval  8) {
if (retval != -ENODEV)
dev_err(udev-dev,


For kernel 3.11
--- linux-3.11/drivers/usb/core/hub.c.orig  2014-01-07 16:57:16.352823760 
-0500
+++ linux-3.11/drivers/usb/core/hub.c   2014-01-07 16:58:10.168821508 -0500
@@ -4161,7 +4161,11 @@
break;
}
 
-   retval = usb_get_device_descriptor(udev, 8);
+   if (!USE_NEW_SCHEME(retry_counter))
+ retval = usb_get_device_descriptor(udev, 8);
+   else
+ retval = usb_get_device_descriptor(udev,
+   sizeof(struct usb_device_descriptor));
if (retval  8) {
if (retval != -ENODEV)
dev_err(udev-dev,



From: linux-usb-ow...@vger.kernel.org [linux-usb-ow...@vger.kernel.org] on 
behalf of Greg Kroah-Hartman [gre...@linuxfoundation.org]
Sent: Tuesday, January 07, 2014 19:32
To: Marius  Silaghi
Cc: Sarah Sharp; linux-...@vger.kernel.org; linux-kernel@vger.kernel.org; Alan 
Stern; Lan Tianyu; Xenia Ragiadakou; Jiri Kosina
Subject: Re: [PATCH] usbcore: fix BABBLE failed enumeration of legacy USB2 
devices on USB3 bus

On Tue, Dec 24, 2013 at 04:19:18AM +, Marius  Silaghi wrote:
 From: Marius C Silaghi msila...@fit.edu

 This patch is generated against the last kernel version in the github kernel 
 repository.

We work off of the git.kernel.org trees, not github :)


 Some older families of USB2 cameras (STC-XUSB) do not support querying 
 only the first 8 bytes of their
 device descriptor and therefore fail at enumeration on USB3 HCDs, with babble 
 error -75 as they send more than
 the expected 8 bytes. The proposed patch extends the mechanism used for non 
 USB3 HCDs in the first part of
 the same function, and  successively tries to query both the 8 byte prefix of 
 the device descriptor, as well as
 the whole device descriptor (in case the old style query of the 8 byte prefix 
 fails).
 In fact, for the cameras I try to fix, the preferred condition is the 
 negation of the one in the proposed patch

[PATCH] usbcore: fix BABBLE failed enumeration of legacy USB2 devices on USB3 bus

2013-12-23 Thread Marius Silaghi
From: Marius C Silaghi 

This patch is generated against the last kernel version in the github kernel 
repository.
Some older families of USB2 cameras (STC-XUSB) do not support querying only 
the first 8 bytes of their 
device descriptor and therefore fail at enumeration on USB3 HCDs, with babble 
error -75 as they send more than
the expected 8 bytes. The proposed patch extends the mechanism used for non 
USB3 HCDs in the first part of 
the same function, and  successively tries to query both the 8 byte prefix of 
the device descriptor, as well as 
the whole device descriptor (in case the old style query of the 8 byte prefix 
fails).
In fact, for the cameras I try to fix, the preferred condition is the negation 
of the one in the proposed patch,  
"if (!USE_NEW_SCHEME(retry_counter))", to try first the version successful on 
this case, but I keep the 
current order of the "if" branches to ensure clean continuation of support for 
other supported devices.

Signed-off-by: Marius C Silaghi 
---
--- linux/drivers/usb/core/hub.c.orig   2013-12-23 22:09:50.545093470 -0500
+++ linux/drivers/usb/core/hub.c2013-12-23 22:29:40.521043702 -0500
@@ -4197,7 +4197,19 @@ hub_port_init (struct usb_hub *hub, stru
break;
}
 
-   retval = usb_get_device_descriptor(udev, 8);
+   /*  Try first the old 8-byte query (since it may be expected
+*  by some devices), but then give at least a chance to the
+*  new form (retrieving the whole descriptor)!
+*  Querying the content of the whole structure is required
+*  for older USB2 video cameras which do not support partial
+*  descriptor queries, like the STC-XXXUSB family.
+*  Windows also supports them.
+*/
+   if (USE_NEW_SCHEME(retry_counter))
+   retval = usb_get_device_descriptor(udev, 8);
+   else
+   retval = usb_get_device_descriptor(udev,
+  sizeof(struct usb_device_descriptor));
if (retval < 8) {
if (retval != -ENODEV)
dev_err(>dev,

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


[PATCH] usbcore: fix BABBLE failed enumeration of legacy USB2 devices on USB3 bus

2013-12-23 Thread Marius Silaghi
From: Marius C Silaghi msila...@fit.edu

This patch is generated against the last kernel version in the github kernel 
repository.
Some older families of USB2 cameras (STC-XUSB) do not support querying only 
the first 8 bytes of their 
device descriptor and therefore fail at enumeration on USB3 HCDs, with babble 
error -75 as they send more than
the expected 8 bytes. The proposed patch extends the mechanism used for non 
USB3 HCDs in the first part of 
the same function, and  successively tries to query both the 8 byte prefix of 
the device descriptor, as well as 
the whole device descriptor (in case the old style query of the 8 byte prefix 
fails).
In fact, for the cameras I try to fix, the preferred condition is the negation 
of the one in the proposed patch,  
if (!USE_NEW_SCHEME(retry_counter)), to try first the version successful on 
this case, but I keep the 
current order of the if branches to ensure clean continuation of support for 
other supported devices.

Signed-off-by: Marius C Silaghi msila...@fit.edu
---
--- linux/drivers/usb/core/hub.c.orig   2013-12-23 22:09:50.545093470 -0500
+++ linux/drivers/usb/core/hub.c2013-12-23 22:29:40.521043702 -0500
@@ -4197,7 +4197,19 @@ hub_port_init (struct usb_hub *hub, stru
break;
}
 
-   retval = usb_get_device_descriptor(udev, 8);
+   /*  Try first the old 8-byte query (since it may be expected
+*  by some devices), but then give at least a chance to the
+*  new form (retrieving the whole descriptor)!
+*  Querying the content of the whole structure is required
+*  for older USB2 video cameras which do not support partial
+*  descriptor queries, like the STC-XXXUSB family.
+*  Windows also supports them.
+*/
+   if (USE_NEW_SCHEME(retry_counter))
+   retval = usb_get_device_descriptor(udev, 8);
+   else
+   retval = usb_get_device_descriptor(udev,
+  sizeof(struct usb_device_descriptor));
if (retval  8) {
if (retval != -ENODEV)
dev_err(udev-dev,

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/