This is a note to let you know that I've just added the patch titled USB: ti_usb_3410_5052: query hardware-buffer status in chars_in_buffer 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-ti_usb_3410_5052-query-hardware-buffer-status-in-chars_in_buffer.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 2c992cd73772bd0ef107536e8e3399d28493caa8 Mon Sep 17 00:00:00 2001 From: Johan Hovold <jhovold@xxxxxxxxx> Date: Thu, 18 Apr 2013 17:33:21 +0200 Subject: USB: ti_usb_3410_5052: query hardware-buffer status in chars_in_buffer From: Johan Hovold <jhovold@xxxxxxxxx> commit 2c992cd73772bd0ef107536e8e3399d28493caa8 upstream. Query hardware-buffer status in chars_in_buffer should the write fifo be empty. This is needed to make the tty layer wait for hardware buffers to drain on close. Signed-off-by: Johan Hovold <jhovold@xxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- drivers/usb/serial/ti_usb_3410_5052.c | 8 ++++++++ 1 file changed, 8 insertions(+) --- a/drivers/usb/serial/ti_usb_3410_5052.c +++ b/drivers/usb/serial/ti_usb_3410_5052.c @@ -686,6 +686,8 @@ static int ti_chars_in_buffer(struct tty struct ti_port *tport = usb_get_serial_port_data(port); int chars = 0; unsigned long flags; + int ret; + u8 lsr; if (tport == NULL) return 0; @@ -694,6 +696,12 @@ static int ti_chars_in_buffer(struct tty chars = kfifo_len(&tport->write_fifo); spin_unlock_irqrestore(&tport->tp_lock, flags); + if (!chars) { + ret = ti_get_lsr(tport, &lsr); + if (!ret && !(lsr & TI_LSR_TX_EMPTY)) + chars = 1; + } + dev_dbg(&port->dev, "%s - returns %d\n", __func__, chars); return chars; } 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