RE: [PATCH V9 2/3] tty: serial: uartps: Relocate cdns_uart_tx_empty to facilitate rs485

From: Maarten Brock
Date: Mon Jan 22 2024 - 12:36:21 EST


> -----Original Message-----
> From: Manikanta Guntupalli <manikanta.guntupalli@xxxxxxx>
> Sent: Thursday, 18 January 2024 08:40
> Subject: [PATCH V9 2/3] tty: serial: uartps: Relocate cdns_uart_tx_empty to
> facilitate rs485
>
> Relocate cdns_uart_tx_empty function to avoid prototype statement in
> rs485 changes.
> Update return check with uart_tx_stopped() in cdns_uart_handle_tx().
>
> Signed-off-by: Manikanta Guntupalli <manikanta.guntupalli@xxxxxxx>
> ---
> --- a/drivers/tty/serial/xilinx_uartps.c
> +++ b/drivers/tty/serial/xilinx_uartps.c
> @@ -316,7 +331,7 @@ static void cdns_uart_handle_tx(void *dev_id)
> struct circ_buf *xmit = &port->state->xmit;
> unsigned int numbytes;
>
> - if (uart_circ_empty(xmit)) {
> + if (uart_circ_empty(xmit) || uart_tx_stopped(port)) {

Can you please also insert a comment here?
+ /* Disable the TX Empty interrupt */

> writel(CDNS_UART_IXR_TXEMPTY, port->membase +
> CDNS_UART_IDR);
> return;
> }

Kind regards,
Maarten Brock