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

    USB: serial: add wait_until_sent operation

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-serial-add-wait_until_sent-operation.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 <[email protected]> know about it.


>From 0693196fe7bbb5e6cafd255dfce91ff6d10bc18f Mon Sep 17 00:00:00 2001
From: Johan Hovold <[email protected]>
Date: Sun, 5 May 2013 20:32:27 +0200
Subject: USB: serial: add wait_until_sent operation

From: Johan Hovold <[email protected]>

commit 0693196fe7bbb5e6cafd255dfce91ff6d10bc18f upstream.

Add wait_until_sent operation which can be used to wait for hardware
buffers to drain.

Signed-off-by: Johan Hovold <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>

---
 drivers/usb/serial/usb-serial.c |   17 +++++++++++++++++
 include/linux/usb/serial.h      |    1 +
 2 files changed, 18 insertions(+)

--- a/drivers/usb/serial/usb-serial.c
+++ b/drivers/usb/serial/usb-serial.c
@@ -379,6 +379,22 @@ static int serial_chars_in_buffer(struct
        return count;
 }
 
+static void serial_wait_until_sent(struct tty_struct *tty, int timeout)
+{
+       struct usb_serial_port *port = tty->driver_data;
+       struct usb_serial *serial = port->serial;
+
+       dev_dbg(tty->dev, "%s\n", __func__);
+
+       if (!port->serial->type->wait_until_sent)
+               return;
+
+       mutex_lock(&serial->disc_mutex);
+       if (!serial->disconnected)
+               port->serial->type->wait_until_sent(tty, timeout);
+       mutex_unlock(&serial->disc_mutex);
+}
+
 static void serial_throttle(struct tty_struct *tty)
 {
        struct usb_serial_port *port = tty->driver_data;
@@ -1204,6 +1220,7 @@ static const struct tty_operations seria
        .unthrottle =           serial_unthrottle,
        .break_ctl =            serial_break,
        .chars_in_buffer =      serial_chars_in_buffer,
+       .wait_until_sent =      serial_wait_until_sent,
        .tiocmget =             serial_tiocmget,
        .tiocmset =             serial_tiocmset,
        .get_icount =           serial_get_icount,
--- a/include/linux/usb/serial.h
+++ b/include/linux/usb/serial.h
@@ -267,6 +267,7 @@ struct usb_serial_driver {
                        struct usb_serial_port *port, struct ktermios *old);
        void (*break_ctl)(struct tty_struct *tty, int break_state);
        int  (*chars_in_buffer)(struct tty_struct *tty);
+       void (*wait_until_sent)(struct tty_struct *tty, long timeout);
        void (*throttle)(struct tty_struct *tty);
        void (*unthrottle)(struct tty_struct *tty);
        int  (*tiocmget)(struct tty_struct *tty);


Patches currently in stable-queue which might be from [email protected] are

queue-3.9/usb-mos7720-fix-dma-to-stack.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-mos7840-fix-dma-to-stack.patch
queue-3.9/usb-serial-fix-treo-kyocera-interrrupt-in-urb-context.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-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 [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to