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

Pull tty/serial fixes from Greg KH:
"Here are some small tty/serial driver fixes for 4.10-rc4 to resolve a
number of reported issues.

Nothing major here at all, one revert of a problematic patch, and some
other tiny bugfixes. Full details are in the shortlog below.

All have been in linux-next with no reported issues"

* tag 'tty-4.10-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty:
sysrq: attach sysrq handler correctly for 32-bit kernel
Revert "tty: serial: 8250: add CON_CONSDEV to flags"
Clearing FIFOs in RS485 emulation mode causes subsequent transmits to break
8250_pci: Fix potential use-after-free in error path
tty/serial: atmel: RS485 half duplex w/DMA: enable RX after TX is done
tty/serial: atmel_serial: BUG: stop DMA from transmitting in stop_tx

+25 -17
+1 -1
drivers/tty/serial/8250/8250_core.c
··· 675 675 .device = uart_console_device, 676 676 .setup = univ8250_console_setup, 677 677 .match = univ8250_console_match, 678 - .flags = CON_PRINTBUFFER | CON_ANYTIME | CON_CONSDEV, 678 + .flags = CON_PRINTBUFFER | CON_ANYTIME, 679 679 .index = -1, 680 680 .data = &serial8250_reg, 681 681 };
+5 -7
drivers/tty/serial/8250/8250_pci.c
··· 5642 5642 static void serial8250_io_resume(struct pci_dev *dev) 5643 5643 { 5644 5644 struct serial_private *priv = pci_get_drvdata(dev); 5645 - const struct pciserial_board *board; 5645 + struct serial_private *new; 5646 5646 5647 5647 if (!priv) 5648 5648 return; 5649 5649 5650 - board = priv->board; 5651 - kfree(priv); 5652 - priv = pciserial_init_ports(dev, board); 5653 - 5654 - if (!IS_ERR(priv)) { 5655 - pci_set_drvdata(dev, priv); 5650 + new = pciserial_init_ports(dev, priv->board); 5651 + if (!IS_ERR(new)) { 5652 + pci_set_drvdata(dev, new); 5653 + kfree(priv); 5656 5654 } 5657 5655 } 5658 5656
+1 -1
drivers/tty/serial/8250/8250_port.c
··· 1413 1413 * Enable previously disabled RX interrupts. 1414 1414 */ 1415 1415 if (!(p->port.rs485.flags & SER_RS485_RX_DURING_TX)) { 1416 - serial8250_clear_fifos(p); 1416 + serial8250_clear_and_reinit_fifos(p); 1417 1417 1418 1418 p->ier |= UART_IER_RLSI | UART_IER_RDI; 1419 1419 serial_port_out(&p->port, UART_IER, p->ier);
+16 -6
drivers/tty/serial/atmel_serial.c
··· 481 481 /* disable PDC transmit */ 482 482 atmel_uart_writel(port, ATMEL_PDC_PTCR, ATMEL_PDC_TXTDIS); 483 483 } 484 + 485 + /* 486 + * Disable the transmitter. 487 + * This is mandatory when DMA is used, otherwise the DMA buffer 488 + * is fully transmitted. 489 + */ 490 + atmel_uart_writel(port, ATMEL_US_CR, ATMEL_US_TXDIS); 491 + 484 492 /* Disable interrupts */ 485 493 atmel_uart_writel(port, ATMEL_US_IDR, atmel_port->tx_done_mask); 486 494 ··· 521 513 522 514 /* Enable interrupts */ 523 515 atmel_uart_writel(port, ATMEL_US_IER, atmel_port->tx_done_mask); 516 + 517 + /* re-enable the transmitter */ 518 + atmel_uart_writel(port, ATMEL_US_CR, ATMEL_US_TXEN); 524 519 } 525 520 526 521 /* ··· 809 798 */ 810 799 if (!uart_circ_empty(xmit)) 811 800 atmel_tasklet_schedule(atmel_port, &atmel_port->tasklet_tx); 801 + else if ((port->rs485.flags & SER_RS485_ENABLED) && 802 + !(port->rs485.flags & SER_RS485_RX_DURING_TX)) { 803 + /* DMA done, stop TX, start RX for RS485 */ 804 + atmel_start_rx(port); 805 + } 812 806 813 807 spin_unlock_irqrestore(&port->lock, flags); 814 808 } ··· 916 900 desc->callback = atmel_complete_tx_dma; 917 901 desc->callback_param = atmel_port; 918 902 atmel_port->cookie_tx = dmaengine_submit(desc); 919 - 920 - } else { 921 - if (port->rs485.flags & SER_RS485_ENABLED) { 922 - /* DMA done, stop TX, start RX for RS485 */ 923 - atmel_start_rx(port); 924 - } 925 903 } 926 904 927 905 if (uart_circ_chars_pending(xmit) < WAKEUP_CHARS)
+2 -2
drivers/tty/sysrq.c
··· 946 946 { 947 947 .flags = INPUT_DEVICE_ID_MATCH_EVBIT | 948 948 INPUT_DEVICE_ID_MATCH_KEYBIT, 949 - .evbit = { BIT_MASK(EV_KEY) }, 950 - .keybit = { BIT_MASK(KEY_LEFTALT) }, 949 + .evbit = { [BIT_WORD(EV_KEY)] = BIT_MASK(EV_KEY) }, 950 + .keybit = { [BIT_WORD(KEY_LEFTALT)] = BIT_MASK(KEY_LEFTALT) }, 951 951 }, 952 952 { }, 953 953 };