diff options
-rw-r--r-- | MAINTAINERS | 4 | ||||
-rw-r--r-- | drivers/char/amiserial.c | 1 | ||||
-rw-r--r-- | drivers/char/nozomi.c | 1 | ||||
-rw-r--r-- | drivers/char/pcmcia/synclink_cs.c | 1 | ||||
-rw-r--r-- | drivers/serial/8250.c | 5 | ||||
-rw-r--r-- | drivers/serial/8250_pci.c | 5 | ||||
-rw-r--r-- | drivers/serial/bfin_5xx.c | 31 | ||||
-rw-r--r-- | drivers/tty/n_gsm.c | 5 | ||||
-rw-r--r-- | drivers/tty/tty_buffer.c | 14 | ||||
-rw-r--r-- | drivers/tty/tty_ldisc.c | 49 | ||||
-rw-r--r-- | drivers/tty/vt/vc_screen.c | 6 | ||||
-rw-r--r-- | include/linux/tty.h | 2 |
12 files changed, 94 insertions, 30 deletions
diff --git a/MAINTAINERS b/MAINTAINERS index 6a16f21117df..716c548107dd 100644 --- a/MAINTAINERS +++ b/MAINTAINERS | |||
@@ -161,7 +161,7 @@ M: Greg Kroah-Hartman <gregkh@suse.de> | |||
161 | L: linux-serial@vger.kernel.org | 161 | L: linux-serial@vger.kernel.org |
162 | W: http://serial.sourceforge.net | 162 | W: http://serial.sourceforge.net |
163 | S: Maintained | 163 | S: Maintained |
164 | T: quilt kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/ | 164 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty-2.6.git |
165 | F: drivers/serial/8250* | 165 | F: drivers/serial/8250* |
166 | F: include/linux/serial_8250.h | 166 | F: include/linux/serial_8250.h |
167 | 167 | ||
@@ -5910,7 +5910,7 @@ S: Maintained | |||
5910 | TTY LAYER | 5910 | TTY LAYER |
5911 | M: Greg Kroah-Hartman <gregkh@suse.de> | 5911 | M: Greg Kroah-Hartman <gregkh@suse.de> |
5912 | S: Maintained | 5912 | S: Maintained |
5913 | T: quilt kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/ | 5913 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty-2.6.git |
5914 | F: drivers/char/tty_* | 5914 | F: drivers/char/tty_* |
5915 | F: drivers/serial/serial_core.c | 5915 | F: drivers/serial/serial_core.c |
5916 | F: include/linux/serial_core.h | 5916 | F: include/linux/serial_core.h |
diff --git a/drivers/char/amiserial.c b/drivers/char/amiserial.c index b0a70461a12c..c0bd6f472c52 100644 --- a/drivers/char/amiserial.c +++ b/drivers/char/amiserial.c | |||
@@ -1299,7 +1299,6 @@ static int rs_ioctl(struct tty_struct *tty, struct file * file, | |||
1299 | { | 1299 | { |
1300 | struct async_struct * info = tty->driver_data; | 1300 | struct async_struct * info = tty->driver_data; |
1301 | struct async_icount cprev, cnow; /* kernel counter temps */ | 1301 | struct async_icount cprev, cnow; /* kernel counter temps */ |
1302 | struct serial_icounter_struct icount; | ||
1303 | void __user *argp = (void __user *)arg; | 1302 | void __user *argp = (void __user *)arg; |
1304 | unsigned long flags; | 1303 | unsigned long flags; |
1305 | 1304 | ||
diff --git a/drivers/char/nozomi.c b/drivers/char/nozomi.c index dd3f9b1f11b4..294d03e8c61a 100644 --- a/drivers/char/nozomi.c +++ b/drivers/char/nozomi.c | |||
@@ -1828,7 +1828,6 @@ static int ntty_ioctl(struct tty_struct *tty, struct file *file, | |||
1828 | unsigned int cmd, unsigned long arg) | 1828 | unsigned int cmd, unsigned long arg) |
1829 | { | 1829 | { |
1830 | struct port *port = tty->driver_data; | 1830 | struct port *port = tty->driver_data; |
1831 | void __user *argp = (void __user *)arg; | ||
1832 | int rval = -ENOIOCTLCMD; | 1831 | int rval = -ENOIOCTLCMD; |
1833 | 1832 | ||
1834 | DBG1("******** IOCTL, cmd: %d", cmd); | 1833 | DBG1("******** IOCTL, cmd: %d", cmd); |
diff --git a/drivers/char/pcmcia/synclink_cs.c b/drivers/char/pcmcia/synclink_cs.c index bfc10f89d951..eaa41992fbe2 100644 --- a/drivers/char/pcmcia/synclink_cs.c +++ b/drivers/char/pcmcia/synclink_cs.c | |||
@@ -2796,6 +2796,7 @@ static const struct tty_operations mgslpc_ops = { | |||
2796 | .hangup = mgslpc_hangup, | 2796 | .hangup = mgslpc_hangup, |
2797 | .tiocmget = tiocmget, | 2797 | .tiocmget = tiocmget, |
2798 | .tiocmset = tiocmset, | 2798 | .tiocmset = tiocmset, |
2799 | .get_icount = mgslpc_get_icount, | ||
2799 | .proc_fops = &mgslpc_proc_fops, | 2800 | .proc_fops = &mgslpc_proc_fops, |
2800 | }; | 2801 | }; |
2801 | 2802 | ||
diff --git a/drivers/serial/8250.c b/drivers/serial/8250.c index 4d8e14b7aa93..dd5e1ac22251 100644 --- a/drivers/serial/8250.c +++ b/drivers/serial/8250.c | |||
@@ -2343,8 +2343,11 @@ serial8250_do_set_termios(struct uart_port *port, struct ktermios *termios, | |||
2343 | 2343 | ||
2344 | /* | 2344 | /* |
2345 | * CTS flow control flag and modem status interrupts | 2345 | * CTS flow control flag and modem status interrupts |
2346 | * Only disable MSI if no threads are waiting in | ||
2347 | * serial_core::uart_wait_modem_status | ||
2346 | */ | 2348 | */ |
2347 | up->ier &= ~UART_IER_MSI; | 2349 | if (!waitqueue_active(&up->port.state->port.delta_msr_wait)) |
2350 | up->ier &= ~UART_IER_MSI; | ||
2348 | if (!(up->bugs & UART_BUG_NOMSR) && | 2351 | if (!(up->bugs & UART_BUG_NOMSR) && |
2349 | UART_ENABLE_MS(&up->port, termios->c_cflag)) | 2352 | UART_ENABLE_MS(&up->port, termios->c_cflag)) |
2350 | up->ier |= UART_IER_MSI; | 2353 | up->ier |= UART_IER_MSI; |
diff --git a/drivers/serial/8250_pci.c b/drivers/serial/8250_pci.c index 53be4d35a0aa..842e3b2a02b1 100644 --- a/drivers/serial/8250_pci.c +++ b/drivers/serial/8250_pci.c | |||
@@ -2285,6 +2285,8 @@ static struct pciserial_board pci_boards[] __devinitdata = { | |||
2285 | 2285 | ||
2286 | static const struct pci_device_id softmodem_blacklist[] = { | 2286 | static const struct pci_device_id softmodem_blacklist[] = { |
2287 | { PCI_VDEVICE(AL, 0x5457), }, /* ALi Corporation M5457 AC'97 Modem */ | 2287 | { PCI_VDEVICE(AL, 0x5457), }, /* ALi Corporation M5457 AC'97 Modem */ |
2288 | { PCI_VDEVICE(MOTOROLA, 0x3052), }, /* Motorola Si3052-based modem */ | ||
2289 | { PCI_DEVICE(0x1543, 0x3052), }, /* Si3052-based modem, default IDs */ | ||
2288 | }; | 2290 | }; |
2289 | 2291 | ||
2290 | /* | 2292 | /* |
@@ -2863,6 +2865,9 @@ static struct pci_device_id serial_pci_tbl[] = { | |||
2863 | PCI_SUBVENDOR_ID_SIIG, PCI_SUBDEVICE_ID_SIIG_QUARTET_SERIAL, | 2865 | PCI_SUBVENDOR_ID_SIIG, PCI_SUBDEVICE_ID_SIIG_QUARTET_SERIAL, |
2864 | 0, 0, | 2866 | 0, 0, |
2865 | pbn_b0_4_1152000 }, | 2867 | pbn_b0_4_1152000 }, |
2868 | { PCI_VENDOR_ID_OXSEMI, 0x9505, | ||
2869 | PCI_ANY_ID, PCI_ANY_ID, 0, 0, | ||
2870 | pbn_b0_bt_2_921600 }, | ||
2866 | 2871 | ||
2867 | /* | 2872 | /* |
2868 | * The below card is a little controversial since it is the | 2873 | * The below card is a little controversial since it is the |
diff --git a/drivers/serial/bfin_5xx.c b/drivers/serial/bfin_5xx.c index a9eff2b18eab..19cac9f610fd 100644 --- a/drivers/serial/bfin_5xx.c +++ b/drivers/serial/bfin_5xx.c | |||
@@ -23,6 +23,7 @@ | |||
23 | #include <linux/tty.h> | 23 | #include <linux/tty.h> |
24 | #include <linux/tty_flip.h> | 24 | #include <linux/tty_flip.h> |
25 | #include <linux/serial_core.h> | 25 | #include <linux/serial_core.h> |
26 | #include <linux/dma-mapping.h> | ||
26 | 27 | ||
27 | #if defined(CONFIG_KGDB_SERIAL_CONSOLE) || \ | 28 | #if defined(CONFIG_KGDB_SERIAL_CONSOLE) || \ |
28 | defined(CONFIG_KGDB_SERIAL_CONSOLE_MODULE) | 29 | defined(CONFIG_KGDB_SERIAL_CONSOLE_MODULE) |
@@ -33,12 +34,10 @@ | |||
33 | #include <asm/gpio.h> | 34 | #include <asm/gpio.h> |
34 | #include <mach/bfin_serial_5xx.h> | 35 | #include <mach/bfin_serial_5xx.h> |
35 | 36 | ||
36 | #ifdef CONFIG_SERIAL_BFIN_DMA | 37 | #include <asm/dma.h> |
37 | #include <linux/dma-mapping.h> | ||
38 | #include <asm/io.h> | 38 | #include <asm/io.h> |
39 | #include <asm/irq.h> | 39 | #include <asm/irq.h> |
40 | #include <asm/cacheflush.h> | 40 | #include <asm/cacheflush.h> |
41 | #endif | ||
42 | 41 | ||
43 | #ifdef CONFIG_SERIAL_BFIN_MODULE | 42 | #ifdef CONFIG_SERIAL_BFIN_MODULE |
44 | # undef CONFIG_EARLY_PRINTK | 43 | # undef CONFIG_EARLY_PRINTK |
@@ -360,7 +359,6 @@ static void bfin_serial_tx_chars(struct bfin_serial_port *uart) | |||
360 | UART_PUT_CHAR(uart, xmit->buf[xmit->tail]); | 359 | UART_PUT_CHAR(uart, xmit->buf[xmit->tail]); |
361 | xmit->tail = (xmit->tail + 1) & (UART_XMIT_SIZE - 1); | 360 | xmit->tail = (xmit->tail + 1) & (UART_XMIT_SIZE - 1); |
362 | uart->port.icount.tx++; | 361 | uart->port.icount.tx++; |
363 | SSYNC(); | ||
364 | } | 362 | } |
365 | 363 | ||
366 | if (uart_circ_chars_pending(xmit) < WAKEUP_CHARS) | 364 | if (uart_circ_chars_pending(xmit) < WAKEUP_CHARS) |
@@ -688,6 +686,13 @@ static int bfin_serial_startup(struct uart_port *port) | |||
688 | 686 | ||
689 | # ifdef CONFIG_BF54x | 687 | # ifdef CONFIG_BF54x |
690 | { | 688 | { |
689 | /* | ||
690 | * UART2 and UART3 on BF548 share interrupt PINs and DMA | ||
691 | * controllers with SPORT2 and SPORT3. UART rx and tx | ||
692 | * interrupts are generated in PIO mode only when configure | ||
693 | * their peripheral mapping registers properly, which means | ||
694 | * request corresponding DMA channels in PIO mode as well. | ||
695 | */ | ||
691 | unsigned uart_dma_ch_rx, uart_dma_ch_tx; | 696 | unsigned uart_dma_ch_rx, uart_dma_ch_tx; |
692 | 697 | ||
693 | switch (uart->port.irq) { | 698 | switch (uart->port.irq) { |
@@ -734,8 +739,7 @@ static int bfin_serial_startup(struct uart_port *port) | |||
734 | IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING | | 739 | IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING | |
735 | IRQF_DISABLED, "BFIN_UART_CTS", uart)) { | 740 | IRQF_DISABLED, "BFIN_UART_CTS", uart)) { |
736 | uart->cts_pin = -1; | 741 | uart->cts_pin = -1; |
737 | pr_info("Unable to attach BlackFin UART CTS interrupt.\ | 742 | pr_info("Unable to attach BlackFin UART CTS interrupt. So, disable it.\n"); |
738 | So, disable it.\n"); | ||
739 | } | 743 | } |
740 | } | 744 | } |
741 | if (uart->rts_pin >= 0) { | 745 | if (uart->rts_pin >= 0) { |
@@ -747,8 +751,7 @@ static int bfin_serial_startup(struct uart_port *port) | |||
747 | if (request_irq(uart->status_irq, | 751 | if (request_irq(uart->status_irq, |
748 | bfin_serial_mctrl_cts_int, | 752 | bfin_serial_mctrl_cts_int, |
749 | IRQF_DISABLED, "BFIN_UART_MODEM_STATUS", uart)) { | 753 | IRQF_DISABLED, "BFIN_UART_MODEM_STATUS", uart)) { |
750 | pr_info("Unable to attach BlackFin UART Modem \ | 754 | pr_info("Unable to attach BlackFin UART Modem Status interrupt.\n"); |
751 | Status interrupt.\n"); | ||
752 | } | 755 | } |
753 | 756 | ||
754 | /* CTS RTS PINs are negative assertive. */ | 757 | /* CTS RTS PINs are negative assertive. */ |
@@ -846,6 +849,8 @@ bfin_serial_set_termios(struct uart_port *port, struct ktermios *termios, | |||
846 | if (termios->c_cflag & CMSPAR) | 849 | if (termios->c_cflag & CMSPAR) |
847 | lcr |= STP; | 850 | lcr |= STP; |
848 | 851 | ||
852 | spin_lock_irqsave(&uart->port.lock, flags); | ||
853 | |||
849 | port->read_status_mask = OE; | 854 | port->read_status_mask = OE; |
850 | if (termios->c_iflag & INPCK) | 855 | if (termios->c_iflag & INPCK) |
851 | port->read_status_mask |= (FE | PE); | 856 | port->read_status_mask |= (FE | PE); |
@@ -875,8 +880,6 @@ bfin_serial_set_termios(struct uart_port *port, struct ktermios *termios, | |||
875 | if (termios->c_line != N_IRDA) | 880 | if (termios->c_line != N_IRDA) |
876 | quot -= ANOMALY_05000230; | 881 | quot -= ANOMALY_05000230; |
877 | 882 | ||
878 | spin_lock_irqsave(&uart->port.lock, flags); | ||
879 | |||
880 | UART_SET_ANOMALY_THRESHOLD(uart, USEC_PER_SEC / baud * 15); | 883 | UART_SET_ANOMALY_THRESHOLD(uart, USEC_PER_SEC / baud * 15); |
881 | 884 | ||
882 | /* Disable UART */ | 885 | /* Disable UART */ |
@@ -1321,6 +1324,14 @@ struct console __init *bfin_earlyserial_init(unsigned int port, | |||
1321 | struct bfin_serial_port *uart; | 1324 | struct bfin_serial_port *uart; |
1322 | struct ktermios t; | 1325 | struct ktermios t; |
1323 | 1326 | ||
1327 | #ifdef CONFIG_SERIAL_BFIN_CONSOLE | ||
1328 | /* | ||
1329 | * If we are using early serial, don't let the normal console rewind | ||
1330 | * log buffer, since that causes things to be printed multiple times | ||
1331 | */ | ||
1332 | bfin_serial_console.flags &= ~CON_PRINTBUFFER; | ||
1333 | #endif | ||
1334 | |||
1324 | if (port == -1 || port >= nr_active_ports) | 1335 | if (port == -1 || port >= nr_active_ports) |
1325 | port = 0; | 1336 | port = 0; |
1326 | bfin_serial_init_ports(); | 1337 | bfin_serial_init_ports(); |
diff --git a/drivers/tty/n_gsm.c b/drivers/tty/n_gsm.c index 04ef3ef0a422..81b46585edf7 100644 --- a/drivers/tty/n_gsm.c +++ b/drivers/tty/n_gsm.c | |||
@@ -716,8 +716,8 @@ static void __gsm_data_queue(struct gsm_dlci *dlci, struct gsm_msg *msg) | |||
716 | if (msg->len < 128) | 716 | if (msg->len < 128) |
717 | *--dp = (msg->len << 1) | EA; | 717 | *--dp = (msg->len << 1) | EA; |
718 | else { | 718 | else { |
719 | *--dp = (msg->len >> 6) | EA; | 719 | *--dp = ((msg->len & 127) << 1) | EA; |
720 | *--dp = (msg->len & 127) << 1; | 720 | *--dp = (msg->len >> 6) & 0xfe; |
721 | } | 721 | } |
722 | } | 722 | } |
723 | 723 | ||
@@ -2375,6 +2375,7 @@ static int gsmld_config(struct tty_struct *tty, struct gsm_mux *gsm, | |||
2375 | gsm->mru = c->mru; | 2375 | gsm->mru = c->mru; |
2376 | gsm->encoding = c->encapsulation; | 2376 | gsm->encoding = c->encapsulation; |
2377 | gsm->adaption = c->adaption; | 2377 | gsm->adaption = c->adaption; |
2378 | gsm->n2 = c->n2; | ||
2378 | 2379 | ||
2379 | if (c->i == 1) | 2380 | if (c->i == 1) |
2380 | gsm->ftype = UIH; | 2381 | gsm->ftype = UIH; |
diff --git a/drivers/tty/tty_buffer.c b/drivers/tty/tty_buffer.c index cc1e9850d655..d8210ca00720 100644 --- a/drivers/tty/tty_buffer.c +++ b/drivers/tty/tty_buffer.c | |||
@@ -413,7 +413,8 @@ static void flush_to_ldisc(struct work_struct *work) | |||
413 | spin_lock_irqsave(&tty->buf.lock, flags); | 413 | spin_lock_irqsave(&tty->buf.lock, flags); |
414 | 414 | ||
415 | if (!test_and_set_bit(TTY_FLUSHING, &tty->flags)) { | 415 | if (!test_and_set_bit(TTY_FLUSHING, &tty->flags)) { |
416 | struct tty_buffer *head; | 416 | struct tty_buffer *head, *tail = tty->buf.tail; |
417 | int seen_tail = 0; | ||
417 | while ((head = tty->buf.head) != NULL) { | 418 | while ((head = tty->buf.head) != NULL) { |
418 | int count; | 419 | int count; |
419 | char *char_buf; | 420 | char *char_buf; |
@@ -423,6 +424,15 @@ static void flush_to_ldisc(struct work_struct *work) | |||
423 | if (!count) { | 424 | if (!count) { |
424 | if (head->next == NULL) | 425 | if (head->next == NULL) |
425 | break; | 426 | break; |
427 | /* | ||
428 | There's a possibility tty might get new buffer | ||
429 | added during the unlock window below. We could | ||
430 | end up spinning in here forever hogging the CPU | ||
431 | completely. To avoid this let's have a rest each | ||
432 | time we processed the tail buffer. | ||
433 | */ | ||
434 | if (tail == head) | ||
435 | seen_tail = 1; | ||
426 | tty->buf.head = head->next; | 436 | tty->buf.head = head->next; |
427 | tty_buffer_free(tty, head); | 437 | tty_buffer_free(tty, head); |
428 | continue; | 438 | continue; |
@@ -432,7 +442,7 @@ static void flush_to_ldisc(struct work_struct *work) | |||
432 | line discipline as we want to empty the queue */ | 442 | line discipline as we want to empty the queue */ |
433 | if (test_bit(TTY_FLUSHPENDING, &tty->flags)) | 443 | if (test_bit(TTY_FLUSHPENDING, &tty->flags)) |
434 | break; | 444 | break; |
435 | if (!tty->receive_room) { | 445 | if (!tty->receive_room || seen_tail) { |
436 | schedule_delayed_work(&tty->buf.work, 1); | 446 | schedule_delayed_work(&tty->buf.work, 1); |
437 | break; | 447 | break; |
438 | } | 448 | } |
diff --git a/drivers/tty/tty_ldisc.c b/drivers/tty/tty_ldisc.c index 412f9775d19c..d8e96b005023 100644 --- a/drivers/tty/tty_ldisc.c +++ b/drivers/tty/tty_ldisc.c | |||
@@ -47,6 +47,7 @@ | |||
47 | 47 | ||
48 | static DEFINE_SPINLOCK(tty_ldisc_lock); | 48 | static DEFINE_SPINLOCK(tty_ldisc_lock); |
49 | static DECLARE_WAIT_QUEUE_HEAD(tty_ldisc_wait); | 49 | static DECLARE_WAIT_QUEUE_HEAD(tty_ldisc_wait); |
50 | static DECLARE_WAIT_QUEUE_HEAD(tty_ldisc_idle); | ||
50 | /* Line disc dispatch table */ | 51 | /* Line disc dispatch table */ |
51 | static struct tty_ldisc_ops *tty_ldiscs[NR_LDISCS]; | 52 | static struct tty_ldisc_ops *tty_ldiscs[NR_LDISCS]; |
52 | 53 | ||
@@ -83,6 +84,7 @@ static void put_ldisc(struct tty_ldisc *ld) | |||
83 | return; | 84 | return; |
84 | } | 85 | } |
85 | local_irq_restore(flags); | 86 | local_irq_restore(flags); |
87 | wake_up(&tty_ldisc_idle); | ||
86 | } | 88 | } |
87 | 89 | ||
88 | /** | 90 | /** |
@@ -531,6 +533,23 @@ static int tty_ldisc_halt(struct tty_struct *tty) | |||
531 | } | 533 | } |
532 | 534 | ||
533 | /** | 535 | /** |
536 | * tty_ldisc_wait_idle - wait for the ldisc to become idle | ||
537 | * @tty: tty to wait for | ||
538 | * | ||
539 | * Wait for the line discipline to become idle. The discipline must | ||
540 | * have been halted for this to guarantee it remains idle. | ||
541 | */ | ||
542 | static int tty_ldisc_wait_idle(struct tty_struct *tty) | ||
543 | { | ||
544 | int ret; | ||
545 | ret = wait_event_interruptible_timeout(tty_ldisc_idle, | ||
546 | atomic_read(&tty->ldisc->users) == 1, 5 * HZ); | ||
547 | if (ret < 0) | ||
548 | return ret; | ||
549 | return ret > 0 ? 0 : -EBUSY; | ||
550 | } | ||
551 | |||
552 | /** | ||
534 | * tty_set_ldisc - set line discipline | 553 | * tty_set_ldisc - set line discipline |
535 | * @tty: the terminal to set | 554 | * @tty: the terminal to set |
536 | * @ldisc: the line discipline | 555 | * @ldisc: the line discipline |
@@ -634,8 +653,17 @@ int tty_set_ldisc(struct tty_struct *tty, int ldisc) | |||
634 | 653 | ||
635 | flush_scheduled_work(); | 654 | flush_scheduled_work(); |
636 | 655 | ||
656 | retval = tty_ldisc_wait_idle(tty); | ||
657 | |||
637 | tty_lock(); | 658 | tty_lock(); |
638 | mutex_lock(&tty->ldisc_mutex); | 659 | mutex_lock(&tty->ldisc_mutex); |
660 | |||
661 | /* handle wait idle failure locked */ | ||
662 | if (retval) { | ||
663 | tty_ldisc_put(new_ldisc); | ||
664 | goto enable; | ||
665 | } | ||
666 | |||
639 | if (test_bit(TTY_HUPPED, &tty->flags)) { | 667 | if (test_bit(TTY_HUPPED, &tty->flags)) { |
640 | /* We were raced by the hangup method. It will have stomped | 668 | /* We were raced by the hangup method. It will have stomped |
641 | the ldisc data and closed the ldisc down */ | 669 | the ldisc data and closed the ldisc down */ |
@@ -669,6 +697,7 @@ int tty_set_ldisc(struct tty_struct *tty, int ldisc) | |||
669 | 697 | ||
670 | tty_ldisc_put(o_ldisc); | 698 | tty_ldisc_put(o_ldisc); |
671 | 699 | ||
700 | enable: | ||
672 | /* | 701 | /* |
673 | * Allow ldisc referencing to occur again | 702 | * Allow ldisc referencing to occur again |
674 | */ | 703 | */ |
@@ -714,9 +743,12 @@ static void tty_reset_termios(struct tty_struct *tty) | |||
714 | * state closed | 743 | * state closed |
715 | */ | 744 | */ |
716 | 745 | ||
717 | static void tty_ldisc_reinit(struct tty_struct *tty, int ldisc) | 746 | static int tty_ldisc_reinit(struct tty_struct *tty, int ldisc) |
718 | { | 747 | { |
719 | struct tty_ldisc *ld; | 748 | struct tty_ldisc *ld = tty_ldisc_get(ldisc); |
749 | |||
750 | if (IS_ERR(ld)) | ||
751 | return -1; | ||
720 | 752 | ||
721 | tty_ldisc_close(tty, tty->ldisc); | 753 | tty_ldisc_close(tty, tty->ldisc); |
722 | tty_ldisc_put(tty->ldisc); | 754 | tty_ldisc_put(tty->ldisc); |
@@ -724,10 +756,10 @@ static void tty_ldisc_reinit(struct tty_struct *tty, int ldisc) | |||
724 | /* | 756 | /* |
725 | * Switch the line discipline back | 757 | * Switch the line discipline back |
726 | */ | 758 | */ |
727 | ld = tty_ldisc_get(ldisc); | ||
728 | BUG_ON(IS_ERR(ld)); | ||
729 | tty_ldisc_assign(tty, ld); | 759 | tty_ldisc_assign(tty, ld); |
730 | tty_set_termios_ldisc(tty, ldisc); | 760 | tty_set_termios_ldisc(tty, ldisc); |
761 | |||
762 | return 0; | ||
731 | } | 763 | } |
732 | 764 | ||
733 | /** | 765 | /** |
@@ -802,13 +834,16 @@ void tty_ldisc_hangup(struct tty_struct *tty) | |||
802 | a FIXME */ | 834 | a FIXME */ |
803 | if (tty->ldisc) { /* Not yet closed */ | 835 | if (tty->ldisc) { /* Not yet closed */ |
804 | if (reset == 0) { | 836 | if (reset == 0) { |
805 | tty_ldisc_reinit(tty, tty->termios->c_line); | 837 | |
806 | err = tty_ldisc_open(tty, tty->ldisc); | 838 | if (!tty_ldisc_reinit(tty, tty->termios->c_line)) |
839 | err = tty_ldisc_open(tty, tty->ldisc); | ||
840 | else | ||
841 | err = 1; | ||
807 | } | 842 | } |
808 | /* If the re-open fails or we reset then go to N_TTY. The | 843 | /* If the re-open fails or we reset then go to N_TTY. The |
809 | N_TTY open cannot fail */ | 844 | N_TTY open cannot fail */ |
810 | if (reset || err) { | 845 | if (reset || err) { |
811 | tty_ldisc_reinit(tty, N_TTY); | 846 | BUG_ON(tty_ldisc_reinit(tty, N_TTY)); |
812 | WARN_ON(tty_ldisc_open(tty, tty->ldisc)); | 847 | WARN_ON(tty_ldisc_open(tty, tty->ldisc)); |
813 | } | 848 | } |
814 | tty_ldisc_enable(tty); | 849 | tty_ldisc_enable(tty); |
diff --git a/drivers/tty/vt/vc_screen.c b/drivers/tty/vt/vc_screen.c index 273ab44cc91d..eab3a1ff99e4 100644 --- a/drivers/tty/vt/vc_screen.c +++ b/drivers/tty/vt/vc_screen.c | |||
@@ -553,12 +553,12 @@ static unsigned int | |||
553 | vcs_poll(struct file *file, poll_table *wait) | 553 | vcs_poll(struct file *file, poll_table *wait) |
554 | { | 554 | { |
555 | struct vcs_poll_data *poll = vcs_poll_data_get(file); | 555 | struct vcs_poll_data *poll = vcs_poll_data_get(file); |
556 | int ret = 0; | 556 | int ret = DEFAULT_POLLMASK|POLLERR|POLLPRI; |
557 | 557 | ||
558 | if (poll) { | 558 | if (poll) { |
559 | poll_wait(file, &poll->waitq, wait); | 559 | poll_wait(file, &poll->waitq, wait); |
560 | if (!poll->seen_last_update) | 560 | if (poll->seen_last_update) |
561 | ret = POLLIN | POLLRDNORM; | 561 | ret = DEFAULT_POLLMASK; |
562 | } | 562 | } |
563 | return ret; | 563 | return ret; |
564 | } | 564 | } |
diff --git a/include/linux/tty.h b/include/linux/tty.h index 2a754748dd5f..c7ea9bc8897c 100644 --- a/include/linux/tty.h +++ b/include/linux/tty.h | |||
@@ -50,7 +50,7 @@ | |||
50 | #define N_V253 19 /* Codec control over voice modem */ | 50 | #define N_V253 19 /* Codec control over voice modem */ |
51 | #define N_CAIF 20 /* CAIF protocol for talking to modems */ | 51 | #define N_CAIF 20 /* CAIF protocol for talking to modems */ |
52 | #define N_GSM0710 21 /* GSM 0710 Mux */ | 52 | #define N_GSM0710 21 /* GSM 0710 Mux */ |
53 | #define N_TI_WL 22 /* for TI's WL BT, FM, GPS combo chips */ | 53 | #define N_TI_WL 22 /* for TI's WL BT, FM, GPS combo chips */ |
54 | 54 | ||
55 | /* | 55 | /* |
56 | * This character is the same as _POSIX_VDISABLE: it cannot be used as | 56 | * This character is the same as _POSIX_VDISABLE: it cannot be used as |