From: John Ogness <john.ogness@linutronix.de>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Jiri Slaby <jirislaby@kernel.org>
Cc: linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org
Subject: Re: [PATCH tty v3 1/6] serial: core: Add dedicated uart_port field for console flow
Date: Fri, 17 Apr 2026 15:21:00 +0206 [thread overview]
Message-ID: <87v7dpafu3.fsf@jogness.linutronix.de> (raw)
In-Reply-To: <20260417102423.40984-2-john.ogness@linutronix.de>
On 2026-04-17, Sashiko wrote:
>> diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h
>> index 666430b478997..2327a364ded16 100644
>> --- a/include/linux/serial_core.h
>> +++ b/include/linux/serial_core.h
>> @@ -567,6 +568,7 @@ struct uart_port {
>> #define UPSTAT_SYNC_FIFO ((__force upstat_t) (1 << 5))
>>
>> bool hw_stopped; /* sw-assisted CTS flow state */
>> + bool cons_flow; /* user specified console flow control */
>> unsigned int mctrl; /* current modem ctrl settings */
>> unsigned int frame_time; /* frame timing in ns */
>> unsigned int type; /* port type */
>
> Since cons_flow is now separate from the flags field, do manual
> assignments of struct uart_port need to be updated to copy this new
> field?
My goal was to catch everywhere where uart_port.flags is set explicitly
or from some "external" source. I did not want to filter anytime one
uart_port.flags is to another uart_port.flags. If UPF_CONS_FLOW is set
in the source uart_port.flags, then _that_ is the problem.
> While subsequent patches in this series update
> serial8250_register_8250_port() to explicitly copy this new field,
> early_serial_setup() does not appear to receive a similar update.
>
> For example, looking at early_serial_setup() in
> drivers/tty/serial/8250/8250_core.c:
>
> int __init early_serial_setup(struct uart_port *port)
> {
> ...
> p = &serial8250_ports[port->line].port;
> p->iobase = port->iobase;
> ...
> p->iotype = port->iotype;
> p->flags = port->flags;
> p->mapbase = port->mapbase;
> ...
> }
>
> Because UPF_CONS_FLOW was previously copied as part of port->flags,
> will omitting cons_flow here cause a regression where the
> configuration is silently lost if any platform sets console flow
> control prior to early registration?
In this particular case, I checked all callers of
early_serial_setup(). They are passing explicit flags and UPF_CONS_FLOW
is not one of them.
Likewise, I could not find any examples, where UPF_CONS_FLOW could slip
into uart_port.flags, aside from the 2 examples I found and deal with in
my series.
I have no control over out-of-tree drivers that call
early_serial_setup() with UPF_CONS_FLOW. I could sprinkle bitmasks and
WARN_ON's to try to catch such out-of-tree misfits. But honestly, I
think that would introduce unnecesary code churn and complexity.
Considering the current questionable kernel state of console flow
control today, I doubt any out-of-tree drivers are really using the
appropriate policies anyway... meaning that the out-of-tree driver is
probably just unsafely using (uart_port.flags & UPF_CONS_FLOW) now,
which would likely continue to work as good/bad as it does now.
John
P.S. It looks like Sashiko ran out of gas [0] trying to review the 2nd
patch. So hopefully another reviewer (human or !human) will find some
time to take a look at the series.
At this point my only real concern is the community opinions on
deprecating UPF_CONS_FLOW.
[0] https://sashiko.dev/#/patchset/20260417102423.40984-1-john.ogness%40linutronix.de
next prev parent reply other threads:[~2026-04-17 13:15 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-17 10:24 [PATCH tty v3 0/6] 8250: Add console flow control John Ogness
2026-04-17 10:24 ` [PATCH tty v3 1/6] serial: core: Add dedicated uart_port field for console flow John Ogness
2026-04-17 13:15 ` John Ogness [this message]
2026-04-17 10:24 ` [PATCH tty v3 2/6] serial: Replace driver usage of UPF_CONS_FLOW John Ogness
2026-04-17 10:24 ` [PATCH tty v3 3/6] serial: sh-sci: Avoid deprecated UPF_CONS_FLOW John Ogness
2026-04-17 10:24 ` [PATCH tty v3 4/6] serial: 8250: Set cons_flow on port registration John Ogness
2026-04-17 10:24 ` [PATCH tty v3 5/6] serial: 8250: Check LSR timeout on console flow control John Ogness
2026-04-17 10:24 ` [PATCH tty v3 6/6] serial: 8250: Add support for " John Ogness
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=87v7dpafu3.fsf@jogness.linutronix.de \
--to=john.ogness@linutronix.de \
--cc=gregkh@linuxfoundation.org \
--cc=jirislaby@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
/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