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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.





[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux PPP]     [Linux FS]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Linmodem]     [Device Mapper]     [Linux Kernel for ARM]

  Powered by Linux