From: Jiri Slaby <jirislaby@kernel.org>
To: Lucas Tanure <tanure@linux.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org
Subject: Re: [PATCH] serial: 8250: don't register ports that have no hardware
Date: Wed, 19 Aug 2026 06:42:06 +0200 [thread overview]
Message-ID: <dd831cb7-7cfc-46cb-a9e4-2899add9518d@kernel.org> (raw)
In-Reply-To: <20260818185200.10243-1-tanure@linux.com>
On 18. 08. 26, 20:52, Lucas Tanure wrote:
> The 8250 driver creates a fixed set of port slots at boot and
> registers a ttyS device for each one, even when the slot describes no
> hardware. On device tree platforms those slots are empty, but they
> still take the ttyS0..ttyS3 names.
>
> New Amlogic SoCs (S4, T7) name their real UARTs ttyS as well. With
> both drivers built in, as in arm64 defconfig, the real port fails to bind:
>
> sysfs: cannot create duplicate filename '/class/tty/ttyS0'
> meson_uart fe078000.serial: Cannot register tty device on line 0
>
> Skip slots that have no I/O and no memory address. Legacy x86 slots
> come with resources and are not affected.
>
> Signed-off-by: Lucas Tanure <tanure@linux.com>
> Assisted-by: Claude:claude-fable-5
> ---
> drivers/tty/serial/8250/8250_core.c | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/drivers/tty/serial/8250/8250_core.c b/drivers/tty/serial/8250/8250_core.c
> index f49862d90eeb..e66e0cdbb210 100644
> --- a/drivers/tty/serial/8250/8250_core.c
> +++ b/drivers/tty/serial/8250/8250_core.c
> @@ -378,6 +378,14 @@ void __init serial8250_register_ports(struct uart_driver *drv, struct device *de
> if (up->port.dev)
> continue;
>
> + /*
> + * Skip slots that describe no hardware: they would only
> + * take up ttyS<n> names. Real ports get their node when
> + * they claim a slot in serial8250_register_8250_port().
> + */
> + if (!up->port.iobase && !up->port.mapbase && !up->port.membase)
> + continue;
So you can no longer set up those ports via TIOCSSERIAL?
And what about already registered consoles?
Why does meson register ttyS* in the first place?
F*ck AI proposed changes.
thanks,
--
js
suse labs
next prev parent reply other threads:[~2026-08-19 4:42 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-18 18:52 [PATCH] serial: 8250: don't register ports that have no hardware Lucas Tanure
2026-08-19 4:42 ` Jiri Slaby [this message]
2026-08-19 6:31 ` Lucas Tanure
2026-08-19 5:57 ` Greg Kroah-Hartman
2026-08-19 6:40 ` Lucas Tanure
2026-08-19 6:49 ` Greg Kroah-Hartman
2026-08-19 7:31 ` Lucas Tanure
2026-08-19 7:46 ` Greg Kroah-Hartman
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=dd831cb7-7cfc-46cb-a9e4-2899add9518d@kernel.org \
--to=jirislaby@kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
--cc=tanure@linux.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;
as well as URLs for NNTP newsgroup(s).