From 4e4bc38442bc90a530984079f4429346d40620c9 Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Wed, 8 Jun 2011 07:46:30 -0700 Subject: [PATCH] --- yaml --- r: 253231 b: refs/heads/master c: 81de916f19cf5f1437c0b9ed817364f0f7c81961 h: refs/heads/master i: 253229: e70906c954db05f4968d76182e518bbda4cab7f6 253227: eeccf521cbc7778fa22640f9f280643bd478778b 253223: 001d7db41cb8898906e4b9b6af80825084169218 253215: 01075ed8b875a1f54676ae728381e4916f769e5a v: v3 --- [refs] | 2 +- trunk/drivers/tty/tty_buffer.c | 14 ++------------ 2 files changed, 3 insertions(+), 13 deletions(-) diff --git a/[refs] b/[refs] index a44676859b52..02950a944029 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: cb0a02ecf95e5f47d92e7d4c513cc1f7aeb40cda +refs/heads/master: 81de916f19cf5f1437c0b9ed817364f0f7c81961 diff --git a/trunk/drivers/tty/tty_buffer.c b/trunk/drivers/tty/tty_buffer.c index f1a7918d71aa..6c9b7cd6778a 100644 --- a/trunk/drivers/tty/tty_buffer.c +++ b/trunk/drivers/tty/tty_buffer.c @@ -413,8 +413,7 @@ static void flush_to_ldisc(struct work_struct *work) spin_lock_irqsave(&tty->buf.lock, flags); if (!test_and_set_bit(TTY_FLUSHING, &tty->flags)) { - struct tty_buffer *head, *tail = tty->buf.tail; - int seen_tail = 0; + struct tty_buffer *head; while ((head = tty->buf.head) != NULL) { int count; char *char_buf; @@ -424,15 +423,6 @@ static void flush_to_ldisc(struct work_struct *work) if (!count) { if (head->next == NULL) break; - /* - There's a possibility tty might get new buffer - added during the unlock window below. We could - end up spinning in here forever hogging the CPU - completely. To avoid this let's have a rest each - time we processed the tail buffer. - */ - if (tail == head) - seen_tail = 1; tty->buf.head = head->next; tty_buffer_free(tty, head); continue; @@ -442,7 +432,7 @@ static void flush_to_ldisc(struct work_struct *work) line discipline as we want to empty the queue */ if (test_bit(TTY_FLUSHPENDING, &tty->flags)) break; - if (!tty->receive_room || seen_tail) + if (!tty->receive_room) break; if (count > tty->receive_room) count = tty->receive_room;