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

    serial: core, move termios handling to uart_startup

to the 2.6.39-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:
     serial-core-move-termios-handling-to-uart_startup.patch
and it can be found in the queue-2.6.39 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <[email protected]> know about it.


>From c7d7abff40c27f82fe78b1091ab3fad69b2546f9 Mon Sep 17 00:00:00 2001
From: Jiri Slaby <[email protected]>
Date: Wed, 30 Mar 2011 00:10:55 +0200
Subject: serial: core, move termios handling to uart_startup

From: Jiri Slaby <[email protected]>

commit c7d7abff40c27f82fe78b1091ab3fad69b2546f9 upstream.

We should not fiddle with speed and cflags in .dtr_rts hook. Actually
we might not have tty at that moment already.

So move the console cflag copy and speed setup into uart_startup.
Actually the speed setup is already there, but we need to call it
unconditionally (uart_startup is called from uart_open with hw_init =
0).

This means we move uart_change_speed before dtr/rts setup in .dtr_rts.
But this should not matter as the setup should be called after
uart_change_speed anyway.
Before:                             After:
dtr/rts setup (dtr_rts)             uart_change_speed (startup)
uart_change_speed (update_termios)  dtr/rts setup (dtr_rts)
dtr/rts setup (update_termios)      dtr/rts setup (update_termios)

The second setup will dismiss with the next patch.

Signed-off-by: Jiri Slaby <[email protected]>
Cc: Alan Cox <[email protected]>
Cc: Arnd Bergmann <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>

---
 drivers/tty/serial/serial_core.c |   24 +++++++++---------------
 1 file changed, 9 insertions(+), 15 deletions(-)

--- a/drivers/tty/serial/serial_core.c
+++ b/drivers/tty/serial/serial_core.c
@@ -172,12 +172,16 @@ static int uart_startup(struct tty_struc
 
        retval = uport->ops->startup(uport);
        if (retval == 0) {
-               if (init_hw) {
-                       /*
-                        * Initialise the hardware port settings.
-                        */
-                       uart_change_speed(tty, state, NULL);
+               if (uart_console(uport) && uport->cons->cflag) {
+                       tty->termios->c_cflag = uport->cons->cflag;
+                       uport->cons->cflag = 0;
+               }
+               /*
+                * Initialise the hardware port settings.
+                */
+               uart_change_speed(tty, state, NULL);
 
+               if (init_hw) {
                        /*
                         * Setup the RTS and DTR signals once the
                         * port is open and ready to respond.
@@ -1481,11 +1485,6 @@ static void uart_update_termios(struct t
 {
        struct uart_port *port = state->uart_port;
 
-       if (uart_console(port) && port->cons->cflag) {
-               tty->termios->c_cflag = port->cons->cflag;
-               port->cons->cflag = 0;
-       }
-
        /*
         * If the device failed to grab its irq resources,
         * or some other error occurred, don't try to talk
@@ -1493,11 +1492,6 @@ static void uart_update_termios(struct t
         */
        if (!(tty->flags & (1 << TTY_IO_ERROR))) {
                /*
-                * Make termios settings take effect.
-                */
-               uart_change_speed(tty, state, NULL);
-
-               /*
                 * And finally enable the RTS and DTR signals.
                 */
                if (tty->termios->c_cflag & CBAUD)


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

queue-2.6.39/serial-core-remove-uart_update_termios.patch
queue-2.6.39/serial-core-move-termios-handling-to-uart_startup.patch
queue-2.6.39/asus-wmi-remove-__init-from-asus_wmi_platform_init.patch
queue-2.6.39/serial-core-do-not-set-dtr-rts-twice-on-startup.patch

_______________________________________________
stable mailing list
[email protected]
http://linux.kernel.org/mailman/listinfo/stable

Reply via email to