aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/tty/n_tty.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-12-24 13:10:47 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-12-24 13:10:47 -0500
commitb86b75ec57c381f32090a5bc61252f84f955c094 (patch)
tree69afa8a88979bfa8fbdbcb106ddf8fe3ee5da99f /drivers/tty/n_tty.c
parent351d6204bfc814a1aee300296d2f54460ffff172 (diff)
parent413541dd66d51f791a0b169d9b9014e4f56be13c (diff)
Merge 3.13-rc5 into tty-next
We need the tty fixes in here as well. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty/n_tty.c')
-rw-r--r--drivers/tty/n_tty.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/tty/n_tty.c b/drivers/tty/n_tty.c
index 961e6a996dff..cb8017aa4434 100644
--- a/drivers/tty/n_tty.c
+++ b/drivers/tty/n_tty.c
@@ -93,6 +93,7 @@ struct n_tty_data {
93 size_t canon_head; 93 size_t canon_head;
94 size_t echo_head; 94 size_t echo_head;
95 size_t echo_commit; 95 size_t echo_commit;
96 size_t echo_mark;
96 DECLARE_BITMAP(char_map, 256); 97 DECLARE_BITMAP(char_map, 256);
97 98
98 /* private to n_tty_receive_overrun (single-threaded) */ 99 /* private to n_tty_receive_overrun (single-threaded) */
@@ -338,6 +339,7 @@ static void reset_buffer_flags(struct n_tty_data *ldata)
338{ 339{
339 ldata->read_head = ldata->canon_head = ldata->read_tail = 0; 340 ldata->read_head = ldata->canon_head = ldata->read_tail = 0;
340 ldata->echo_head = ldata->echo_tail = ldata->echo_commit = 0; 341 ldata->echo_head = ldata->echo_tail = ldata->echo_commit = 0;
342 ldata->echo_mark = 0;
341 ldata->line_start = 0; 343 ldata->line_start = 0;
342 344
343 ldata->erasing = 0; 345 ldata->erasing = 0;
@@ -791,6 +793,7 @@ static void commit_echoes(struct tty_struct *tty)
791 size_t head; 793 size_t head;
792 794
793 head = ldata->echo_head; 795 head = ldata->echo_head;
796 ldata->echo_mark = head;
794 old = ldata->echo_commit - ldata->echo_tail; 797 old = ldata->echo_commit - ldata->echo_tail;
795 798
796 /* Process committed echoes if the accumulated # of bytes 799 /* Process committed echoes if the accumulated # of bytes
@@ -815,10 +818,11 @@ static void process_echoes(struct tty_struct *tty)
815 size_t echoed; 818 size_t echoed;
816 819
817 if ((!L_ECHO(tty) && !L_ECHONL(tty)) || 820 if ((!L_ECHO(tty) && !L_ECHONL(tty)) ||
818 ldata->echo_commit == ldata->echo_tail) 821 ldata->echo_mark == ldata->echo_tail)
819 return; 822 return;
820 823
821 mutex_lock(&ldata->output_lock); 824 mutex_lock(&ldata->output_lock);
825 ldata->echo_commit = ldata->echo_mark;
822 echoed = __process_echoes(tty); 826 echoed = __process_echoes(tty);
823 mutex_unlock(&ldata->output_lock); 827 mutex_unlock(&ldata->output_lock);
824 828
@@ -826,6 +830,7 @@ static void process_echoes(struct tty_struct *tty)
826 tty->ops->flush_chars(tty); 830 tty->ops->flush_chars(tty);
827} 831}
828 832
833/* NB: echo_mark and echo_head should be equivalent here */
829static void flush_echoes(struct tty_struct *tty) 834static void flush_echoes(struct tty_struct *tty)
830{ 835{
831 struct n_tty_data *ldata = tty->disc_data; 836 struct n_tty_data *ldata = tty->disc_data;