Merge branch 'sh-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
[pandora-kernel.git] / drivers / tty / n_tty.c
index 428f4fe..0ad3288 100644 (file)
@@ -95,6 +95,7 @@ static void n_tty_set_room(struct tty_struct *tty)
 {
        /* tty->read_cnt is not read locked ? */
        int     left = N_TTY_BUF_SIZE - tty->read_cnt - 1;
+       int old_left;
 
        /*
         * If we are doing input canonicalization, and there are no
@@ -104,7 +105,12 @@ static void n_tty_set_room(struct tty_struct *tty)
         */
        if (left <= 0)
                left = tty->icanon && !tty->canon_data;
+       old_left = tty->receive_room;
        tty->receive_room = left;
+
+       /* Did this open up the receive buffer? We may need to flip */
+       if (left && !old_left)
+               schedule_work(&tty->buf.work);
 }
 
 static void put_tty_queue_nolock(unsigned char c, struct tty_struct *tty)