USB: serial drivers need to use larger bulk-in buffers
authorAlan Stern <stern@rowland.harvard.edu>
Wed, 23 Feb 2011 20:28:18 +0000 (15:28 -0500)
committerGreg Kroah-Hartman <gregkh@suse.de>
Wed, 23 Mar 2011 19:50:12 +0000 (12:50 -0700)
commita1afb5cb13080ca9b07096c1312f8695d9bd85d8
tree986743814a810d63895e0475ce8b700013a80ba8
parent11503d7c36bb70eff71958ff8946d5b95299f988
USB: serial drivers need to use larger bulk-in buffers

commit 969e3033ae7733a0af8f7742ca74cd16c0857e71 upstream.

When a driver doesn't know how much data a device is going to send,
the buffer size should be at least as big as the endpoint's maxpacket
value.  The serial drivers don't follow this rule; many of them
request only 256-byte bulk-in buffers.  As a result, they suffer
overflow errors if a high-speed device wants to send a lot of data,
because high-speed bulk endpoints are required to have a maxpacket
size of 512.

This patch (as1450) fixes the problem by using the driver's
bulk_in_size value as a minimum, always allocating buffers no smaller
than the endpoint's maxpacket size.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Tested-by: Flynn Marquardt <flynn@flynnux.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/usb/serial/usb-serial.c
include/linux/usb/serial.h