Linux Serial subsystem development
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Kryštof Černý" <cleverline1mc@gmail.com>
Cc: linux-serial@vger.kernel.org
Subject: Re: [PATCH 1/2] serial: 8250: Add RX trigger levels for U6_16550A
Date: Mon, 09 Nov 2026 14:52:38 +0000	[thread overview]
Message-ID: <sashiko-outbox-205136@kernel.org> (raw)
In-Reply-To: <20261109-8250-select-u6-64bit-v1-1-04bc8332fa34@gmail.com>

Thank you for your contribution! Sashiko AI review found no new issues
in this patch, but noticed 1 related pre-existing issue it does not
introduce:
- [Medium] serial: 8250: unpopulated rxtrig_bytes states in
  bytes_to_fcr_rxtrig() [1]
--

commit a186be2f155b931d20413d24643c82a17676db0e
Author: Kryštof Černý <cleverline1mc@gmail.com>

serial: 8250: Add RX trigger levels for U6_16550A

This commit populates the rxtrig_bytes table for PORT_U6_16550A in
uart_config[] so that the rx_trig_bytes sysfs attribute is exposed for
ports of this type.

> diff --git a/drivers/tty/serial/8250/8250_port.c b/drivers/tty/serial/8250/8250_port.c
> index 36b2b0a2c05cd..a7acede62f40f 100644
> --- a/drivers/tty/serial/8250/8250_port.c
> +++ b/drivers/tty/serial/8250/8250_port.c
> @@ -163,6 +163,7 @@ static const struct serial8250_config uart_config[] = {
>  		.fifo_size	= 64,
>  		.tx_loadsz	= 64,
>  		.fcr		= UART_FCR_ENABLE_FIFO | UART_FCR_R_TRIG_10,
> +		.rxtrig_bytes	= {1, 16, 32, 62},
>  		.flags		= UART_CAP_FIFO | UART_CAP_AFE,
>  	},
>  	[PORT_TEGRA] = {

[Severity: Medium]
This problem wasn't introduced by this patch, but in the same
uart_config[] table, can writing a value of 4 or greater to rx_trig_bytes
on UART_PORT_AIROHA_HS select an unpopulated trigger state [1]?

drivers/tty/serial/8250/8250_port.c:
	[UART_PORT_AIROHA_HS] = {
		...
		.rxtrig_bytes	= {1, 4},
		.flags		= UART_CAP_FIFO,
	},

Because rxtrig_bytes only initializes the first two entries (unlike
UART_PORT_AIROHA, which uses {1, 4, 4, 4}), indices 2 and 3 are 0.
serial8250_bytes_to_fcr() expects all four UART_FCR_R_TRIG_MAX_STATE
entries to be populated in non-decreasing order whenever entry 0 is
non-zero.  Writing 4 or more through rx_trig_bytes_store() ->
do_set_rxtrig() -> bytes_to_fcr_rxtrig() falls through the loop and
programs UART_FCR_R_TRIG_11 into UART_FCR, after which reading
rx_trig_bytes via fcr_get_rxtrig_bytes() sees rxtrig_bytes[3] == 0 and
fails with -EOPNOTSUPP.

[1] https://sashiko.dev/#/bug/linux-02824c35-118d-40cd-ba5b-57ffe1817328

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261109-8250-select-u6-64bit-v1-0-04bc8332fa34@gmail.com?part=1

  reply	other threads:[~2026-11-09 14:52 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-09 14:40 [PATCH 0/2] serial: 8250_dw: Fix RX trigger levels for 64-byte FIFOs Kryštof Černý via B4 Relay
2026-11-09 14:40 ` [PATCH 1/2] serial: 8250: Add RX trigger levels for U6_16550A Kryštof Černý via B4 Relay
2026-11-09 14:52   ` sashiko-bot [this message]
2026-11-09 14:55   ` Ilpo Järvinen
2026-11-09 15:37     ` Kryštof Černý
2026-11-09 21:34       ` Andy Shevchenko
2026-11-09 14:41 ` [PATCH 2/2] serial: 8250_dw: Select U6_16550A for 64-byte FIFO Kryštof Černý via B4 Relay
2026-11-09 14:51   ` 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-205136@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=cleverline1mc@gmail.com \
    --cc=linux-serial@vger.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