aboutsummaryrefslogtreecommitdiffstats
diff options
authorGreg Kroah-Hartman <gregkh@suse.de>2010-07-07 14:38:07 -0700
committerGreg Kroah-Hartman <gregkh@suse.de>2010-07-07 14:38:07 -0700
commit5f53bd2f375da09055b154efa1024cc2208b4916 (patch)
tree77d8d8a9d89450cb3a556fc6406ce640e2e0778d
parentf3a20b368ebed936771e3516c240a77eed6bb918 (diff)
downloadpatches-5f53bd2f375da09055b154efa1024cc2208b4916.tar.gz
tty bugfix
-rw-r--r--series1
-rw-r--r--tty/serial-fix-termios-settings-in-open.patch69
-rw-r--r--tty/tty-replace-bkl-with-a-new-tty_lock.patch2
3 files changed, 71 insertions, 1 deletions
diff --git a/series b/series
index 07eda15a698f12..dc214263bfdc80 100644
--- a/series
+++ b/series
@@ -79,6 +79,7 @@ tty/serial-change-the-wait-for-carrier-locking.patch
tty/serial-add-port-helpers.patch
tty/serial-trim-locking-on-the-helpers.patch
tty/serial-use-block_til_ready-helper.patch
+tty/serial-fix-termios-settings-in-open.patch
tty/tty-replace-bkl-with-a-new-tty_lock.patch
tty/tty-never-hold-btm-while-getting-tty_mutex.patch
tty/tty-fix-console_sem-lock-order.patch
diff --git a/tty/serial-fix-termios-settings-in-open.patch b/tty/serial-fix-termios-settings-in-open.patch
new file mode 100644
index 00000000000000..8b8b646b5f789f
--- /dev/null
+++ b/tty/serial-fix-termios-settings-in-open.patch
@@ -0,0 +1,69 @@
+From arnd@arndb.de Wed Jul 7 14:36:39 2010
+From: Arnd Bergmann <arnd@arndb.de>
+Date: Tue, 29 Jun 2010 22:31:40 +0200
+Subject: serial: fix termios settings in open
+To: Greg Kroah-Hartman <gregkh@suse.de>
+Cc: linux-kernel@vger.kernel.org, Arnd Bergmann <arnd@arndb.de>, Alan Cox <alan@lxorguk.ukuu.org.uk>, Tony Luck <tony.luck@intel.com>
+Message-ID: <1277843500-14680-1-git-send-email-arnd@arndb.de>
+
+
+Move termios initialization in open into uart_dtr_rts to make sure
+it always gets called when necessary. Based on a suggestion from
+Alan Cox.
+
+Alan writes:
+Ok this sort of makes sense. Something isn't getting initialised and both
+getty and minicom will do a termios set which is sorting it out.
+This is occurring because the generic block_til_ready sets
+ASYNCB_NORMAL_ACTIVE so the termios updating gets skipped.
+
+This patch should cure it and then we can think about doing it more
+elegantly by getting the serial layer to use tty_port_open, kfifo and
+the like and removing the tons of repeated crap in all the drivers.
+
+Signed-off-by: Arnd Bergmann <arnd@arndb.de>
+Reported-by: Tony Luck <tony.luck@intel.com>
+Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
+Cc: Tony Luck <tony.luck@intel.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/serial/serial_core.c | 19 +++++++++----------
+ 1 file changed, 9 insertions(+), 10 deletions(-)
+
+--- a/drivers/serial/serial_core.c
++++ b/drivers/serial/serial_core.c
+@@ -1520,8 +1520,16 @@ static void uart_dtr_rts(struct tty_port
+ struct uart_state *state = container_of(port, struct uart_state, port);
+ struct uart_port *uport = state->uart_port;
+
+- if (onoff)
++ if (onoff) {
+ uart_set_mctrl(uport, TIOCM_DTR | TIOCM_RTS);
++
++ /*
++ * If this is the first open to succeed,
++ * adjust things to suit.
++ */
++ if (!test_and_set_bit(ASYNCB_NORMAL_ACTIVE, &port->flags))
++ uart_update_termios(port->tty, state);
++ }
+ else
+ uart_clear_mctrl(uport, TIOCM_DTR | TIOCM_RTS);
+ }
+@@ -1636,15 +1644,6 @@ static int uart_open(struct tty_struct *
+ if (retval == 0)
+ retval = tty_port_block_til_ready(port, tty, filp);
+
+- /*
+- * If this is the first open to succeed, adjust things to suit.
+- */
+- if (retval == 0 && !(port->flags & ASYNC_NORMAL_ACTIVE)) {
+- set_bit(ASYNCB_NORMAL_ACTIVE, &port->flags);
+-
+- uart_update_termios(tty, state);
+- }
+-
+ fail:
+ return retval;
+ }
diff --git a/tty/tty-replace-bkl-with-a-new-tty_lock.patch b/tty/tty-replace-bkl-with-a-new-tty_lock.patch
index 882497813118f7..9aef3cce457208 100644
--- a/tty/tty-replace-bkl-with-a-new-tty_lock.patch
+++ b/tty/tty-replace-bkl-with-a-new-tty_lock.patch
@@ -964,7 +964,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
pr_debug("uart_hangup(%d)\n", state->uart_port->line);
mutex_lock(&port->mutex);
-@@ -1570,7 +1570,7 @@ static int uart_open(struct tty_struct *
+@@ -1578,7 +1578,7 @@ static int uart_open(struct tty_struct *
struct tty_port *port;
int retval, line = tty->index;