diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-05-23 15:23:20 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-05-23 15:23:20 -0400 |
commit | 99dff5856220a02b8711f2e8746413ea6e53ccf6 (patch) | |
tree | d8bae7ccdf8f7ad5221b053bb74a6220df996b3a /drivers/tty/tty_buffer.c | |
parent | bb74e8ca352eecefdc5c1a9ebab01f18aa2f6f3c (diff) | |
parent | d9a0fbfd7bc5d2c42f0fa9bcbdab62c4942d0388 (diff) |
Merge branch 'tty-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty-2.6
* 'tty-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty-2.6: (48 commits)
serial: 8250_pci: add support for Cronyx Omega PCI multiserial board.
tty/serial: Fix break handling for PORT_TEGRA
tty/serial: Add explicit PORT_TEGRA type
n_tracerouter and n_tracesink ldisc additions.
Intel PTI implementaiton of MIPI 1149.7.
Kernel documentation for the PTI feature.
export kernel call get_task_comm().
tty: Remove to support serial for S5P6442
pch_phub: Support new device ML7223
8250_pci: Add support for the Digi/IBM PCIe 2-port Adapter
ASoC: Update cx20442 for TTY API change
pch_uart: Support new device ML7223 IOH
parport: Use request_muxed_region for IT87 probe and lock
tty/serial: add support for Xilinx PS UART
n_gsm: Use print_hex_dump_bytes
drivers/tty/moxa.c: Put correct tty value
TTY: tty_io, annotate locking functions
TTY: serial_core, remove superfluous set_task_state
TTY: serial_core, remove invalid test
Char: moxa, fix locking in moxa_write
...
Fix up trivial conflicts in drivers/bluetooth/hci_ldisc.c and
drivers/tty/serial/Makefile.
I did the hci_ldisc thing as an evil merge, cleaning things up.
Diffstat (limited to 'drivers/tty/tty_buffer.c')
-rw-r--r-- | drivers/tty/tty_buffer.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/drivers/tty/tty_buffer.c b/drivers/tty/tty_buffer.c index f1a7918d71aa..46de2e075dac 100644 --- a/drivers/tty/tty_buffer.c +++ b/drivers/tty/tty_buffer.c | |||
@@ -416,6 +416,7 @@ static void flush_to_ldisc(struct work_struct *work) | |||
416 | struct tty_buffer *head, *tail = tty->buf.tail; | 416 | struct tty_buffer *head, *tail = tty->buf.tail; |
417 | int seen_tail = 0; | 417 | int seen_tail = 0; |
418 | while ((head = tty->buf.head) != NULL) { | 418 | while ((head = tty->buf.head) != NULL) { |
419 | int copied; | ||
419 | int count; | 420 | int count; |
420 | char *char_buf; | 421 | char *char_buf; |
421 | unsigned char *flag_buf; | 422 | unsigned char *flag_buf; |
@@ -442,17 +443,19 @@ static void flush_to_ldisc(struct work_struct *work) | |||
442 | line discipline as we want to empty the queue */ | 443 | line discipline as we want to empty the queue */ |
443 | if (test_bit(TTY_FLUSHPENDING, &tty->flags)) | 444 | if (test_bit(TTY_FLUSHPENDING, &tty->flags)) |
444 | break; | 445 | break; |
445 | if (!tty->receive_room || seen_tail) | ||
446 | break; | ||
447 | if (count > tty->receive_room) | ||
448 | count = tty->receive_room; | ||
449 | char_buf = head->char_buf_ptr + head->read; | 446 | char_buf = head->char_buf_ptr + head->read; |
450 | flag_buf = head->flag_buf_ptr + head->read; | 447 | flag_buf = head->flag_buf_ptr + head->read; |
451 | head->read += count; | ||
452 | spin_unlock_irqrestore(&tty->buf.lock, flags); | 448 | spin_unlock_irqrestore(&tty->buf.lock, flags); |
453 | disc->ops->receive_buf(tty, char_buf, | 449 | copied = disc->ops->receive_buf(tty, char_buf, |
454 | flag_buf, count); | 450 | flag_buf, count); |
455 | spin_lock_irqsave(&tty->buf.lock, flags); | 451 | spin_lock_irqsave(&tty->buf.lock, flags); |
452 | |||
453 | head->read += copied; | ||
454 | |||
455 | if (copied == 0 || seen_tail) { | ||
456 | schedule_work(&tty->buf.work); | ||
457 | break; | ||
458 | } | ||
456 | } | 459 | } |
457 | clear_bit(TTY_FLUSHING, &tty->flags); | 460 | clear_bit(TTY_FLUSHING, &tty->flags); |
458 | } | 461 | } |