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,
"Krzysztof Kozlowski" <krzk@kernel.org>,
"Alim Akhtar" <alim.akhtar@samsung.com>,
"David S. Miller" <davem@davemloft.net>,
"Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>,
"Andy Shevchenko" <andriy.shevchenko@linux.intel.com>,
"Thomas Fourier" <fourier.thomas@gmail.com>,
"Kees Cook" <kees@kernel.org>,
linux-arm-kernel@lists.infradead.org,
linux-samsung-soc@vger.kernel.org, sparclinux@vger.kernel.org,
"Biju Das" <biju.das.jz@bp.renesas.com>,
"Geert Uytterhoeven" <geert+renesas@glider.be>,
"Lad Prabhakar" <prabhakar.mahadev-lad.rj@bp.renesas.com>,
"Wolfram Sang" <wsa+renesas@sang-engineering.com>,
"Thierry Bultel" <thierry.bultel.yh@bp.renesas.com>,
"Thomas Gleixner" <tglx@kernel.org>,
"Osama Abdelkader" <osama.abdelkader@gmail.com>,
"Xin Zhao" <jackzxcui1989@163.com>,
"Ingo Molnar" <mingo@kernel.org>,
"Andy Shevchenko" <andy.shevchenko@gmail.com>,
"Krzysztof Kozlowski" <krzysztof.kozlowski@oss.qualcomm.com>,
"Gerhard Engleder" <eg@keba.com>,
"Lukas Wunner" <lukas@wunner.de>,
"Dr. David Alan Gilbert" <linux@treblig.org>,
"Joseph Tilahun" <jtilahun@astranis.com>
Subject: [PATCH tty v3 0/6] 8250: Add console flow control
Date: Fri, 17 Apr 2026 12:30:13 +0206 [thread overview]
Message-ID: <20260417102423.40984-1-john.ogness@linutronix.de> (raw)
Hi,
This is v3 of a series to implement console flow control for the
8250 serial driver. v2 is here [0].
The 8250 driver already has code in place to support console flow
control. However, there is no way to activate it and it is
incomplete. This series provides the necessary missing pieces while
attempting to be as conservative as possible, so as not to introduce
any side effects into the many 8250 variants or other non-8250 serial
drivers.
Note that as of v3 I am now deprecating UPF_CONS_FLOW in favor of a
separate boolean field. In the commit message (patch 1) I explain my
reasoning for this decision.
For patch 2 I used the following Coccinelle script to perform the
modifications...
===== BEGIN cons_flow.cocci =====
// SPDX-License-Identifier: GPL-2.0-only
// Options: --all-includes
virtual patch
@r1@
type T1;
identifier U;
@@
T1 {
...
struct uart_port U;
...
};
@r2@
r1.T1 *E;
@@
- (E->port.flags & UPF_CONS_FLOW)
+ uart_get_cons_flow(&E->port)
@r3@
struct uart_port *U;
@@
- (U->flags & UPF_CONS_FLOW)
+ uart_get_cons_flow(U)
@r4@
struct uart_port *U;
@@
- U->flags |= UPF_CONS_FLOW
+ uart_set_cons_flow(U, true)
===== END cons_flow.cocci =====
Changes since v2:
- Deprecate UPF_CONS_FLOW. Provide separate boolean with wrappers as
alternative.
- Update all UPF_CONS_FLOW users to new cons_flow wrappers.
- Use irqsave variant of spin lock for status update.
- When 8250 console flow control is not specified, clear the policy.
Changes since v1:
- Prepend a patch to perform an extra LSR wait after CTS assertion if
the initial LSR wait timed out.
- Close a window in serial8250_register_8250_port() where console
flow control was briefly disabled.
- Add port lock synchronization to the port->status RMW update in
uart_set_options().
John Ogness
[0] https://lore.kernel.org/lkml/20260410144949.16581-1-john.ogness@linutronix.de
John Ogness (6):
serial: core: Add dedicated uart_port field for console flow
serial: Replace driver usage of UPF_CONS_FLOW
serial: sh-sci: Avoid deprecated UPF_CONS_FLOW
serial: 8250: Set cons_flow on port registration
serial: 8250: Check LSR timeout on console flow control
serial: 8250: Add support for console flow control
drivers/tty/serial/8250/8250_core.c | 6 ++++++
drivers/tty/serial/8250/8250_port.c | 21 +++++++++++++++++----
drivers/tty/serial/bcm63xx_uart.c | 2 +-
drivers/tty/serial/omap-serial.c | 2 +-
drivers/tty/serial/pch_uart.c | 2 +-
drivers/tty/serial/pxa.c | 2 +-
drivers/tty/serial/samsung_tty.c | 8 ++++----
drivers/tty/serial/serial_core.c | 21 ++++++++++++++++++++-
drivers/tty/serial/serial_txx9.c | 4 ++--
drivers/tty/serial/sh-sci.c | 5 ++++-
drivers/tty/serial/sunsu.c | 2 +-
include/linux/serial_core.h | 20 ++++++++++++++++++++
12 files changed, 78 insertions(+), 17 deletions(-)
base-commit: a1a81aef99e853dec84241d701fbf587d713eb5b
--
2.47.3
next reply other threads:[~2026-04-17 10:24 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-17 10:24 John Ogness [this message]
2026-04-17 10:24 ` [PATCH tty v3 2/6] serial: Replace driver usage of UPF_CONS_FLOW 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=20260417102423.40984-1-john.ogness@linutronix.de \
--to=john.ogness@linutronix.de \
--cc=alim.akhtar@samsung.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=andy.shevchenko@gmail.com \
--cc=biju.das.jz@bp.renesas.com \
--cc=davem@davemloft.net \
--cc=eg@keba.com \
--cc=fourier.thomas@gmail.com \
--cc=geert+renesas@glider.be \
--cc=gregkh@linuxfoundation.org \
--cc=ilpo.jarvinen@linux.intel.com \
--cc=jackzxcui1989@163.com \
--cc=jirislaby@kernel.org \
--cc=jtilahun@astranis.com \
--cc=kees@kernel.org \
--cc=krzk@kernel.org \
--cc=krzysztof.kozlowski@oss.qualcomm.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-samsung-soc@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
--cc=linux@treblig.org \
--cc=lukas@wunner.de \
--cc=mingo@kernel.org \
--cc=osama.abdelkader@gmail.com \
--cc=prabhakar.mahadev-lad.rj@bp.renesas.com \
--cc=sparclinux@vger.kernel.org \
--cc=tglx@kernel.org \
--cc=thierry.bultel.yh@bp.renesas.com \
--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