[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20160715112756.GI8809@localhost>
Date: Fri, 15 Jul 2016 13:27:56 +0200
From: Johan Hovold <johan@...nel.org>
To: Mathieu OTHACEHE <m.othacehe@...il.com>
Cc: johan@...nel.org, gregkh@...uxfoundation.org,
linux-usb@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 16/36] usb: serial: ti_usb_3410_5052: Use bulk_out_size
in TIOCGSERIAL
On Thu, May 12, 2016 at 10:48:48AM +0200, Mathieu OTHACEHE wrote:
> Use bulk_out_size instead of recalculate it with kfifo_size
>
> Signed-off-by: Mathieu OTHACEHE <m.othacehe@...il.com>
> ---
> drivers/usb/serial/ti_usb_3410_5052.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/usb/serial/ti_usb_3410_5052.c b/drivers/usb/serial/ti_usb_3410_5052.c
> index eb4df1e..5ef721c 100644
> --- a/drivers/usb/serial/ti_usb_3410_5052.c
> +++ b/drivers/usb/serial/ti_usb_3410_5052.c
> @@ -1205,7 +1205,7 @@ static int ti_get_serial_info(struct ti_port *tport,
> ret_serial.type = PORT_16550A;
> ret_serial.line = port->minor;
> ret_serial.port = port->port_number;
> - ret_serial.xmit_fifo_size = kfifo_size(&port->write_fifo);
> + ret_serial.xmit_fifo_size = port->bulk_out_size;
These two are in not equivalent. bulk_out_size holds the urb buffer size
(which coincides with the endpoint size by default, but need to do so),
while the fifo size is the size of the write fifo, which is typically
always larger.
This field is supposed to reflect the hardware fifo size, and we don't
really use it consistently for usb-serial drivers. I'd just leave it as
is for now.
Thanks,
Johan
Powered by blists - more mailing lists