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

Pull tty/serial driver fixes from Greg KH:
"Here are some small, and late, serial driver fixes for 6.0-rc7 to
resolve some reported problems.

Included in here are:

- tegra icount accounting fixes, including a framework function that
other drivers will be converted over to using in 6.1-rc1.

- fsl_lpuart reset bugfix

- 8250 omap 485 bugfix

- sifive serial clock bugfix

The last three patches have not shown up in linux-next due to them
being added to my tree only 2 days ago, but they are tiny and
self-contained and the developers say they resolve issues that they
have with 6.0-rc. The other three have been in linux-next for a while
with no reported issues"

* tag 'tty-6.0-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty:
serial: sifive: enable clocks for UART when probed
serial: 8250: omap: Use serial8250_em485_supported
serial: fsl_lpuart: Reset prior to registration
serial: tegra-tcu: Use uart_xmit_advance(), fixes icount.tx accounting
serial: tegra: Use uart_xmit_advance(), fixes icount.tx accounting
serial: Create uart_xmit_advance()

+27 -9
+1
drivers/tty/serial/8250/8250_omap.c
··· 1334 1334 up.port.throttle = omap_8250_throttle; 1335 1335 up.port.unthrottle = omap_8250_unthrottle; 1336 1336 up.port.rs485_config = serial8250_em485_config; 1337 + up.port.rs485_supported = serial8250_em485_supported; 1337 1338 up.rs485_start_tx = serial8250_em485_start_tx; 1338 1339 up.rs485_stop_tx = serial8250_em485_stop_tx; 1339 1340 up.port.has_sysrq = IS_ENABLED(CONFIG_SERIAL_8250_CONSOLE);
+5 -4
drivers/tty/serial/fsl_lpuart.c
··· 2724 2724 lpuart_reg.cons = LPUART_CONSOLE; 2725 2725 handler = lpuart_int; 2726 2726 } 2727 - ret = uart_add_one_port(&lpuart_reg, &sport->port); 2728 - if (ret) 2729 - goto failed_attach_port; 2730 2727 2731 2728 ret = lpuart_global_reset(sport); 2732 2729 if (ret) 2733 2730 goto failed_reset; 2731 + 2732 + ret = uart_add_one_port(&lpuart_reg, &sport->port); 2733 + if (ret) 2734 + goto failed_attach_port; 2734 2735 2735 2736 ret = uart_get_rs485_mode(&sport->port); 2736 2737 if (ret) ··· 2748 2747 2749 2748 failed_irq_request: 2750 2749 failed_get_rs485: 2751 - failed_reset: 2752 2750 uart_remove_one_port(&lpuart_reg, &sport->port); 2753 2751 failed_attach_port: 2752 + failed_reset: 2754 2753 lpuart_disable_clks(sport); 2755 2754 return ret; 2756 2755 }
+2 -3
drivers/tty/serial/serial-tegra.c
··· 525 525 count = tup->tx_bytes_requested - state.residue; 526 526 async_tx_ack(tup->tx_dma_desc); 527 527 spin_lock_irqsave(&tup->uport.lock, flags); 528 - xmit->tail = (xmit->tail + count) & (UART_XMIT_SIZE - 1); 528 + uart_xmit_advance(&tup->uport, count); 529 529 tup->tx_in_progress = 0; 530 530 if (uart_circ_chars_pending(xmit) < WAKEUP_CHARS) 531 531 uart_write_wakeup(&tup->uport); ··· 613 613 static void tegra_uart_stop_tx(struct uart_port *u) 614 614 { 615 615 struct tegra_uart_port *tup = to_tegra_uport(u); 616 - struct circ_buf *xmit = &tup->uport.state->xmit; 617 616 struct dma_tx_state state; 618 617 unsigned int count; 619 618 ··· 623 624 dmaengine_tx_status(tup->tx_dma_chan, tup->tx_cookie, &state); 624 625 count = tup->tx_bytes_requested - state.residue; 625 626 async_tx_ack(tup->tx_dma_desc); 626 - xmit->tail = (xmit->tail + count) & (UART_XMIT_SIZE - 1); 627 + uart_xmit_advance(&tup->uport, count); 627 628 tup->tx_in_progress = 0; 628 629 } 629 630
+1 -1
drivers/tty/serial/sifive.c
··· 945 945 return PTR_ERR(base); 946 946 } 947 947 948 - clk = devm_clk_get(&pdev->dev, NULL); 948 + clk = devm_clk_get_enabled(&pdev->dev, NULL); 949 949 if (IS_ERR(clk)) { 950 950 dev_err(&pdev->dev, "unable to find controller clock\n"); 951 951 return PTR_ERR(clk);
+1 -1
drivers/tty/serial/tegra-tcu.c
··· 101 101 break; 102 102 103 103 tegra_tcu_write(tcu, &xmit->buf[xmit->tail], count); 104 - xmit->tail = (xmit->tail + count) & (UART_XMIT_SIZE - 1); 104 + uart_xmit_advance(port, count); 105 105 } 106 106 107 107 uart_write_wakeup(port);
+17
include/linux/serial_core.h
··· 624 624 /* number of characters left in xmit buffer before we ask for more */ 625 625 #define WAKEUP_CHARS 256 626 626 627 + /** 628 + * uart_xmit_advance - Advance xmit buffer and account Tx'ed chars 629 + * @up: uart_port structure describing the port 630 + * @chars: number of characters sent 631 + * 632 + * This function advances the tail of circular xmit buffer by the number of 633 + * @chars transmitted and handles accounting of transmitted bytes (into 634 + * @up's icount.tx). 635 + */ 636 + static inline void uart_xmit_advance(struct uart_port *up, unsigned int chars) 637 + { 638 + struct circ_buf *xmit = &up->state->xmit; 639 + 640 + xmit->tail = (xmit->tail + chars) & (UART_XMIT_SIZE - 1); 641 + up->icount.tx += chars; 642 + } 643 + 627 644 struct module; 628 645 struct tty_driver; 629 646