All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/6] serial: 8250: make port operations work on struct uart_8250_port
@ 2026-10-13  6:48 Jiri Slaby (SUSE)
  2026-10-13  6:48 ` [PATCH v2 1/6] serial: 8250: drop err label from serial8250_register_8250_port() Jiri Slaby (SUSE)
                   ` (5 more replies)
  0 siblings, 6 replies; 17+ messages in thread
From: Jiri Slaby (SUSE) @ 2026-10-13  6:48 UTC (permalink / raw)
  To: gregkh; +Cc: linux-serial, Jiri Slaby (SUSE)

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


^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2026-10-13 13:42 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-13  6:48 [PATCH v2 0/6] serial: 8250: make port operations work on struct uart_8250_port Jiri Slaby (SUSE)
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

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.