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

Pull tty / serial fixes from Greg KH:
"Here are three small tty and serial driver fixes for 6.8-rc5:

- revert a 8250_pci1xxxx off-by-one change that was incorrect

- two changes to fix the transmit path of the mxs-auart driver,
fixing a regression in the 6.2 release

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

* tag 'tty-6.8-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty:
serial: mxs-auart: fix tx
serial: core: introduce uart_port_tx_flags()
serial: 8250_pci1xxxx: partially revert off by one patch

+32 -7
+1 -1
drivers/tty/serial/8250/8250_pci1xxxx.c
··· 302 302 * to read, the data is received one byte at a time. 303 303 */ 304 304 while (valid_burst_count--) { 305 - if (*buff_index >= (RX_BUF_SIZE - UART_BURST_SIZE)) 305 + if (*buff_index > (RX_BUF_SIZE - UART_BURST_SIZE)) 306 306 break; 307 307 burst_buf = (u32 *)&rx_buff[*buff_index]; 308 308 *burst_buf = readl(port->membase + UART_RX_BURST_FIFO);
+4 -1
drivers/tty/serial/mxs-auart.c
··· 605 605 return; 606 606 } 607 607 608 - pending = uart_port_tx(&s->port, ch, 608 + pending = uart_port_tx_flags(&s->port, ch, UART_TX_NOSTOP, 609 609 !(mxs_read(s, REG_STAT) & AUART_STAT_TXFF), 610 610 mxs_write(ch, s, REG_DATA)); 611 611 if (pending) 612 612 mxs_set(AUART_INTR_TXIEN, s, REG_INTR); 613 613 else 614 614 mxs_clr(AUART_INTR_TXIEN, s, REG_INTR); 615 + 616 + if (uart_tx_stopped(&s->port)) 617 + mxs_auart_stop_tx(&s->port); 615 618 } 616 619 617 620 static void mxs_auart_rx_char(struct mxs_auart_port *s)
+27 -5
include/linux/serial_core.h
··· 748 748 749 749 void uart_write_wakeup(struct uart_port *port); 750 750 751 - #define __uart_port_tx(uport, ch, tx_ready, put_char, tx_done, for_test, \ 752 - for_post) \ 751 + /** 752 + * enum UART_TX_FLAGS -- flags for uart_port_tx_flags() 753 + * 754 + * @UART_TX_NOSTOP: don't call port->ops->stop_tx() on empty buffer 755 + */ 756 + enum UART_TX_FLAGS { 757 + UART_TX_NOSTOP = BIT(0), 758 + }; 759 + 760 + #define __uart_port_tx(uport, ch, flags, tx_ready, put_char, tx_done, \ 761 + for_test, for_post) \ 753 762 ({ \ 754 763 struct uart_port *__port = (uport); \ 755 764 struct circ_buf *xmit = &__port->state->xmit; \ ··· 786 777 if (pending < WAKEUP_CHARS) { \ 787 778 uart_write_wakeup(__port); \ 788 779 \ 789 - if (pending == 0) \ 780 + if (!((flags) & UART_TX_NOSTOP) && pending == 0) \ 790 781 __port->ops->stop_tx(__port); \ 791 782 } \ 792 783 \ ··· 821 812 */ 822 813 #define uart_port_tx_limited(port, ch, count, tx_ready, put_char, tx_done) ({ \ 823 814 unsigned int __count = (count); \ 824 - __uart_port_tx(port, ch, tx_ready, put_char, tx_done, __count, \ 815 + __uart_port_tx(port, ch, 0, tx_ready, put_char, tx_done, __count, \ 825 816 __count--); \ 826 817 }) 827 818 ··· 835 826 * See uart_port_tx_limited() for more details. 836 827 */ 837 828 #define uart_port_tx(port, ch, tx_ready, put_char) \ 838 - __uart_port_tx(port, ch, tx_ready, put_char, ({}), true, ({})) 829 + __uart_port_tx(port, ch, 0, tx_ready, put_char, ({}), true, ({})) 839 830 831 + 832 + /** 833 + * uart_port_tx_flags -- transmit helper for uart_port with flags 834 + * @port: uart port 835 + * @ch: variable to store a character to be written to the HW 836 + * @flags: %UART_TX_NOSTOP or similar 837 + * @tx_ready: can HW accept more data function 838 + * @put_char: function to write a character 839 + * 840 + * See uart_port_tx_limited() for more details. 841 + */ 842 + #define uart_port_tx_flags(port, ch, flags, tx_ready, put_char) \ 843 + __uart_port_tx(port, ch, flags, tx_ready, put_char, ({}), true, ({})) 840 844 /* 841 845 * Baud rate helpers. 842 846 */