On Wed, 4 Feb 2004, Alan Stern wrote:

> > hub 1-2:1.0: int length 8
> 
> This says that the internal hub sent back an 8-byte response to a status 
> query when it was only supposed to send back 1 byte.  So, a bug in the 
> internal hub.  This caused the VIA USB controller to stop dead in its 
> tracks, a bug in the VIA controller.  Those two bugs together were deadly 
> for your system.

[...]

> -     /* buffer for urb ... 1 bit each for hub and children, rounded up */
> -     char                    (*buffer)[(USB_MAXCHILDREN + 1 + 7) / 8];
> +     /* buffer for urb ... max is 64 bytes for full speed */
> +     char                    (*buffer)[64];

BTW, I think it would be a good idea for all IN urb to round the requested
transfer_length up to the next multiple of maxpacket size. Always, for all 
drivers - except if the protocol explicitly requires treating SPD as error.

Why? Because there is no way for the device to know how many bytes the 
HC expects to receive - except if known in advance due to some higher 
level protocol. But we know real world devices have some tendency to send 
more than they should in some occasion, which leads to babble condition 
with serious consequences on VIA UHCI.

OTOH, preparing the host to accept full packets doesn't hurt. If the 
device correctly sends less bytes we get a short read, that's all. IMHO 
whenever SPD is an acceptable thing from the perspective of driver, it 
might use sufficiently long transfer buffer to fetch a whole packet in 
case of trailing data. Exactly what you are doing with this patch.

Martin



-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to