aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/tty/n_tty.c
diff options
context:
space:
mode:
authorPeter Hurley <peter@hurleysoftware.com>2015-01-16 15:05:35 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-02-02 13:11:26 -0500
commita342846f9b0448996f56ebece80454d41b431ce2 (patch)
tree9c46111ae604d1e3eae2f5973c755af62ef5cb73 /drivers/tty/n_tty.c
parent2c5dc4641ca0e046b432f94f7058c4aff3440e47 (diff)
n_tty: Fix throttle for canon lines > 3967 chars
The tty driver will be mistakenly throttled if a line termination has not been received, and the line exceeds 3967 chars. Thus, it is possible for the driver to stop sending when it has not yet sent the newline. This does not apply to the pty driver. Don't throttle until at least one line termination has been received. Signed-off-by: Peter Hurley <peter@hurleysoftware.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty/n_tty.c')
-rw-r--r--drivers/tty/n_tty.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/tty/n_tty.c b/drivers/tty/n_tty.c
index b60b043f47d8..d4b14c30794e 100644
--- a/drivers/tty/n_tty.c
+++ b/drivers/tty/n_tty.c
@@ -247,6 +247,8 @@ static void n_tty_write_wakeup(struct tty_struct *tty)
247 247
248static void n_tty_check_throttle(struct tty_struct *tty) 248static void n_tty_check_throttle(struct tty_struct *tty)
249{ 249{
250 struct n_tty_data *ldata = tty->disc_data;
251
250 if (tty->driver->type == TTY_DRIVER_TYPE_PTY) 252 if (tty->driver->type == TTY_DRIVER_TYPE_PTY)
251 return; 253 return;
252 /* 254 /*
@@ -254,6 +256,9 @@ static void n_tty_check_throttle(struct tty_struct *tty)
254 * mode. We don't want to throttle the driver if we're in 256 * mode. We don't want to throttle the driver if we're in
255 * canonical mode and don't have a newline yet! 257 * canonical mode and don't have a newline yet!
256 */ 258 */
259 if (ldata->icanon && ldata->canon_head == ldata->read_tail)
260 return;
261
257 while (1) { 262 while (1) {
258 int throttled; 263 int throttled;
259 tty_set_flow_change(tty, TTY_THROTTLE_SAFE); 264 tty_set_flow_change(tty, TTY_THROTTLE_SAFE);