From: "Arnd Bergmann" <arnd@kernel.org>
To: "Niklas Schnelle" <niks@kernel.org>,
"Guenter Roeck" <linux@roeck-us.net>,
"Niklas Schnelle" <schnelle@linux.ibm.com>
Cc: "Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
"Jiri Slaby" <jirislaby@kernel.org>,
"Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>,
linux-serial@vger.kernel.org,
"Heiko Carstens" <hca@linux.ibm.com>,
linux-kernel@vger.kernel.org,
"Andy Shevchenko" <andriy.shevchenko@linux.intel.com>
Subject: Re: [PATCH 1/1] tty: serial: handle HAS_IOPORT dependencies
Date: Sat, 23 Nov 2024 10:21:27 +0100 [thread overview]
Message-ID: <f1d973ed-c830-47a0-aaa4-4d331b5e03b0@app.fastmail.com> (raw)
In-Reply-To: <ddcbade39fb8a4dcac57c66c59fcc0b4d56dcaa6.camel@kernel.org>
On Sat, Nov 23, 2024, at 00:34, Niklas Schnelle wrote:
>
> Am I seeing it right that despite the warning and the code setting
> no_serial_in / no_serial_out the console=ttyS0 in the above qemu boots
> still worked? Also for example in the nios2 case I see the warning 4
> times. So this makes me wonder since the warning is new is it possible
> that set_io_from_upio() has been called with an invalid / all
> zero port before but it was invisible.
Yes, that is certainly the case, sorry if I wasn't clear about this.
The warning shows that there is something wrong with the code,
but that problem has likely existed for a long time. We can
obviously just hide that warning again and ignore the underlying
problem without causing any regressions to the previous state,
but I hope we can improve it in some way that makes it less
broken on non-x86 architectures.
> The way I'm reading __serial8250_isa_init_ports() and in particular the
> first loop if nr_uarts is e.g. 5 in the nios case but only the first
> entry in serial8250_ports[] has the IOMEM 8250 it will still call
> serial8250_setup_port() on the 4 other unintalized/zero elements which
> would explain the iotype being 0. And as far as I can see nr_uarts is
> just set to the value of CONFIG_SERIAL_8250_RUNTIME_UARTS in
> 8250_platform.c.
The way I was reading the code, all five would be uninitialized
at the time we call __serial8250_isa_init_ports(), and the first
port only gets set later on.
Another thing I see is that the 8250 driver ("serial") is the
only one that ends up registering a lot of ports at boot time,
while the other ones only register the ones they actually detect.
E.g. on my Apple workstation, I get
# head /proc/tty/driver/*
==> /proc/tty/driver/IMX-uart <==
serinfo:1.0 driver revision:
==> /proc/tty/driver/fsl-linflexuart <==
serinfo:1.0 driver revision:
==> /proc/tty/driver/fsl-lpuart <==
serinfo:1.0 driver revision:
==> /proc/tty/driver/msm_serial <==
serinfo:1.0 driver revision:
==> /proc/tty/driver/mvebu_serial <==
serinfo:1.0 driver revision:
==> /proc/tty/driver/qcom_geni_console <==
serinfo:1.0 driver revision:
==> /proc/tty/driver/qcom_geni_uart <==
serinfo:1.0 driver revision:
==> /proc/tty/driver/s3c2410_serial <==
serinfo:1.0 driver revision:
0: uart:APPLE S5L mmio:0x39B200000 irq:42 tx:0 rx:0 CTS|DSR|CD
==> /proc/tty/driver/serial <==
serinfo:1.0 driver revision:
0: uart:unknown port:00000000 irq:0
1: uart:unknown port:00000000 irq:0
2: uart:unknown port:00000000 irq:0
3: uart:unknown port:00000000 irq:0
4: uart:unknown port:00000000 irq:0
5: uart:unknown port:00000000 irq:0
6: uart:unknown port:00000000 irq:0
7: uart:unknown port:00000000 irq:0
8: uart:unknown port:00000000 irq:0
==> /proc/tty/driver/tegra_hsuart <==
serinfo:1.0 driver revision:
==> /proc/tty/driver/usbserial <==
usbserinfo:1.0 driver:2.0
The way that this driver was meant to handle that originally
is that /sbin/setserial can be used at runtime to configure
any UART that is attached to an ISA bus even if it did not
get detected at boot time, by setting the correct port and
IRQ numbers from userspace. This may be required on i486
systems with ISA cards providing additional non-PNP 8250
on a nonstandard port number, but is likely not useful on
anything other than x86-32.
Arnd
next prev parent reply other threads:[~2024-11-23 9:22 UTC|newest]
Thread overview: 59+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-05 15:29 [PATCH 0/1] tty: Handle " Niklas Schnelle
2024-04-05 15:29 ` [PATCH 1/1] tty: serial: handle " Niklas Schnelle
2024-04-08 9:54 ` Ilpo Järvinen
2024-04-08 10:17 ` Arnd Bergmann
2024-04-08 10:25 ` Ilpo Järvinen
2024-10-01 9:04 ` Niklas Schnelle
2024-04-08 15:35 ` Niklas Schnelle
2024-04-08 15:41 ` Ilpo Järvinen
2024-04-08 15:50 ` Arnd Bergmann
2024-05-23 2:11 ` Maciej W. Rozycki
2024-10-01 11:21 ` Niklas Schnelle
2024-10-01 15:31 ` Arnd Bergmann
2024-10-01 16:41 ` Maciej W. Rozycki
2024-10-02 12:44 ` Niklas Schnelle
2024-10-02 18:12 ` Maciej W. Rozycki
2024-10-02 22:00 ` Arnd Bergmann
2024-10-02 22:59 ` Maciej W. Rozycki
2024-10-04 6:53 ` Arnd Bergmann
2024-10-04 16:24 ` Maciej W. Rozycki
2024-10-04 16:57 ` Arnd Bergmann
2024-10-04 10:09 ` Niklas Schnelle
2024-10-04 12:48 ` Arnd Bergmann
2024-10-04 16:03 ` Niklas Schnelle
2024-10-04 14:44 ` Niklas Schnelle
2024-10-04 16:34 ` Maciej W. Rozycki
2024-11-22 15:18 ` Guenter Roeck
2024-11-22 15:35 ` Niklas Schnelle
2024-11-22 16:31 ` Arnd Bergmann
2024-11-22 17:22 ` Guenter Roeck
2024-11-22 19:24 ` Arnd Bergmann
2024-11-22 20:44 ` Guenter Roeck
2024-11-22 22:51 ` Arnd Bergmann
2024-11-23 2:14 ` Guenter Roeck
2024-11-25 7:55 ` Andy Shevchenko
2024-11-25 9:53 ` Arnd Bergmann
2024-11-25 10:33 ` Andy Shevchenko
2024-11-25 11:06 ` Arnd Bergmann
2024-11-25 11:26 ` Andy Shevchenko
2024-11-25 13:50 ` Arnd Bergmann
2024-11-25 15:42 ` Andy Shevchenko
2024-11-25 16:54 ` Maciej W. Rozycki
2024-11-25 17:54 ` Arnd Bergmann
2024-11-25 18:42 ` Maciej W. Rozycki
2024-12-04 18:51 ` Guenter Roeck
2024-11-25 15:59 ` Arnd Bergmann
2024-12-04 21:09 ` Guenter Roeck
2024-12-04 22:17 ` Arnd Bergmann
2024-12-04 22:44 ` Guenter Roeck
2024-12-05 7:08 ` Arnd Bergmann
2024-12-05 14:31 ` Guenter Roeck
2024-12-06 15:44 ` Andy Shevchenko
2024-12-06 16:02 ` Arnd Bergmann
2025-01-16 12:26 ` Andy Shevchenko
2024-11-22 17:07 ` Guenter Roeck
2024-11-22 23:27 ` Niklas Schnelle
2024-11-22 23:34 ` Niklas Schnelle
2024-11-23 9:21 ` Arnd Bergmann [this message]
2024-04-05 22:33 ` [PATCH 0/1] tty: Handle " Andy Shevchenko
2024-04-06 8:06 ` Arnd Bergmann
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=f1d973ed-c830-47a0-aaa4-4d331b5e03b0@app.fastmail.com \
--to=arnd@kernel.org \
--cc=andriy.shevchenko@linux.intel.com \
--cc=gregkh@linuxfoundation.org \
--cc=hca@linux.ibm.com \
--cc=ilpo.jarvinen@linux.intel.com \
--cc=jirislaby@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=niks@kernel.org \
--cc=schnelle@linux.ibm.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
all inboxes | Powered by JetHome®