All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Uwe Kleine-König" <ukleinek@kernel.org>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Jiri Slaby <jirislaby@kernel.org>,
	Hugo Villeneuve <hvilleneuve@dimonoff.com>
Cc: "John Ogness" <john.ogness@linutronix.de>,
	"Atsushi Nemoto" <anemo@mba.ocn.ne.jp>,
	"Alan Cox" <alan@redhat.com>,
	linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org,
	"Jonathan Corbet" <corbet@lwn.net>,
	"Shuah Khan" <skhan@linuxfoundation.org>,
	"Stepan Ionichev" <sozdayvek@gmail.com>,
	"Fushuai Wang" <wangfushuai@baidu.com>,
	"Osama Abdelkader" <osama.abdelkader@gmail.com>,
	linux-doc@vger.kernel.org,
	"Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>,
	"Andy Shevchenko" <andriy.shevchenko@linux.intel.com>,
	"Abinash Singh" <abinashsinghlalotra@gmail.com>,
	"Kees Cook" <kees@kernel.org>, "Gerhard Engleder" <eg@keba.com>,
	"Lukas Wunner" <lukas@wunner.de>,
	"Huacai Chen" <chenhuacai@kernel.org>,
	"Binbin Zhou" <zhoubinbin@loongson.cn>,
	"Rong Zhang" <rongrong@oss.cipunited.com>,
	"Randy Dunlap" <rdunlap@infradead.org>,
	"Haowei Zheng" <zhenghaowei@loongson.cn>,
	"Rahul Bukte" <rahul.bukte@sony.com>,
	"Russell King" <rmk@dyn-67.arm.linux.org.uk>
Subject: [PATCH v1 0/6] serial: Some yak shaving
Date: Fri, 31 Jul 2026 11:39:03 +0200	[thread overview]
Message-ID: <cover.1785489518.git.ukleinek@kernel.org> (raw)

Hello,

after the discussion with Hugo about hub6_match_port()[1] I looked into
implementing my suggestion. Hugo had a doubt there:

> I am not sure to fully understand what you suggest. Copying the same
> function code to two drivers seems like a waisted opportunity for code
> reuse?

I don't think this is a wasted opportunity, as uart_match_port() only
becomes a single comparison for the txx9 driver. Also having 8250
specific parts in serial_core is a layer violation.

I was unable to unsee some of the stuff I discovered, so there are a few
more patches in this series now ...

The first txx9 patch is a preparation for the second to establish the
assertion ".iotype is always UPIO_PORT". It's also a fix that is correct
on its own (assuming I understood the driver model misuse in this driver
correctly).

After that uart_match_port() is only used by the 8250 driver code and
thus can be moved to there in the third patch, simplifying the
dependencies a bit which enables fixing the breakage I found in the
fourth patch.

The two remaining patches are cleanups I found while working on that
driver.

Note this is only compile tested as I don't have a machine with any of
the three affected serial hardwares.

Best regards
Uwe

[1] https://lore.kernel.org/linux-serial/amn8Hb2dbv_Sah_Y@monoceros/

Uwe Kleine-König (6):
  serial: txx9: Drop noop probe function and dangerous remove callback
  serial: txx9: Drop usage of uart_match_port()
  serial: 8250: Make uart_match_port() a 8250 specific function
  serial: 8250: Fix corner case for port matching
  serial: 8250: hub6: Add cleanup code
  serial: 8250: pnp: Annotate init and exit functions for conditional
    discarding

 Documentation/driver-api/serial/driver.rst |  2 +-
 drivers/tty/serial/8250/8250.h             | 10 +++-
 drivers/tty/serial/8250/8250_core.c        | 27 +++++++++-
 drivers/tty/serial/8250/8250_hub6.c        | 11 ++---
 drivers/tty/serial/8250/8250_platform.c    |  9 +++-
 drivers/tty/serial/8250/8250_pnp.c         |  4 +-
 drivers/tty/serial/8250/Kconfig            |  4 +-
 drivers/tty/serial/8250/Makefile           |  2 +-
 drivers/tty/serial/serial_core.c           | 27 ----------
 drivers/tty/serial/serial_txx9.c           | 57 ++--------------------
 include/linux/serial_core.h                |  2 -
 11 files changed, 58 insertions(+), 97 deletions(-)


base-commit: 95d6a9ccef99117115e41e9adb271243bd5e985b
-- 
2.55.0.11.g153666a7d9bb


             reply	other threads:[~2026-07-31  9:39 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-31  9:39 Uwe Kleine-König [this message]
2026-07-31  9:39 ` [PATCH v1 1/6] serial: txx9: Drop noop probe function and dangerous remove callback Uwe Kleine-König
2026-07-31  9:39 ` [PATCH v1 2/6] serial: txx9: Drop usage of uart_match_port() Uwe Kleine-König
2026-07-31  9:39 ` [PATCH v1 3/6] serial: 8250: Make uart_match_port() a 8250 specific function Uwe Kleine-König
2026-07-31  9:39 ` [PATCH v1 4/6] serial: 8250: Fix corner case for port matching Uwe Kleine-König
2026-07-31  9:39 ` [PATCH v1 5/6] serial: 8250: hub6: Add cleanup code Uwe Kleine-König
2026-07-31  9:39 ` [PATCH v1 6/6] serial: 8250: pnp: Annotate init and exit functions for conditional discarding Uwe Kleine-König

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.1785489518.git.ukleinek@kernel.org \
    --to=ukleinek@kernel.org \
    --cc=abinashsinghlalotra@gmail.com \
    --cc=alan@redhat.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=anemo@mba.ocn.ne.jp \
    --cc=chenhuacai@kernel.org \
    --cc=corbet@lwn.net \
    --cc=eg@keba.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=hvilleneuve@dimonoff.com \
    --cc=ilpo.jarvinen@linux.intel.com \
    --cc=jirislaby@kernel.org \
    --cc=john.ogness@linutronix.de \
    --cc=kees@kernel.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=lukas@wunner.de \
    --cc=osama.abdelkader@gmail.com \
    --cc=rahul.bukte@sony.com \
    --cc=rdunlap@infradead.org \
    --cc=rmk@dyn-67.arm.linux.org.uk \
    --cc=rongrong@oss.cipunited.com \
    --cc=skhan@linuxfoundation.org \
    --cc=sozdayvek@gmail.com \
    --cc=wangfushuai@baidu.com \
    --cc=zhenghaowei@loongson.cn \
    --cc=zhoubinbin@loongson.cn \
    /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.