spi-topcliff-pch: Add recovery processing in case FIFO overrun error occurs
[pandora-kernel.git] / drivers / tty / n_tty.c
index 0ad3288..39d6ab6 100644 (file)
@@ -185,7 +185,6 @@ static void reset_buffer_flags(struct tty_struct *tty)
        tty->canon_head = tty->canon_data = tty->erasing = 0;
        memset(&tty->read_flags, 0, sizeof tty->read_flags);
        n_tty_set_room(tty);
-       check_unthrottle(tty);
 }
 
 /**
@@ -1587,6 +1586,7 @@ static int n_tty_open(struct tty_struct *tty)
                        return -ENOMEM;
        }
        reset_buffer_flags(tty);
+       tty_unthrottle(tty);
        tty->column = 0;
        n_tty_set_termios(tty, NULL);
        tty->minimum_to_wake = 1;
@@ -1815,6 +1815,7 @@ do_it_again:
                        /* FIXME: does n_tty_set_room need locking ? */
                        n_tty_set_room(tty);
                        timeout = schedule_timeout(timeout);
+                       BUG_ON(!tty->read_buf);
                        continue;
                }
                __set_current_state(TASK_RUNNING);