Linux Serial subsystem development
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Biju Das" <biju.das.au@gmail.com>
Cc: linux-serial@vger.kernel.org, kvm@vger.kernel.org,
	wsa+renesas@sang-engineering.com
Subject: Re: [PATCH v2 3/4] serial: sh-sci: Skip TDxE clear when hardware clears it automatically
Date: Wed, 21 Oct 2026 13:22:36 +0000	[thread overview]
Message-ID: <sashiko-outbox-180298@kernel.org> (raw)
In-Reply-To: <20261021-g2ul_sci-v2-3-b4e038220018@bp.renesas.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] serial: sh-sci: missing has_tdxe_auto_clear init in scix_early_console_setup()
--

commit 7c4175b5ac1e1b0c0d116921a097acf598dc7be1
Author: Au Dang <au.dang.jx@renesas.com>

serial: sh-sci: Skip TDxE clear when hardware clears it automatically

This commit adds a tdxe_auto_clear flag to struct sci_of_data and propagates
it to struct sci_port as has_tdxe_auto_clear to skip software clearing of
TDxE in sci_transmit_chars() and sci_poll_put_char() on PORT_SCI variants.

> diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c
> index 58120b523ca1e..aa179c7874878 100644
> --- a/drivers/tty/serial/sh-sci.c
> +++ b/drivers/tty/serial/sh-sci.c
> @@ -913,7 +913,8 @@ static void sci_poll_put_char(struct uart_port *port, unsigned char c)
>  	} while (!(status & SCxSR_TDxE(port)));
>  
>  	sci_serial_out(port, SCxTDR, c);
> -	s->ops->clear_SCxSR(port, SCxSR_TDxE_CLEAR(port) & ~SCxSR_TEND(port));
> +	if (!s->has_tdxe_auto_clear)
> +		s->ops->clear_SCxSR(port, SCxSR_TDxE_CLEAR(port) & ~SCxSR_TEND(port));
>  }
>  #endif /* CONFIG_CONSOLE_POLL || CONFIG_SERIAL_SH_SCI_CONSOLE ||
>  	  CONFIG_SERIAL_SH_SCI_EARLYCON */

[ ... ]

> @@ -3791,6 +3794,7 @@ static struct plat_sci_port *sci_parse_dt(struct platform_device *pdev,
>  	sp->ops = data->ops;
>  	sp->port.ops = data->uart_ops;
>  	sp->params = data->params;
> +	sp->has_tdxe_auto_clear = data->tdxe_auto_clear;

[Severity: Medium]
Should scix_early_console_setup() in drivers/tty/serial/sh-sci.c also copy
data->tdxe_auto_clear to sci_ports[0].has_tdxe_auto_clear?

When earlycon is enabled on a renesas,sci port, sci_early_console_setup() ->
scix_early_console_setup() initializes sci_ports[0] from of_sci_sci, but
leaves has_tdxe_auto_clear unset:

drivers/tty/serial/sh-sci.c:scix_early_console_setup() {
	...
	sci_ports[0].cfg = &port_cfg;
	sci_ports[0].params = data->params;
	sci_ports[0].ops = data->ops;
	sci_ports[0].port.ops = data->uart_ops;
	sci_uart_earlycon = true;
	...
}

During early console output via serial_console_write() ->
uart_console_write() -> serial_console_putchar() -> sci_poll_put_char(),
s->has_tdxe_auto_clear will still be false on sci_ports[0], causing
s->ops->clear_SCxSR() to be called in software instead of being skipped.

>  
>  	sp->has_rtscts = of_property_read_bool(np, "uart-has-rtscts");
>

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261021-g2ul_sci-v2-0-b4e038220018@bp.renesas.com?part=3

  reply	other threads:[~2026-10-21 13:22 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-21 13:13 [PATCH v2 0/4] Fix transmit handling on SCI/RSCI ports Biju Das
2026-10-21 13:13 ` [PATCH v2 1/4] serial: sh-sci: Drop TE disable at end of transmission on SCI Biju Das
2026-10-21 13:18   ` sashiko-bot
2026-10-21 13:13 ` [PATCH v2 2/4] serial: sh-sci: Keep TX enabled on TEI while data is pending Biju Das
2026-10-21 13:38   ` sashiko-bot
2026-10-22 10:28     ` Biju Das
2026-10-21 13:13 ` [PATCH v2 3/4] serial: sh-sci: Skip TDxE clear when hardware clears it automatically Biju Das
2026-10-21 13:22   ` sashiko-bot [this message]
2026-10-22 10:29     ` Biju Das
2026-10-21 13:13 ` [PATCH v2 4/4] serial: sh-sci: Toggle TE when restoring SCSCR in console write on SCI Biju Das
2026-10-21 13:19   ` sashiko-bot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=sashiko-outbox-180298@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=biju.das.au@gmail.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=wsa+renesas@sang-engineering.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox