From: sashiko-bot@kernel.org
To: "Fil Dunsky" <filipp.dunsky@gmail.com>
Cc: devicetree@vger.kernel.org, linux-serial@vger.kernel.org,
robh@kernel.org, conor+dt@kernel.org
Subject: Re: [PATCH v5 07/10] tty: serial: Add Cortina UART driver
Date: Tue, 13 Oct 2026 03:57:10 +0000 [thread overview]
Message-ID: <sashiko-outbox-168941@kernel.org> (raw)
In-Reply-To: <20261013-b4-cs75xx-v5-7-4e72aa383d39@gmail.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] tty: serial: cortina: Overrun errors reported when CREAD is cleared
--
commit 6c5059b7f2174557fc1b85a7365146c863b99a28
Author: Fil Dunsky <filipp.dunsky@gmail.com>
tty: serial: Add Cortina UART driver
This commit adds a new serial driver for the UART found in Cortina Systems
CS75xx SoCs. It supports the system console and earlycon, using the modern
serial core API.
> diff --git a/drivers/tty/serial/cortina-uart.c b/drivers/tty/serial/cortina-uart.c
> new file mode 100644
> index 0000000000000..58faddfe0f37d
> --- /dev/null
> +++ b/drivers/tty/serial/cortina-uart.c
[ ... ]
> +static void cortina_uart_rx_chars(struct uart_port *port, u32 status)
> +{
> + struct tty_port *tport = &port->state->port;
> + unsigned int budget = CORTINA_UART_RX_BUDGET;
> + u32 data, err;
[ ... ]
> + /* The characters left in the FIFO were received before the lost ones */
> + if (status & CORTINA_UART_IRQ_RX_OVERRUN &
> + ~port->ignore_status_mask)
> + tty_insert_flip_char(tport, 0, TTY_OVERRUN);
> +
> + tty_flip_buffer_push(tport);
> +}
[ ... ]
> +static void cortina_uart_set_termios(struct uart_port *port,
> + struct ktermios *termios,
> + const struct ktermios *old)
> +{
> + unsigned int baud, div;
> + u32 cfg;
[ ... ]
> + port->ignore_status_mask = 0;
> + if (termios->c_iflag & IGNPAR)
> + port->ignore_status_mask |= CORTINA_UART_IRQ_RX_ERR;
> + if (!(termios->c_cflag & CREAD))
> + port->ignore_status_mask |= CORTINA_UART_RXDAT_VALID;
[Severity: Low]
Does this leave the port vulnerable to reporting overrun errors even when
the receiver is supposed to be disabled?
When CREAD is cleared, the intent is to ignore all received data. However,
it appears CORTINA_UART_IRQ_RX_OVERRUN is omitted from the ignore mask here.
Since CORTINA_UART_CFG_RX_EN remains unconditionally set in the configuration,
the hardware receiver stays active and the FIFO can still overrun if data
arrives.
If an overrun occurs under these conditions, cortina_uart_rx_chars() would
inject a TTY_OVERRUN character into the buffer because the overrun status bit
isn't masked out by ignore_status_mask. Should CORTINA_UART_IRQ_RX_OVERRUN
also be added to the mask when CREAD is cleared to avoid this?
> +
> + uart_update_timeout(port, termios->c_cflag, baud);
> +
> + writel(cfg, port->membase + CORTINA_UART_CFG);
> + /* Sample the received bits in the middle of the bit time */
> + writel(div / 2, port->membase + CORTINA_UART_RX_SAMPLE);
> +
> + if (tty_termios_baud_rate(termios))
> + tty_termios_encode_baud_rate(termios, baud, baud);
> +}
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261013-b4-cs75xx-v5-0-4e72aa383d39@gmail.com?part=7
next prev parent reply other threads:[~2026-10-13 3:57 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-13 3:46 [PATCH v5 00/10] ARM: Add support for Cortina Systems CS75xx and Securifi Almond+ Fil Dunsky via B4 Relay
2026-10-13 3:46 ` [PATCH v5 01/10] dt-bindings: vendor-prefixes: Add Securifi Fil Dunsky via B4 Relay
2026-10-13 3:46 ` [PATCH v5 02/10] dt-bindings: arm: Add Cortina Systems CS7542 and Securifi Almond+ Fil Dunsky via B4 Relay
2026-10-13 3:46 ` [PATCH v5 03/10] dt-bindings: arm: cpus: Add Cortina Systems CS7542 enable method Fil Dunsky via B4 Relay
2026-10-13 3:46 ` [PATCH v5 04/10] ARM: goldengate: Add support for the CS75xx SoC family Fil Dunsky via B4 Relay
2026-10-13 3:46 ` [PATCH v5 05/10] ARM: debug: Add Cortina Systems CS75xx UART0 support Fil Dunsky via B4 Relay
2026-10-13 3:46 ` [PATCH v5 06/10] dt-bindings: serial: Add Cortina Systems CS7542 UART Fil Dunsky via B4 Relay
2026-10-13 3:46 ` [PATCH v5 07/10] tty: serial: Add Cortina UART driver Fil Dunsky via B4 Relay
2026-10-13 3:57 ` sashiko-bot [this message]
2026-10-13 3:46 ` [PATCH v5 08/10] ARM: dts: cortina: Add CS7542 SoC and Securifi Almond+ board Fil Dunsky via B4 Relay
2026-10-13 3:46 ` [PATCH v5 09/10] ARM: multi_v7_defconfig: Enable Cortina Systems CS75xx support Fil Dunsky via B4 Relay
2026-10-13 3:46 ` [PATCH v5 10/10] MAINTAINERS: Add entry for Cortina Systems CS75xx Fil Dunsky via B4 Relay
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-168941@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=filipp.dunsky@gmail.com \
--cc=linux-serial@vger.kernel.org \
--cc=robh@kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
/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