Patch "USB: io_ti: fix chars_in_buffer overhead" has been added to the 3.9-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    USB: io_ti: fix chars_in_buffer overhead

to the 3.9-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     usb-io_ti-fix-chars_in_buffer-overhead.patch
and it can be found in the queue-3.9 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.


>From b16634adce951a7371be931487034f7365971ed0 Mon Sep 17 00:00:00 2001
From: Johan Hovold <jhovold@xxxxxxxxx>
Date: Sun, 5 May 2013 20:32:31 +0200
Subject: USB: io_ti: fix chars_in_buffer overhead

From: Johan Hovold <jhovold@xxxxxxxxx>

commit b16634adce951a7371be931487034f7365971ed0 upstream.

Use the new generic usb-serial wait_until_sent implementation to wait
for hardware buffers to drain.

This removes the need to check the hardware buffers in chars_in_buffer
and thus removes the overhead introduced by commit 263e1f9f ("USB:
io_ti: query hardware-buffer status in chars_in_buffer") without
breaking tty_wait_until_sent (used by, for example, tcdrain, tcsendbreak
and close).

Signed-off-by: Johan Hovold <jhovold@xxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>

---
 drivers/usb/serial/io_ti.c |   22 ++++++++++++++--------
 1 file changed, 14 insertions(+), 8 deletions(-)

--- a/drivers/usb/serial/io_ti.c
+++ b/drivers/usb/serial/io_ti.c
@@ -2033,8 +2033,6 @@ static int edge_chars_in_buffer(struct t
 	struct edgeport_port *edge_port = usb_get_serial_port_data(port);
 	int chars = 0;
 	unsigned long flags;
-	int ret;
-
 	if (edge_port == NULL)
 		return 0;
 
@@ -2042,16 +2040,22 @@ static int edge_chars_in_buffer(struct t
 	chars = kfifo_len(&edge_port->write_fifo);
 	spin_unlock_irqrestore(&edge_port->ep_lock, flags);
 
-	if (!chars) {
-		ret = tx_active(edge_port);
-		if (ret > 0)
-			chars = ret;
-	}
-
 	dev_dbg(&port->dev, "%s - returns %d\n", __func__, chars);
 	return chars;
 }
 
+static bool edge_tx_empty(struct usb_serial_port *port)
+{
+	struct edgeport_port *edge_port = usb_get_serial_port_data(port);
+	int ret;
+
+	ret = tx_active(edge_port);
+	if (ret > 0)
+		return false;
+
+	return true;
+}
+
 static void edge_throttle(struct tty_struct *tty)
 {
 	struct usb_serial_port *port = tty->driver_data;
@@ -2622,6 +2626,7 @@ static struct usb_serial_driver edgeport
 	.write			= edge_write,
 	.write_room		= edge_write_room,
 	.chars_in_buffer	= edge_chars_in_buffer,
+	.tx_empty		= edge_tx_empty,
 	.break_ctl		= edge_break,
 	.read_int_callback	= edge_interrupt_callback,
 	.read_bulk_callback	= edge_bulk_in_callback,
@@ -2653,6 +2658,7 @@ static struct usb_serial_driver edgeport
 	.write			= edge_write,
 	.write_room		= edge_write_room,
 	.chars_in_buffer	= edge_chars_in_buffer,
+	.tx_empty		= edge_tx_empty,
 	.break_ctl		= edge_break,
 	.read_int_callback	= edge_interrupt_callback,
 	.read_bulk_callback	= edge_bulk_in_callback,


Patches currently in stable-queue which might be from jhovold@xxxxxxxxx are

queue-3.9/usb-mos7720-fix-dma-to-stack.patch
queue-3.9/usb-ti_usb_3410_5052-fix-chars_in_buffer-overhead.patch
queue-3.9/usb-ftdi_sio-clean-up-get_modem_status.patch
queue-3.9/usb-ftdi_sio-fix-chars_in_buffer-overhead.patch
queue-3.9/usb-zte_ev-fix-broken-open.patch
queue-3.9/usb-ark3116-fix-control-message-timeout.patch
queue-3.9/usb-serial-add-wait_until_sent-operation.patch
queue-3.9/usb-io_ti-fix-chars_in_buffer-overhead.patch
queue-3.9/usb-mos7840-fix-dma-to-stack.patch
queue-3.9/usb-serial-fix-treo-kyocera-interrrupt-in-urb-context.patch
queue-3.9/usb-ti_usb_3410_5052-query-hardware-buffer-status-in-chars_in_buffer.patch
queue-3.9/usb-serial-add-generic-wait_until_sent-implementation.patch
queue-3.9/usb-mos7720-fix-hardware-flow-control.patch
queue-3.9/usb-keyspan-fix-bogus-array-index.patch
queue-3.9/usb-zte_ev-fix-control-message-timeouts.patch
queue-3.9/usb-mos7720-fix-message-timeouts.patch
queue-3.9/usb-iuu_phoenix-fix-bulk-message-timeout.patch
queue-3.9/usb-whiteheat-fix-broken-port-configuration.patch
queue-3.9/usb-ti_usb_3410_5052-remove-lsr-from-port-data.patch
queue-3.9/usb-visor-fix-initialisation-of-treo-kyocera-devices.patch
--
To unsubscribe from this list: send the line "unsubscribe stable" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]