Skip to contentSkip to conversation

serial: SERIAL_8250_RUNTIME_UARTS must be <= SERIAL_8250_NR_UARTS

PATCH David Vrabel 3 participants 4 messages Feb 6, 2006

lore
Share & tools
lore
#0 lore raw

If SERIAL_8250_RUNTIME_UARTS is > SERIAL_8250_NR_UARTS then more serial ports are registered than we've allocated memory for. Prevent this by limiting SERIAL_8250_RUNTIME_UARTS in the serial Kconfig.

Signature · 4 lines
David Vrabel, Design Engineer

Arcom, Clifton Road           Tel: +44 (0)1223 411200 ext. 3233
Cambridge CB1 7EA, UK         Web: http://www.arcom.com/
drivers/serial/Kconfig +4 -0
Index: linux-2.6-working/drivers/serial/Kconfig
===================================================================
@@ -98,6 +98,7 @@
 config SERIAL_8250_RUNTIME_UARTS
 	int "Number of 8250/16550 serial ports to register at runtime"
 	depends on SERIAL_8250
+	range 0 SERIAL_8250_NR_UARTS
 	default "4"
 	help
 	  Set this to the maximum number of serial ports you want
@@ -105,6 +106,9 @@
 	  with the module parameter "nr_uarts", or boot-time parameter
 	  8250.nr_uarts
 
+	  This must be less than or equal to the maximum number of 8250/16550
+	  serial ports supported (SERIAL_8250_NR_UARTS).
+
 config SERIAL_8250_EXTENDED
 	bool "Extended 8250/16550 serial driver options"
 	depends on SERIAL_8250
#1 lore raw
Quoted 7 lines · David Vrabel

If SERIAL_8250_RUNTIME_UARTS is > SERIAL_8250_NR_UARTS then more serial ports are registered than we've allocated memory for. Prevent this by limiting SERIAL_8250_RUNTIME_UARTS in the serial Kconfig.

Is there any real use case for having *less* registered serial ports and having some spare?

- Yuki.

#3 lore raw
In reply to David Vrabel
Quoted 3 lines · David Vrabel

If SERIAL_8250_RUNTIME_UARTS is > SERIAL_8250_NR_UARTS then more serial ports are registered than we've allocated memory for. Prevent this by limiting SERIAL_8250_RUNTIME_UARTS in the serial Kconfig.

Nevermind. I see Russell has already applied an equivilent patch.

David Vrabel

Signature · 4 lines
David Vrabel, Design Engineer

Arcom, Clifton Road           Tel: +44 (0)1223 411200 ext. 3233
Cambridge CB1 7EA, UK         Web: http://www.arcom.com/
#2 lore raw
In reply to Yuki Cuss
Quoted 6 lines · Yuki Cuss
Quoted 4 lines · David Vrabel

If SERIAL_8250_RUNTIME_UARTS is > SERIAL_8250_NR_UARTS then more serial ports are registered than we've allocated memory for. Prevent this by limiting SERIAL_8250_RUNTIME_UARTS in the serial Kconfig.

Quoted 6 lines
Quoted 3 lines

Is there any real use case for having *less* registered serial ports and having some spare?

Having the ability to build a kernel image which supports many serial ports, whilst at the same same time when booted on the common-case systems with two serial ports, not creating so many /dev/ttyS* nodes or sysfs objects wasting ram that'll never be used or reclaimed.

Dave