aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/selection.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2010-08-10 18:03:42 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2010-08-10 18:03:42 -0400
commitfc385c313275b114bc6ad36e60c5177d63250548 (patch)
tree3436184ec3af11e6506df5233889700a74427055 /drivers/char/selection.c
parenta92b166e6b8c3c0037493690b2800b0b0dd92063 (diff)
parent235dae5d094c415fcf0fc79fa637f1901bc8afe2 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty-2.6: (68 commits) U6715 16550A serial driver support Char: nozomi, set tty->driver_data appropriately Char: nozomi, fix tty->count counting serial: max3107: Fix gpiolib support hsu: call PCI pm hooks in suspend/resume function hsu: some code cleanup hsu: add a periodic timer to check dma rx channel hsu: driver for Medfield High Speed UART device mxser: remove unnesesary NULL check serial: add support for OX16PCI958 card serial: 68328serial.c: remove dead (ALMA_ANS | DRAGONIXVZ | M68EZ328ADS) timbuart: use __devinit and __devexit macros for probe and remove serial: MMIO32 support for 8250_early.c serial: mcf: don't take spinlocks in already protected functions serial: general fixes in the serial_rs485 structure serial: fix missing bit coverage of ASYNC_FLAGS serial: "altera_uart: simplify altera_uart_console_putc()" checkpatch fixes serial: crisv10: formatting of pointers in printk() vt: Fix warning: statement with no effect due to vt_kern.h tty_io: remove casts from void* ...
Diffstat (limited to 'drivers/char/selection.c')
-rw-r--r--drivers/char/selection.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/drivers/char/selection.c b/drivers/char/selection.c
index f97b9e848064..ebae344ce910 100644
--- a/drivers/char/selection.c
+++ b/drivers/char/selection.c
@@ -26,6 +26,7 @@
26#include <linux/selection.h> 26#include <linux/selection.h>
27#include <linux/tiocl.h> 27#include <linux/tiocl.h>
28#include <linux/console.h> 28#include <linux/console.h>
29#include <linux/smp_lock.h>
29 30
30/* Don't take this from <ctype.h>: 011-015 on the screen aren't spaces */ 31/* Don't take this from <ctype.h>: 011-015 on the screen aren't spaces */
31#define isspace(c) ((c) == ' ') 32#define isspace(c) ((c) == ' ')
@@ -312,12 +313,20 @@ int paste_selection(struct tty_struct *tty)
312 struct tty_ldisc *ld; 313 struct tty_ldisc *ld;
313 DECLARE_WAITQUEUE(wait, current); 314 DECLARE_WAITQUEUE(wait, current);
314 315
316 /* always called with BTM from vt_ioctl */
317 WARN_ON(!tty_locked());
318
315 acquire_console_sem(); 319 acquire_console_sem();
316 poke_blanked_console(); 320 poke_blanked_console();
317 release_console_sem(); 321 release_console_sem();
318 322
319 ld = tty_ldisc_ref_wait(tty); 323 ld = tty_ldisc_ref(tty);
320 324 if (!ld) {
325 tty_unlock();
326 ld = tty_ldisc_ref_wait(tty);
327 tty_lock();
328 }
329
321 add_wait_queue(&vc->paste_wait, &wait); 330 add_wait_queue(&vc->paste_wait, &wait);
322 while (sel_buffer && sel_buffer_lth > pasted) { 331 while (sel_buffer && sel_buffer_lth > pasted) {
323 set_current_state(TASK_INTERRUPTIBLE); 332 set_current_state(TASK_INTERRUPTIBLE);