Merge branch 'slab/next' of git://git.kernel.org/pub/scm/linux/kernel/git/penberg...
[firefly-linux-kernel-4.4.55.git] / drivers / tty / tty_buffer.c
index 765125dff20e36f5d07e2db53646f83f66a223f7..8ebd9f88a6f69ff85f63139944fad2542c789483 100644 (file)
@@ -351,14 +351,11 @@ EXPORT_SYMBOL(tty_insert_flip_string_flags);
  *     Takes any pending buffers and transfers their ownership to the
  *     ldisc side of the queue. It then schedules those characters for
  *     processing by the line discipline.
- *     Note that this function can only be used when the low_latency flag
- *     is unset. Otherwise the workqueue won't be flushed.
  */
 
 void tty_schedule_flip(struct tty_port *port)
 {
        struct tty_bufhead *buf = &port->buf;
-       WARN_ON(port->low_latency);
 
        buf->tail->commit = buf->tail->used;
        schedule_work(&buf->work);
@@ -482,17 +479,15 @@ static void flush_to_ldisc(struct work_struct *work)
  */
 void tty_flush_to_ldisc(struct tty_struct *tty)
 {
-       if (!tty->port->low_latency)
-               flush_work(&tty->port->buf.work);
+       flush_work(&tty->port->buf.work);
 }
 
 /**
  *     tty_flip_buffer_push    -       terminal
  *     @port: tty port to push
  *
- *     Queue a push of the terminal flip buffers to the line discipline. This
- *     function must not be called from IRQ context if port->low_latency is
- *     set.
+ *     Queue a push of the terminal flip buffers to the line discipline.
+ *     Can be called from IRQ/atomic context.
  *
  *     In the event of the queue being busy for flipping the work will be
  *     held off and retried later.
@@ -500,14 +495,7 @@ void tty_flush_to_ldisc(struct tty_struct *tty)
 
 void tty_flip_buffer_push(struct tty_port *port)
 {
-       struct tty_bufhead *buf = &port->buf;
-
-       buf->tail->commit = buf->tail->used;
-
-       if (port->low_latency)
-               flush_to_ldisc(&buf->work);
-       else
-               schedule_work(&buf->work);
+       tty_schedule_flip(port);
 }
 EXPORT_SYMBOL(tty_flip_buffer_push);