From: "Jiri Slaby (SUSE)" <jirislaby@kernel.org>
To: gregkh@linuxfoundation.org
Cc: linux-serial@vger.kernel.org, "Jiri Slaby (SUSE)" <jirislaby@kernel.org>
Subject: [PATCH v2 0/6] serial: 8250: make port operations work on struct uart_8250_port
Date: Tue, 13 Oct 2026 08:48:45 +0200 [thread overview]
Message-ID: <cover.1791873876.git.jirislaby@kernel.org> (raw)
Hi,
the 8250 port operations work on line numbers.
serial8250_register_8250_port() returns a line, and drivers pass it back
to serial8250_unregister_port(), serial8250_suspend_port() and
serial8250_resume_port(). Many drivers also convert it back to the port
using serial8250_get_port() whenever they need the port itself.
The last patch switches this interface to struct uart_8250_port.
serial8250_register_8250_port() now returns the port (or an ERR_PTR()),
and the other operations take it. All users are converted, and
serial8250_get_port() is no longer exported.
The first patch is a preparatory cleanup. It splits
serial8250_register_8250_port() into a helper, so that the function no
longer mixes guard() with goto-based error handling -- Sashiko.
The second patch is a trivial exar cleanup.
While doing the conversion, we (me, Claude and Sashiko) found three bugs
in how drivers handle a line that is not set (yet). Patches 3-5 fix them
separately, so that they can go to stable:
* 8250_exar: pci_xr17v35x_exit() looks up the GPIO platform device via
port 0, which need not exist when its registration failed. The GPIO
device is now stored in struct exar8250.
* 8250_lpss: the probe error path calls ehl_serial_exit(), which clears
the dma pointer of serial8250_ports[0] (usually the console) when no
port was registered.
* 8250_omap: the IRQ handler can run before probe stores priv->line,
and then it uses serial8250_get_port(-ENODEV).
The conversion also fixes two latent issues: CIR ports (registration
used to return 0, so callers operated on ttyS0) and 8250_acorn (a port
on line 0 was never unregistered).
[v2]
* new patch 1: drop the err label from serial8250_register_8250_port()
* new patches 2-3: exar cleanup and fix of the GPIO device lookup
(reported by Sashiko)
* 8250_lpss: no declaration in the middle of a function (Ilpo)
* conversion: include err.h (Ilpo)
Link to v1: https://lore.kernel.org/all/ef47d676a44346e058f29a00c8701484db722831.1791524724.git.jirislaby@kernel.org/
Jiri Slaby (SUSE) (6):
serial: 8250: drop err label from serial8250_register_8250_port()
serial: 8250_exar: remove useless void * casts
serial: 8250_exar: store the GPIO platform device in struct exar8250
serial: 8250_lpss: do not touch uninitialized line in
ehl_serial_exit()
serial: 8250_omap: set priv->line before enabling the IRQ
serial: 8250: make port operations work on struct uart_8250_port
drivers/ptp/ptp_ocp.c | 36 +++---
drivers/tty/serial/8250/8250_acorn.c | 5 +-
drivers/tty/serial/8250/8250_airoha.c | 23 ++--
drivers/tty/serial/8250/8250_aspeed_vuart.c | 13 +-
drivers/tty/serial/8250/8250_bcm2835aux.c | 20 +--
drivers/tty/serial/8250/8250_bcm7271.c | 33 +++--
drivers/tty/serial/8250/8250_core.c | 128 ++++++++++----------
drivers/tty/serial/8250/8250_dfl.c | 22 ++--
drivers/tty/serial/8250/8250_dw.c | 13 +-
drivers/tty/serial/8250/8250_dwlib.h | 2 +-
drivers/tty/serial/8250/8250_em.c | 26 ++--
drivers/tty/serial/8250/8250_exar.c | 59 +++++----
drivers/tty/serial/8250/8250_fsl.c | 24 ++--
drivers/tty/serial/8250/8250_hp300.c | 27 ++---
drivers/tty/serial/8250/8250_ingenic.c | 11 +-
drivers/tty/serial/8250/8250_ioc3.c | 26 ++--
drivers/tty/serial/8250/8250_keba.c | 13 +-
drivers/tty/serial/8250/8250_loongson.c | 20 +--
drivers/tty/serial/8250/8250_lpc18xx.c | 11 +-
drivers/tty/serial/8250/8250_lpss.c | 17 +--
drivers/tty/serial/8250/8250_men_mcb.c | 14 +--
drivers/tty/serial/8250/8250_mid.c | 13 +-
drivers/tty/serial/8250/8250_mtk.c | 19 +--
drivers/tty/serial/8250/8250_mxpcie.c | 13 +-
drivers/tty/serial/8250/8250_ni.c | 12 +-
drivers/tty/serial/8250/8250_of.c | 25 ++--
drivers/tty/serial/8250/8250_omap.c | 41 +++----
drivers/tty/serial/8250/8250_parisc.c | 14 +--
drivers/tty/serial/8250/8250_pci.c | 21 ++--
drivers/tty/serial/8250/8250_pci1xxxx.c | 41 +++----
drivers/tty/serial/8250/8250_pericom.c | 15 +--
drivers/tty/serial/8250/8250_platform.c | 23 ++--
drivers/tty/serial/8250/8250_pnp.c | 21 ++--
drivers/tty/serial/8250/8250_pxa.c | 17 +--
drivers/tty/serial/8250/8250_tegra.c | 20 +--
drivers/tty/serial/8250/8250_uniphier.c | 21 ++--
drivers/tty/serial/8250/serial_cs.c | 15 ++-
include/linux/serial_8250.h | 8 +-
38 files changed, 417 insertions(+), 465 deletions(-)
--
2.56.0
next reply other threads:[~2026-10-13 6:48 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-13 6:48 Jiri Slaby (SUSE) [this message]
2026-10-13 6:48 ` [PATCH v2 1/6] serial: 8250: drop err label from serial8250_register_8250_port() Jiri Slaby (SUSE)
2026-10-13 6:48 ` [PATCH v2 2/6] serial: 8250_exar: remove useless void * casts Jiri Slaby (SUSE)
2026-10-13 6:48 ` [PATCH v2 3/6] serial: 8250_exar: store the GPIO platform device in struct exar8250 Jiri Slaby (SUSE)
2026-10-13 6:48 ` [PATCH v2 4/6] serial: 8250_lpss: do not touch uninitialized line in ehl_serial_exit() Jiri Slaby (SUSE)
2026-10-13 6:48 ` [PATCH v2 5/6] serial: 8250_omap: set priv->line before enabling the IRQ Jiri Slaby (SUSE)
2026-10-13 6:48 ` [PATCH v2 6/6] serial: 8250: make port operations work on struct uart_8250_port Jiri Slaby (SUSE)
2026-10-13 7:33 ` Andy Shevchenko
2026-10-13 7:53 ` Jiri Slaby
2026-10-13 9:09 ` Andy Shevchenko
2026-10-13 9:39 ` Jiri Slaby
2026-10-13 10:00 ` Andy Shevchenko
2026-10-13 10:15 ` Jiri Slaby
2026-10-13 10:54 ` Alejandro Colomar
2026-10-13 10:51 ` Alejandro Colomar
2026-10-13 11:06 ` Jiri Slaby
2026-10-13 13:42 ` Andy Shevchenko
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=cover.1791873876.git.jirislaby@kernel.org \
--to=jirislaby@kernel.org \
--cc=gregkh@linuxfoundation.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.