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-4.16-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty

Pull tty/serial driver fixes from Greg KH:
"Here are some small tty core and serial driver fixes for 4.16-rc6.

They resolve some newly reported bugs, as well as some very old ones,
which is always nice to see. There is also a new device id added in
here for good measure.

All of these have been in linux-next for a while with no reported
issues"

* tag 'tty-4.16-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty:
serial: imx: fix bogus dev_err
serial: sh-sci: prevent lockup on full TTY buffers
serial: 8250_pci: Add Brainboxes UC-260 4 port serial device
earlycon: add reg-offset to physical address before mapping
serial: core: mark port as initialized in autoconfig
serial: 8250_pci: Don't fail on multiport card class
tty/serial: atmel: add new version check for usart
tty: make n_tty_read() always abort if hangup is in progress

+42 -5
+6
drivers/tty/n_tty.c
··· 2180 2180 } 2181 2181 if (tty_hung_up_p(file)) 2182 2182 break; 2183 + /* 2184 + * Abort readers for ttys which never actually 2185 + * get hung up. See __tty_hangup(). 2186 + */ 2187 + if (test_bit(TTY_HUPPING, &tty->flags)) 2188 + break; 2183 2189 if (!timeout) 2184 2190 break; 2185 2191 if (file->f_flags & O_NONBLOCK) {
+18 -3
drivers/tty/serial/8250/8250_pci.c
··· 3387 3387 /* 3388 3388 * If it is not a communications device or the programming 3389 3389 * interface is greater than 6, give up. 3390 - * 3391 - * (Should we try to make guesses for multiport serial devices 3392 - * later?) 3393 3390 */ 3394 3391 if ((((dev->class >> 8) != PCI_CLASS_COMMUNICATION_SERIAL) && 3392 + ((dev->class >> 8) != PCI_CLASS_COMMUNICATION_MULTISERIAL) && 3395 3393 ((dev->class >> 8) != PCI_CLASS_COMMUNICATION_MODEM)) || 3396 3394 (dev->class & 0xff) > 6) 3397 3395 return -ENODEV; ··· 3425 3427 serial_pci_guess_board(struct pci_dev *dev, struct pciserial_board *board) 3426 3428 { 3427 3429 int num_iomem, num_port, first_port = -1, i; 3430 + 3431 + /* 3432 + * Should we try to make guesses for multiport serial devices later? 3433 + */ 3434 + if ((dev->class >> 8) == PCI_CLASS_COMMUNICATION_MULTISERIAL) 3435 + return -ENODEV; 3428 3436 3429 3437 num_iomem = num_port = 0; 3430 3438 for (i = 0; i < PCI_NUM_BAR_RESOURCES; i++) { ··· 4701 4697 */ 4702 4698 { PCI_VENDOR_ID_INTASHIELD, PCI_DEVICE_ID_INTASHIELD_IS400, 4703 4699 PCI_ANY_ID, PCI_ANY_ID, 0, 0, /* 135a.0dc0 */ 4700 + pbn_b2_4_115200 }, 4701 + /* 4702 + * BrainBoxes UC-260 4703 + */ 4704 + { PCI_VENDOR_ID_INTASHIELD, 0x0D21, 4705 + PCI_ANY_ID, PCI_ANY_ID, 4706 + PCI_CLASS_COMMUNICATION_MULTISERIAL << 8, 0xffff00, 4707 + pbn_b2_4_115200 }, 4708 + { PCI_VENDOR_ID_INTASHIELD, 0x0E34, 4709 + PCI_ANY_ID, PCI_ANY_ID, 4710 + PCI_CLASS_COMMUNICATION_MULTISERIAL << 8, 0xffff00, 4704 4711 pbn_b2_4_115200 }, 4705 4712 /* 4706 4713 * Perle PCI-RAS cards
+1
drivers/tty/serial/atmel_serial.c
··· 1734 1734 switch (version) { 1735 1735 case 0x302: 1736 1736 case 0x10213: 1737 + case 0x10302: 1737 1738 dev_dbg(port->dev, "This version is usart\n"); 1738 1739 atmel_port->has_frac_baudrate = true; 1739 1740 atmel_port->has_hw_timer = true;
+2 -1
drivers/tty/serial/earlycon.c
··· 245 245 } 246 246 port->mapbase = addr; 247 247 port->uartclk = BASE_BAUD * 16; 248 - port->membase = earlycon_map(port->mapbase, SZ_4K); 249 248 250 249 val = of_get_flat_dt_prop(node, "reg-offset", NULL); 251 250 if (val) 252 251 port->mapbase += be32_to_cpu(*val); 252 + port->membase = earlycon_map(port->mapbase, SZ_4K); 253 + 253 254 val = of_get_flat_dt_prop(node, "reg-shift", NULL); 254 255 if (val) 255 256 port->regshift = be32_to_cpu(*val);
+1 -1
drivers/tty/serial/imx.c
··· 2093 2093 uart_get_rs485_mode(&pdev->dev, &sport->port.rs485); 2094 2094 2095 2095 if (sport->port.rs485.flags & SER_RS485_ENABLED && 2096 - (!sport->have_rtscts || !sport->have_rtsgpio)) 2096 + (!sport->have_rtscts && !sport->have_rtsgpio)) 2097 2097 dev_err(&pdev->dev, "no RTS control, disabling rs485\n"); 2098 2098 2099 2099 imx_rs485_config(&sport->port, &sport->port.rs485);
+2
drivers/tty/serial/serial_core.c
··· 1144 1144 uport->ops->config_port(uport, flags); 1145 1145 1146 1146 ret = uart_startup(tty, state, 1); 1147 + if (ret == 0) 1148 + tty_port_set_initialized(port, true); 1147 1149 if (ret > 0) 1148 1150 ret = 0; 1149 1151 }
+2
drivers/tty/serial/sh-sci.c
··· 885 885 /* Tell the rest of the system the news. New characters! */ 886 886 tty_flip_buffer_push(tport); 887 887 } else { 888 + /* TTY buffers full; read from RX reg to prevent lockup */ 889 + serial_port_in(port, SCxRDR); 888 890 serial_port_in(port, SCxSR); /* dummy read */ 889 891 sci_clear_SCxSR(port, SCxSR_RDxF_CLEAR(port)); 890 892 }
+9
drivers/tty/tty_io.c
··· 586 586 return; 587 587 } 588 588 589 + /* 590 + * Some console devices aren't actually hung up for technical and 591 + * historical reasons, which can lead to indefinite interruptible 592 + * sleep in n_tty_read(). The following explicitly tells 593 + * n_tty_read() to abort readers. 594 + */ 595 + set_bit(TTY_HUPPING, &tty->flags); 596 + 589 597 /* inuse_filps is protected by the single tty lock, 590 598 this really needs to change if we want to flush the 591 599 workqueue with the lock held */ ··· 648 640 * from the ldisc side, which is now guaranteed. 649 641 */ 650 642 set_bit(TTY_HUPPED, &tty->flags); 643 + clear_bit(TTY_HUPPING, &tty->flags); 651 644 tty_unlock(tty); 652 645 653 646 if (f)
+1
include/linux/tty.h
··· 364 364 #define TTY_PTY_LOCK 16 /* pty private */ 365 365 #define TTY_NO_WRITE_SPLIT 17 /* Preserve write boundaries to driver */ 366 366 #define TTY_HUPPED 18 /* Post driver->hangup() */ 367 + #define TTY_HUPPING 19 /* Hangup in progress */ 367 368 #define TTY_LDISC_HALTED 22 /* Line discipline is halted */ 368 369 369 370 /* Values for tty->flow_change */