On 20/10/2022 16.14, Ilpo Järvinen wrote:
On Thu, 20 Oct 2022, Martin Hundebøll wrote:
On October 20, 2022 2:34:14 PM GMT+02:00, "Ilpo Järvinen" <ilpo.jarvinen@xxxxxxxxxxxxxxx> wrote:
On Tue, 18 Oct 2022, Martin Hundebøll wrote:
The logic to find unused ports when registering new 8250 uart ports
searches only up to CONFIG_SERIAL_8250_RUNTIME_UART, which forces users
of external 8250 ports to increase the number of runtime ports
artificially.
Fix this by initializing each allocated port structure with basic
settings like line number and uart operation callbacks, and by searching
the entire array of allocated ports to find an unused one.
So nr_uarts no longer means "Maximum number of UARTs supported." ?
Perhaps it should be reworded too.
It never did. Confusingly, the module parameter name (nr_uarts)
corresponds to CONFIG_SERIAL_8250_RUNTIME_UARTS, and controls the number
of built-in (non-discoverable) ports. The other config,
CONFIG_SERIAL_8250_NR_UARTS, controls the maximum number of ports.
We cannot change the module parameter name, so I'm not sure if we should
map it to another static variable in the source?
I meant that its description should be changed to match what it really
does.
I see. Something like this?
diff --git a/drivers/tty/serial/8250/8250_core.c b/drivers/tty/serial/8250/8250_core.c
index f4a08fb74c31..cdac8f11194e 100644
--- a/drivers/tty/serial/8250/8250_core.c
+++ b/drivers/tty/serial/8250/8250_core.c
@@ -1261,7 +1261,7 @@ module_param_hw(share_irqs, uint, other, 0644);
MODULE_PARM_DESC(share_irqs, "Share IRQs with other non-8250/16x50 devices (unsafe)");
module_param(nr_uarts, uint, 0644);
-MODULE_PARM_DESC(nr_uarts, "Maximum number of UARTs supported. (1-" __MODULE_STRING(CONFIG_SERIAL_8250_NR_UARTS) ")");
+MODULE_PARM_DESC(nr_uarts, "Number of built-in (non-discoverable) UARTs to initialize. (1-" __MODULE_STRING(CONFIG_SERIAL_8250_NR_UARTS) ")");
module_param(skip_txen_test, uint, 0644);
MODULE_PARM_DESC(skip_txen_test, "Skip checking for the TXEN bug at init time");