aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/tty
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/tty')
-rw-r--r--drivers/tty/serial/mrst_max3110.c5
-rw-r--r--drivers/tty/serial/pch_uart.c4
-rw-r--r--drivers/tty/tty_buffer.c14
3 files changed, 8 insertions, 15 deletions
diff --git a/drivers/tty/serial/mrst_max3110.c b/drivers/tty/serial/mrst_max3110.c
index 1bd28450ca40..a764bf99743b 100644
--- a/drivers/tty/serial/mrst_max3110.c
+++ b/drivers/tty/serial/mrst_max3110.c
@@ -421,7 +421,6 @@ static int max3110_main_thread(void *_max)
421 int ret = 0; 421 int ret = 0;
422 struct circ_buf *xmit = &max->con_xmit; 422 struct circ_buf *xmit = &max->con_xmit;
423 423
424 init_waitqueue_head(wq);
425 pr_info(PR_FMT "start main thread\n"); 424 pr_info(PR_FMT "start main thread\n");
426 425
427 do { 426 do {
@@ -823,7 +822,7 @@ static int __devinit serial_m3110_probe(struct spi_device *spi)
823 res = RC_TAG; 822 res = RC_TAG;
824 ret = max3110_write_then_read(max, (u8 *)&res, (u8 *)&res, 2, 0); 823 ret = max3110_write_then_read(max, (u8 *)&res, (u8 *)&res, 2, 0);
825 if (ret < 0 || res == 0 || res == 0xffff) { 824 if (ret < 0 || res == 0 || res == 0xffff) {
826 printk(KERN_ERR "MAX3111 deemed not present (conf reg %04x)", 825 dev_dbg(&spi->dev, "MAX3111 deemed not present (conf reg %04x)",
827 res); 826 res);
828 ret = -ENODEV; 827 ret = -ENODEV;
829 goto err_get_page; 828 goto err_get_page;
@@ -838,6 +837,8 @@ static int __devinit serial_m3110_probe(struct spi_device *spi)
838 max->con_xmit.head = 0; 837 max->con_xmit.head = 0;
839 max->con_xmit.tail = 0; 838 max->con_xmit.tail = 0;
840 839
840 init_waitqueue_head(&max->wq);
841
841 max->main_thread = kthread_run(max3110_main_thread, 842 max->main_thread = kthread_run(max3110_main_thread,
842 max, "max3110_main"); 843 max, "max3110_main");
843 if (IS_ERR(max->main_thread)) { 844 if (IS_ERR(max->main_thread)) {
diff --git a/drivers/tty/serial/pch_uart.c b/drivers/tty/serial/pch_uart.c
index f2cb7503fcb2..465210930890 100644
--- a/drivers/tty/serial/pch_uart.c
+++ b/drivers/tty/serial/pch_uart.c
@@ -1397,6 +1397,7 @@ static struct eg20t_port *pch_uart_init_port(struct pci_dev *pdev,
1397 int fifosize, base_baud; 1397 int fifosize, base_baud;
1398 int port_type; 1398 int port_type;
1399 struct pch_uart_driver_data *board; 1399 struct pch_uart_driver_data *board;
1400 const char *board_name;
1400 1401
1401 board = &drv_dat[id->driver_data]; 1402 board = &drv_dat[id->driver_data];
1402 port_type = board->port_type; 1403 port_type = board->port_type;
@@ -1412,7 +1413,8 @@ static struct eg20t_port *pch_uart_init_port(struct pci_dev *pdev,
1412 base_baud = 1843200; /* 1.8432MHz */ 1413 base_baud = 1843200; /* 1.8432MHz */
1413 1414
1414 /* quirk for CM-iTC board */ 1415 /* quirk for CM-iTC board */
1415 if (strstr(dmi_get_system_info(DMI_BOARD_NAME), "CM-iTC")) 1416 board_name = dmi_get_system_info(DMI_BOARD_NAME);
1417 if (board_name && strstr(board_name, "CM-iTC"))
1416 base_baud = 192000000; /* 192.0MHz */ 1418 base_baud = 192000000; /* 192.0MHz */
1417 1419
1418 switch (port_type) { 1420 switch (port_type) {
diff --git a/drivers/tty/tty_buffer.c b/drivers/tty/tty_buffer.c
index f1a7918d71aa..6c9b7cd6778a 100644
--- a/drivers/tty/tty_buffer.c
+++ b/drivers/tty/tty_buffer.c
@@ -413,8 +413,7 @@ 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, *tail = tty->buf.tail; 416 struct tty_buffer *head;
417 int seen_tail = 0;
418 while ((head = tty->buf.head) != NULL) { 417 while ((head = tty->buf.head) != NULL) {
419 int count; 418 int count;
420 char *char_buf; 419 char *char_buf;
@@ -424,15 +423,6 @@ static void flush_to_ldisc(struct work_struct *work)
424 if (!count) { 423 if (!count) {
425 if (head->next == NULL) 424 if (head->next == NULL)
426 break; 425 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;
436 tty->buf.head = head->next; 426 tty->buf.head = head->next;
437 tty_buffer_free(tty, head); 427 tty_buffer_free(tty, head);
438 continue; 428 continue;
@@ -442,7 +432,7 @@ static void flush_to_ldisc(struct work_struct *work)
442 line discipline as we want to empty the queue */ 432 line discipline as we want to empty the queue */
443 if (test_bit(TTY_FLUSHPENDING, &tty->flags)) 433 if (test_bit(TTY_FLUSHPENDING, &tty->flags))
444 break; 434 break;
445 if (!tty->receive_room || seen_tail) 435 if (!tty->receive_room)
446 break; 436 break;
447 if (count > tty->receive_room) 437 if (count > tty->receive_room)
448 count = tty->receive_room; 438 count = tty->receive_room;