public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* serial: SERIAL_8250_RUNTIME_UARTS must be <= SERIAL_8250_NR_UARTS
@ 2006-02-06 10:27 David Vrabel
  2006-02-06 10:42 ` Yuki Cuss
  2006-02-06 10:59 ` David Vrabel
  0 siblings, 2 replies; 4+ messages in thread
From: David Vrabel @ 2006-02-06 10:27 UTC (permalink / raw)
  To: Russell King; +Cc: Linux Kernel

[-- Attachment #1: Type: text/plain, Size: 406 bytes --]

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.

Signed-off-by: David Vrabel <dvrabel@arcom.com>
-- 
David Vrabel, Design Engineer

Arcom, Clifton Road           Tel: +44 (0)1223 411200 ext. 3233
Cambridge CB1 7EA, UK         Web: http://www.arcom.com/

[-- Attachment #2: serial-limit-SERIAL_8250_RUNTIME_UARTS --]
[-- Type: text/plain, Size: 872 bytes --]

Index: linux-2.6-working/drivers/serial/Kconfig
===================================================================
--- linux-2.6-working.orig/drivers/serial/Kconfig	2006-02-03 14:22:05.000000000 +0000
+++ linux-2.6-working/drivers/serial/Kconfig	2006-02-06 10:17:52.000000000 +0000
@@ -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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: serial: SERIAL_8250_RUNTIME_UARTS must be <= SERIAL_8250_NR_UARTS
  2006-02-06 10:27 serial: SERIAL_8250_RUNTIME_UARTS must be <= SERIAL_8250_NR_UARTS David Vrabel
@ 2006-02-06 10:42 ` Yuki Cuss
  2006-02-06 19:41   ` Dave Jones
  2006-02-06 10:59 ` David Vrabel
  1 sibling, 1 reply; 4+ messages in thread
From: Yuki Cuss @ 2006-02-06 10:42 UTC (permalink / raw)
  To: David Vrabel; +Cc: Russell King, Linux Kernel

[-- Attachment #1: Type: text/plain, Size: 387 bytes --]

David Vrabel wrote:

>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.
>
>Signed-off-by: David Vrabel <dvrabel@arcom.com>
>  
>

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

 - Yuki.


[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/x-pkcs7-signature, Size: 2917 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: serial: SERIAL_8250_RUNTIME_UARTS must be <= SERIAL_8250_NR_UARTS
  2006-02-06 10:27 serial: SERIAL_8250_RUNTIME_UARTS must be <= SERIAL_8250_NR_UARTS David Vrabel
  2006-02-06 10:42 ` Yuki Cuss
@ 2006-02-06 10:59 ` David Vrabel
  1 sibling, 0 replies; 4+ messages in thread
From: David Vrabel @ 2006-02-06 10:59 UTC (permalink / raw)
  To: Russell King; +Cc: Linux Kernel

David Vrabel wrote:
> 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
-- 
David Vrabel, Design Engineer

Arcom, Clifton Road           Tel: +44 (0)1223 411200 ext. 3233
Cambridge CB1 7EA, UK         Web: http://www.arcom.com/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: serial: SERIAL_8250_RUNTIME_UARTS must be <= SERIAL_8250_NR_UARTS
  2006-02-06 10:42 ` Yuki Cuss
@ 2006-02-06 19:41   ` Dave Jones
  0 siblings, 0 replies; 4+ messages in thread
From: Dave Jones @ 2006-02-06 19:41 UTC (permalink / raw)
  To: Yuki Cuss; +Cc: David Vrabel, Russell King, Linux Kernel

On Mon, Feb 06, 2006 at 09:42:19PM +1100, Yuki Cuss wrote:
 > David Vrabel wrote:
 > 
 > >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.
 > >
 > >Signed-off-by: David Vrabel <dvrabel@arcom.com>
 > > 
 > >
 > 
 > 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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2006-02-06 19:42 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-02-06 10:27 serial: SERIAL_8250_RUNTIME_UARTS must be <= SERIAL_8250_NR_UARTS David Vrabel
2006-02-06 10:42 ` Yuki Cuss
2006-02-06 19:41   ` Dave Jones
2006-02-06 10:59 ` David Vrabel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox