diff options
author | Jason Wessel <jason.wessel@windriver.com> | 2009-05-11 15:24:07 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2009-06-15 21:44:45 -0700 |
commit | 715b1dc01fe44537e8fce9566e4bb48d6821d84b (patch) | |
tree | b1fc0b5c61a7317e7104468afddad544fb3fc34c /drivers/usb/serial/usb_debug.c | |
parent | b0cda8c5f7b652c6c27bcb3891d174534d2f1a91 (diff) | |
download | lwn-715b1dc01fe44537e8fce9566e4bb48d6821d84b.tar.gz lwn-715b1dc01fe44537e8fce9566e4bb48d6821d84b.zip |
USB: usb_debug, usb_generic_serial: implement multi urb write
The usb_debug driver, when used as the console, will always fail to
insert the carriage return and new line sequence as well as randomly
drop console output. This is a result of only having the single
write_urb and that the tty layer will have a lock that prevents the
processing of the back to back urb requests.
The solution is to allow more than one urb to be outstanding and have
a slightly deeper transmit queue. The idea and some code is borrowed
from the ftdi_sio usb driver.
The generic usb serial driver was modified so as to allow the classic
method of 1 write urb, or a multi write urb scheme with N allowed
outstanding urbs where N is controlled by max_in_flight_urbs. When
max_in_flight_urbs in a "struct usb_serial_driver" is non zero the
multi write urb scheme will be used.
The size of 4000 was selected for the usb_debug driver so that the
driver lowers possibility of losing the queued console messages during
the kernel startup.
Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/serial/usb_debug.c')
-rw-r--r-- | drivers/usb/serial/usb_debug.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/usb/serial/usb_debug.c b/drivers/usb/serial/usb_debug.c index 6c9cbb59552a..a9427a8b8672 100644 --- a/drivers/usb/serial/usb_debug.c +++ b/drivers/usb/serial/usb_debug.c @@ -15,6 +15,7 @@ #include <linux/usb.h> #include <linux/usb/serial.h> +#define URB_DEBUG_MAX_IN_FLIGHT_URBS 4000 #define USB_DEBUG_MAX_PACKET_SIZE 8 static struct usb_device_id id_table [] = { @@ -46,6 +47,7 @@ static struct usb_serial_driver debug_device = { .id_table = id_table, .num_ports = 1, .open = usb_debug_open, + .max_in_flight_urbs = URB_DEBUG_MAX_IN_FLIGHT_URBS, }; static int __init debug_init(void) |