lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <e4bd468f-6d66-4658-b69f-0dacf006d1a8@kernel.org>
Date: Tue, 18 Nov 2025 10:06:23 +0100
From: Jiri Slaby <jirislaby@...nel.org>
To: Biju <biju.das.au@...il.com>,
 Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
 Rob Herring <robh@...nel.org>, Krzysztof Kozlowski <krzk+dt@...nel.org>,
 Conor Dooley <conor+dt@...nel.org>,
 Geert Uytterhoeven <geert+renesas@...der.be>,
 Magnus Damm <magnus.damm@...il.com>
Cc: Biju Das <biju.das.jz@...renesas.com>,
 Wolfram Sang <wsa+renesas@...g-engineering.com>,
 Lad Prabhakar <prabhakar.mahadev-lad.rj@...renesas.com>,
 linux-kernel@...r.kernel.org, linux-serial@...r.kernel.org,
 devicetree@...r.kernel.org, linux-renesas-soc@...r.kernel.org
Subject: Re: [PATCH v3 13/13] serial: sh-sci: Add support for RZ/G3E RSCI SCI

Hi,

On 14. 11. 25, 11:51, Biju wrote:
> From: Biju Das <biju.das.jz@...renesas.com>
> 
> Add support for RZ/G3E RSCI SCI(a.k.a non FIFO mode).

"a.k.a. non-FIFO"

> Signed-off-by: Biju Das <biju.das.jz@...renesas.com>
...
> @@ -496,34 +521,40 @@ static void rsci_receive_chars(struct uart_port *port)
>   		if (count == 0)
>   			break;
>   
> -		for (i = 0; i < count; i++) {
> -			char c;
> -
> -			rdat = rsci_serial_in(port, RDR);
> -			/* 9-bits data is not supported yet */
> -			c = rdat & RDR_RDAT_MSK;
> -
> -			if (uart_handle_sysrq_char(port, c)) {
> -				count--;
> -				i--;
> -				continue;
> -			}
> -
> -			/*
> -			 * Store data and status.
> -			 * Non FIFO mode is not supported
> -			 */
> -			if (rdat & RDR_FFER) {
> -				flag = TTY_FRAME;
> -				port->icount.frame++;
> -			} else if (rdat & RDR_FPER) {
> -				flag = TTY_PARITY;
> -				port->icount.parity++;
> -			} else {
> -				flag = TTY_NORMAL;
> +		if (s->type == RSCI_PORT_SCI) {
> +			char c = rsci_serial_in(port, RDR) & RDR_RDAT_MSK;
> +
> +			if (uart_handle_sysrq_char(port, c))
> +				count = 0;
> +			else
> +				tty_insert_flip_char(tport, c, TTY_NORMAL);
> +		} else {
> +			for (i = 0; i < count; i++) {
> +				char c;
> +
> +				rdat = rsci_serial_in(port, RDR);
> +				/* 9-bits data is not supported yet */
> +				c = rdat & RDR_RDAT_MSK;
> +
> +				if (uart_handle_sysrq_char(port, c)) {
> +					count--;
> +					i--;
> +					continue;
> +				}
> +
> +				/* Store data and status */
> +				if (rdat & RDR_FFER) {
> +					flag = TTY_FRAME;
> +					port->icount.frame++;
> +				} else if (rdat & RDR_FPER) {
> +					flag = TTY_PARITY;
> +					port->icount.parity++;
> +				} else {
> +					flag = TTY_NORMAL;
> +				}
> +
> +				tty_insert_flip_char(tport, c, flag);
>   			}

Instead of this shuffle and introducing the 'if', can't you just set 
count to 1 and introduce a mask like:

if (SCI) {
   count = 1;
   read_mask = RDR_RDAT_MSK;
} else  {
   read_mask = ~0U;
}

for (...) {
   ...
   rdat = rsci_serial_in(port, RDR) & read_mask;
}
and that's it?

thanks,
-- 
js
suse labs

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ