On Mon, 25 Nov 2024, Arnd Bergmann wrote: > > But the configuration can give less than old_serial_port contains. > > See dozens of the explicit settings in the defconfigs. > > I don't see any of the upstream defconfigs doing this > though, the only ones setting CONFIG_SERIAL_8250_RUNTIME_UARTS > are those that have an empty old_serial_port[]. > > Note that SERIAL_PORT_DFNS is only defined on x86, alpha > and m68k (for q40), which are the main PC-like platforms. May I suggest to call `serial8250_isa_init_ports': if (IS_ENABLED(CONFIG_ISA) || IS_ENABLED(CONFIG_ALPHA) || IS_ENABLED(CONFIG_M68K) || IS_ENABLED(CONFIG_X86)) then (or have an equivalent `select' in the relevant Kconfig files)? The whole point of this legacy setup is to poke at ISA serial ports that have been wired by jumpers or similar means (sometimes just hardwired) to their designated ISA port I/O locations. Sometimes it means LPC rather than real ISA, but LPC stuff should mostly be covered by platform bindings rather than just blind poking, which may only be needed for platforms that have some kind of a generic config and no DT or other way (such as ACPI or ISA PNP) to discover actual ports. > I see that all three have identical definitions of > SERIAL_PORT_DFNS, so I think these should just be moved > next to the __serial8250_isa_init_ports definition, with > the entire thing moved into a separate ISA driver or > an #ifdef around it. This is of course not the problem > at hand, but it would help separate the x86/isa and > non-x86 platform device cases further. This SERIAL_PORT_DFNS definition is just original ISA stuff, so it does apply universally across CONFIG_ISA platforms. Original ISA option cards have had no way to discover other than by blind-poking (or giving port I/O locations by hand via a kernel parameter). Maciej