Patchwork [U-Boot] Fix usb buffer size for large descriptor of devices

login
register
mail settings
Submitter Nicolas Chauvet
Date April 21, 2013, 5:15 p.m.
Message ID <1366564518-10324-1-git-send-email-kwizart@gmail.com>
Download mbox | patch
Permalink /patch/238231/
State Superseded
Delegated to: Marek Vasut
Headers show

Comments

Nicolas Chauvet - April 21, 2013, 5:15 p.m.
scanning bus 0 for devices...
usb_get_configuration_no: failed to get descriptor - too long: 943

This was experienced on toshiba ac100 aka paz00, when discovering
the webcam.

This patch is probably wrong, as it raise the buffer for all usb.
Instead it could probably be raised only per target system of maybe
per kind of devices
---
 common/usb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Marek Vasut - May 5, 2013, 9:37 p.m.
Dear Nicolas Chauvet,

> scanning bus 0 for devices...
> usb_get_configuration_no: failed to get descriptor - too long: 943
> 
> This was experienced on toshiba ac100 aka paz00, when discovering
> the webcam.
> 
> This patch is probably wrong, as it raise the buffer for all usb.
> Instead it could probably be raised only per target system of maybe
> per kind of devices

It'd be nice to CC me, it'd greatly raise your chance of getting a reply.

btw. why dont you allocate it dynamically then?

> ---
>  common/usb.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/common/usb.c b/common/usb.c
> index 6fc0fc1..46f5ce5 100644
> --- a/common/usb.c
> +++ b/common/usb.c
> @@ -68,7 +68,7 @@
>  #define USB_PRINTF(fmt, args...)	debug_cond(USB_DEBUG, fmt, ##args)
>  #define USB_HUB_PRINTF(fmt, args...)	debug_cond(USB_HUB_DEBUG, fmt,
> ##args)
> 
> -#define USB_BUFSIZ	512
> +#define USB_BUFSIZ	1024
> 
>  static struct usb_device usb_dev[USB_MAX_DEVICE];
>  static int dev_index;

Best regards,
Marek Vasut

Patch

diff --git a/common/usb.c b/common/usb.c
index 6fc0fc1..46f5ce5 100644
--- a/common/usb.c
+++ b/common/usb.c
@@ -68,7 +68,7 @@ 
 #define USB_PRINTF(fmt, args...)	debug_cond(USB_DEBUG, fmt, ##args)
 #define USB_HUB_PRINTF(fmt, args...)	debug_cond(USB_HUB_DEBUG, fmt, ##args)
 
-#define USB_BUFSIZ	512
+#define USB_BUFSIZ	1024
 
 static struct usb_device usb_dev[USB_MAX_DEVICE];
 static int dev_index;