Commit 46552848 authored by Johan Hovold's avatar Johan Hovold Committed by Luis Henriques

Revert "USB: serial: make bulk_out_size a lower limit"

commit bc4b1f48 upstream.

This reverts commit 5083fd7b.

A bulk-out size smaller than the end-point size is indeed valid. The
offending commit broke the usb-debug driver for EHCI debug devices,
which use 8-byte buffers.

Fixes: 5083fd7b ("USB: serial: make bulk_out_size a lower limit")
Reported-by: default avatar"Li, Elvin" <elvin.li@intel.com>
Signed-off-by: default avatarJohan Hovold <johan@kernel.org>
Signed-off-by: default avatarLuis Henriques <luis.henriques@canonical.com>
parent 28e78736
...@@ -940,8 +940,9 @@ static int usb_serial_probe(struct usb_interface *interface, ...@@ -940,8 +940,9 @@ static int usb_serial_probe(struct usb_interface *interface,
port = serial->port[i]; port = serial->port[i];
if (kfifo_alloc(&port->write_fifo, PAGE_SIZE, GFP_KERNEL)) if (kfifo_alloc(&port->write_fifo, PAGE_SIZE, GFP_KERNEL))
goto probe_error; goto probe_error;
buffer_size = max_t(int, serial->type->bulk_out_size, buffer_size = serial->type->bulk_out_size;
usb_endpoint_maxp(endpoint)); if (!buffer_size)
buffer_size = usb_endpoint_maxp(endpoint);
port->bulk_out_size = buffer_size; port->bulk_out_size = buffer_size;
port->bulk_out_endpointAddress = endpoint->bEndpointAddress; port->bulk_out_endpointAddress = endpoint->bEndpointAddress;
......
...@@ -190,8 +190,7 @@ static inline void usb_set_serial_data(struct usb_serial *serial, void *data) ...@@ -190,8 +190,7 @@ static inline void usb_set_serial_data(struct usb_serial *serial, void *data)
* @num_ports: the number of different ports this device will have. * @num_ports: the number of different ports this device will have.
* @bulk_in_size: minimum number of bytes to allocate for bulk-in buffer * @bulk_in_size: minimum number of bytes to allocate for bulk-in buffer
* (0 = end-point size) * (0 = end-point size)
* @bulk_out_size: minimum number of bytes to allocate for bulk-out buffer * @bulk_out_size: bytes to allocate for bulk-out buffer (0 = end-point size)
* (0 = end-point size)
* @calc_num_ports: pointer to a function to determine how many ports this * @calc_num_ports: pointer to a function to determine how many ports this
* device has dynamically. It will be called after the probe() * device has dynamically. It will be called after the probe()
* callback is called, but before attach() * callback is called, but before attach()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment