summaryrefslogtreecommitdiff
path: root/drivers/tty
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2011-05-02 14:08:43 +0200
committerTejun Heo <tj@kernel.org>2011-05-02 14:08:47 +0200
commitaff364860aa105b2deacc6f21ec8ef524460e3fc (patch)
tree18409ebe16b25b141598da9b6386d69416c06afa /drivers/tty
parentc7a7b814c9dca9ee01b38e63b4a46de87156d3b6 (diff)
parent993ba1585cbb03fab012e41d1a5d24330a283b31 (diff)
Merge branch 'x86/numa' into x86-mm
Merge reason: Pick up x86-32 remap allocator cleanup changes - 14 commits, 3fe14ab541^..993ba1585c. 3fe14ab541: x86-32, numa: Fix failure condition check in alloc_remap() 993ba1585c: x86-32, numa: Update remap allocator comments Scheduled NUMA init 32/64bit unification changes depend on them. Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'drivers/tty')
-rw-r--r--drivers/tty/n_tty.c6
-rw-r--r--drivers/tty/tty_buffer.c4
2 files changed, 7 insertions, 3 deletions
diff --git a/drivers/tty/n_tty.c b/drivers/tty/n_tty.c
index 428f4fe0b5f7..0ad32888091c 100644
--- a/drivers/tty/n_tty.c
+++ b/drivers/tty/n_tty.c
@@ -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)
diff --git a/drivers/tty/tty_buffer.c b/drivers/tty/tty_buffer.c
index b9451219528b..f1a7918d71aa 100644
--- a/drivers/tty/tty_buffer.c
+++ b/drivers/tty/tty_buffer.c
@@ -442,10 +442,8 @@ 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) {
- schedule_work(&tty->buf.work);
+ if (!tty->receive_room || seen_tail)
break;
- }
if (count > tty->receive_room)
count = tty->receive_room;
char_buf = head->char_buf_ptr + head->read;