Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'tty-3.18-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty

Pull tty/serial fixes from Greg KH:
"Here are some tiny serial/tty fixes for 3.18-rc4 that resolve some
reported issues"

* tag 'tty-3.18-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty:
tty: Fix pty master poll() after slave closes v2
serial: of-serial: fix uninitialized kmalloc variable
tty/vt: don't set font mappings on vc not supporting this
tty: serial: 8250_mtk: Fix quot calculation
tty: Prevent "read/write wait queue active!" log flooding
tty: Fix high cpu load if tty is unreleaseable
serial: Fix divide-by-zero fault in uart_get_divisor()

+31 -10
+9 -4
drivers/tty/n_tty.c
··· 2413 2413 2414 2414 poll_wait(file, &tty->read_wait, wait); 2415 2415 poll_wait(file, &tty->write_wait, wait); 2416 - if (input_available_p(tty, 1)) 2417 - mask |= POLLIN | POLLRDNORM; 2418 - if (tty->packet && tty->link->ctrl_status) 2419 - mask |= POLLPRI | POLLIN | POLLRDNORM; 2420 2416 if (test_bit(TTY_OTHER_CLOSED, &tty->flags)) 2421 2417 mask |= POLLHUP; 2418 + if (input_available_p(tty, 1)) 2419 + mask |= POLLIN | POLLRDNORM; 2420 + else if (mask & POLLHUP) { 2421 + tty_flush_to_ldisc(tty); 2422 + if (input_available_p(tty, 1)) 2423 + mask |= POLLIN | POLLRDNORM; 2424 + } 2425 + if (tty->packet && tty->link->ctrl_status) 2426 + mask |= POLLPRI | POLLIN | POLLRDNORM; 2422 2427 if (tty_hung_up_p(file)) 2423 2428 mask |= POLLHUP; 2424 2429 if (!(mask & (POLLHUP | POLLIN | POLLRDNORM))) {
+1 -1
drivers/tty/serial/8250/8250_mtk.c
··· 81 81 /* Set to highest baudrate supported */ 82 82 if (baud >= 1152000) 83 83 baud = 921600; 84 - quot = DIV_ROUND_CLOSEST(port->uartclk, 256 * baud); 84 + quot = (port->uartclk / (256 * baud)) + 1; 85 85 } 86 86 87 87 /*
+1 -1
drivers/tty/serial/of_serial.c
··· 158 158 if (of_find_property(ofdev->dev.of_node, "used-by-rtas", NULL)) 159 159 return -EBUSY; 160 160 161 - info = kmalloc(sizeof(*info), GFP_KERNEL); 161 + info = kzalloc(sizeof(*info), GFP_KERNEL); 162 162 if (info == NULL) 163 163 return -ENOMEM; 164 164
+1 -1
drivers/tty/serial/serial_core.c
··· 363 363 * The spd_hi, spd_vhi, spd_shi, spd_warp kludge... 364 364 * Die! Die! Die! 365 365 */ 366 - if (baud == 38400) 366 + if (try == 0 && baud == 38400) 367 367 baud = altbaud; 368 368 369 369 /*
+12 -3
drivers/tty/tty_io.c
··· 1709 1709 int pty_master, tty_closing, o_tty_closing, do_sleep; 1710 1710 int idx; 1711 1711 char buf[64]; 1712 + long timeout = 0; 1713 + int once = 1; 1712 1714 1713 1715 if (tty_paranoia_check(tty, inode, __func__)) 1714 1716 return 0; ··· 1791 1789 if (!do_sleep) 1792 1790 break; 1793 1791 1794 - printk(KERN_WARNING "%s: %s: read/write wait queue active!\n", 1795 - __func__, tty_name(tty, buf)); 1792 + if (once) { 1793 + once = 0; 1794 + printk(KERN_WARNING "%s: %s: read/write wait queue active!\n", 1795 + __func__, tty_name(tty, buf)); 1796 + } 1796 1797 tty_unlock_pair(tty, o_tty); 1797 1798 mutex_unlock(&tty_mutex); 1798 - schedule(); 1799 + schedule_timeout_killable(timeout); 1800 + if (timeout < 120 * HZ) 1801 + timeout = 2 * timeout + 1; 1802 + else 1803 + timeout = MAX_SCHEDULE_TIMEOUT; 1799 1804 } 1800 1805 1801 1806 /*
+7
drivers/tty/vt/consolemap.c
··· 539 539 540 540 /* Save original vc_unipagdir_loc in case we allocate a new one */ 541 541 p = *vc->vc_uni_pagedir_loc; 542 + 543 + if (!p) { 544 + err = -EINVAL; 545 + 546 + goto out_unlock; 547 + } 542 548 543 549 if (p->refcount > 1) { 544 550 int j, k; ··· 629 623 set_inverse_transl(vc, p, i); /* Update inverse translations */ 630 624 set_inverse_trans_unicode(vc, p); 631 625 626 + out_unlock: 632 627 console_unlock(); 633 628 return err; 634 629 }