summaryrefslogtreecommitdiffstats
path: root/drivers/tty/n_tty.c
diff options
context:
space:
mode:
authorPeter Hurley2013-03-11 21:44:21 +0100
committerGreg Kroah-Hartman2013-03-19 00:32:46 +0100
commit21622939fc452c7fb739464b8e49368c3ceaa0ee (patch)
treec96d6a137611e9d976a4d391a48c94f5267db7ff /drivers/tty/n_tty.c
parenttty: ifx6x60: Remove unused suspend/resume callbacks (diff)
downloadkernel-qcow2-linux-21622939fc452c7fb739464b8e49368c3ceaa0ee.tar.gz
kernel-qcow2-linux-21622939fc452c7fb739464b8e49368c3ceaa0ee.tar.xz
kernel-qcow2-linux-21622939fc452c7fb739464b8e49368c3ceaa0ee.zip
tty: Add diagnostic for halted line discipline
Flip buffer work must not be scheduled by the line discipline after the line discipline has been halted; issue warning. Note: drivers can still schedule flip buffer work. 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.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/tty/n_tty.c b/drivers/tty/n_tty.c
index 68865d9af8a0..16793eccc6ae 100644
--- a/drivers/tty/n_tty.c
+++ b/drivers/tty/n_tty.c
@@ -153,6 +153,12 @@ static void n_tty_set_room(struct tty_struct *tty)
if (left && !old_left) {
WARN_RATELIMIT(tty->port->itty == NULL,
"scheduling with invalid itty\n");
+ /* see if ldisc has been killed - if so, this means that
+ * even though the ldisc has been halted and ->buf.work
+ * cancelled, ->buf.work is about to be rescheduled
+ */
+ WARN_RATELIMIT(test_bit(TTY_LDISC_HALTED, &tty->flags),
+ "scheduling buffer work for halted ldisc\n");
schedule_work(&tty->port->buf.work);
}
}
@@ -1624,6 +1630,8 @@ static int n_tty_open(struct tty_struct *tty)
goto err_free_bufs;
tty->disc_data = ldata;
+ /* indicate buffer work may resume */
+ clear_bit(TTY_LDISC_HALTED, &tty->flags);
reset_buffer_flags(tty);
tty_unthrottle(tty);
ldata->column = 0;