Re: [PATCH v1 tty] 8250: microchip: pci1xxxx: Refactor TX Burst code to use pre-existing APIs

From: Ilpo Järvinen
Date: Thu Feb 22 2024 - 11:02:04 EST


On Thu, 22 Feb 2024, Rengarajan S wrote:

> Updated the TX Burst implementation by changing the circular buffer
> processing with the pre-existing APIs in kernel. Also updated conditional
> statements and alignment issues for better readability.
>
> Signed-off-by: Rengarajan S <rengarajan.s@xxxxxxxxxxxxx>
> ---

> @@ -434,16 +435,7 @@ static void pci1xxxx_tx_burst(struct uart_port *port, u32 uart_status)
>
> xmit = &port->state->xmit;
>
> - if (port->x_char) {
> - writeb(port->x_char, port->membase + UART_TX);
> - port->icount.tx++;
> - port->x_char = 0;
> - return;
> - }
> -
> - if ((uart_tx_stopped(port)) || (uart_circ_empty(xmit))) {
> - port->ops->stop_tx(port);
> - } else {
> + if (!(port->x_char)) {
> data_empty_count = (pci1xxxx_read_burst_status(port) &
> UART_BST_STAT_TX_COUNT_MASK) >> 8;
> do {
> @@ -453,15 +445,22 @@ static void pci1xxxx_tx_burst(struct uart_port *port, u32 uart_status)
> &data_empty_count,
> &valid_byte_count);
>
> - port->icount.tx++;
> if (uart_circ_empty(xmit))
> break;
> } while (data_empty_count && valid_byte_count);
> + } else {
> + writeb(port->x_char, port->membase + UART_TX);
> + port->icount.tx++;
> + port->x_char = 0;
> + return;

Why you made this reorganization for x_char handling?? It seems
entirely wrong thing to do, x_char should have precendence over
sending normal chars.

This patch would have been some much simpler to review if it would have
not attempted to n things in one go, please try to split into sensible
changes.


--
i.