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

Maarten Brock Maarten.Brock at sttls.nl
Mon Jan 22 07:32:12 PST 2024


> -----Original Message-----
> From: Manikanta Guntupalli <manikanta.guntupalli at amd.com>
> 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 at amd.com>
> ---
> Changes for V9:
> Update return check with uart_tx_stopped() in cdns_uart_handle_tx().
> Update description of cdns_uart_handle_tx() and add clear TX Empty interrupt
> comment cdns_uart_start_tx().
> ---
>  drivers/tty/serial/xilinx_uartps.c | 35 +++++++++++++++---------------
>  1 file changed, 18 insertions(+), 17 deletions(-)
> 
> diff --git a/drivers/tty/serial/xilinx_uartps.c b/drivers/tty/serial/xilinx_uartps.c
> index 920762d7b4a4..787c7cbc6600 100644
> --- 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



More information about the linux-arm-kernel mailing list