]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
3.13-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 20 Feb 2014 22:14:45 +0000 (14:14 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 20 Feb 2014 22:14:45 +0000 (14:14 -0800)
added patches:
n_tty-fix-stale-echo-output.patch

queue-3.13/n_tty-fix-stale-echo-output.patch [new file with mode: 0644]
queue-3.13/series

diff --git a/queue-3.13/n_tty-fix-stale-echo-output.patch b/queue-3.13/n_tty-fix-stale-echo-output.patch
new file mode 100644 (file)
index 0000000..406f8ba
--- /dev/null
@@ -0,0 +1,69 @@
+From e2613be5093d04e6589924d36a1e363eef3c87c7 Mon Sep 17 00:00:00 2001
+From: Peter Hurley <peter@hurleysoftware.com>
+Date: Tue, 11 Feb 2014 16:34:55 -0500
+Subject: n_tty: Fix stale echo output
+
+From: Peter Hurley <peter@hurleysoftware.com>
+
+commit e2613be5093d04e6589924d36a1e363eef3c87c7 upstream.
+
+When echoes cannot be flushed to output (usually because the tty
+has no more write room) and L_ECHO is subsequently turned off, then
+when L_ECHO is turned back on, stale echoes are output.
+
+Output completed echoes regardless of the L_ECHO setting:
+  1. before normal writes to that tty
+  2. if the tty was stopped by soft flow control and is being
+     restarted
+
+Reported-by: Mikulas Patocka <mpatocka@redhat.com>
+Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/tty/n_tty.c |   12 +++++++-----
+ 1 file changed, 7 insertions(+), 5 deletions(-)
+
+--- a/drivers/tty/n_tty.c
++++ b/drivers/tty/n_tty.c
+@@ -813,8 +813,7 @@ static void process_echoes(struct tty_st
+       struct n_tty_data *ldata = tty->disc_data;
+       size_t echoed;
+-      if ((!L_ECHO(tty) && !L_ECHONL(tty)) ||
+-          ldata->echo_mark == ldata->echo_tail)
++      if (ldata->echo_mark == ldata->echo_tail)
+               return;
+       mutex_lock(&ldata->output_lock);
+@@ -1238,7 +1237,8 @@ n_tty_receive_signal_char(struct tty_str
+       if (L_ECHO(tty)) {
+               echo_char(c, tty);
+               commit_echoes(tty);
+-      }
++      } else
++              process_echoes(tty);
+       isig(signal, tty);
+       return;
+ }
+@@ -1269,7 +1269,7 @@ n_tty_receive_char_special(struct tty_st
+       if (I_IXON(tty)) {
+               if (c == START_CHAR(tty)) {
+                       start_tty(tty);
+-                      commit_echoes(tty);
++                      process_echoes(tty);
+                       return 0;
+               }
+               if (c == STOP_CHAR(tty)) {
+@@ -1821,8 +1821,10 @@ static void n_tty_set_termios(struct tty
+        * Fix tty hang when I_IXON(tty) is cleared, but the tty
+        * been stopped by STOP_CHAR(tty) before it.
+        */
+-      if (!I_IXON(tty) && old && (old->c_iflag & IXON) && !tty->flow_stopped)
++      if (!I_IXON(tty) && old && (old->c_iflag & IXON) && !tty->flow_stopped) {
+               start_tty(tty);
++              process_echoes(tty);
++      }
+       /* The termios change make the tty ready for I/O */
+       wake_up_interruptible(&tty->write_wait);
index af9ac2bd7cd587b100c3ab395cd1bdd48a334474..0640345415dbecde1af2e13cc6ec27eee5ba72d9 100644 (file)
@@ -33,3 +33,4 @@ hwmon-ntc_thermistor-avoid-math-overflow.patch
 lockd-send-correct-lock-when-granting-a-delayed-lock.patch
 tty-n_gsm-fix-for-modems-with-brk-in-modem-status-control.patch
 tty-set-correct-tty-name-in-active-sysfs-attribute.patch
+n_tty-fix-stale-echo-output.patch