public inbox for linux-serial@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] add ignore_ports option
@ 2005-05-10 12:11 Aristeu Sergio Rozanski Filho
  2005-05-10 12:50 ` Russell King
  0 siblings, 1 reply; 5+ messages in thread
From: Aristeu Sergio Rozanski Filho @ 2005-05-10 12:11 UTC (permalink / raw)
  To: linux-serial; +Cc: rmk+serial

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

Hi,
	this patch adds an option to 8250 driver to avoid probing for a
	serial port in specified addresses.
	Please consider applying

-- 
Aristeu


[-- Attachment #2: 8250-add_ignore_io_ports_option.patch --]
[-- Type: text/plain, Size: 1534 bytes --]

o Add ignore_ports option to avoid probing for a port in specified addresses

Signed-off-by: Aristeu Sergio Rozanski Filho <aris@cathedrallabs.org>

Index: 2.6/drivers/serial/8250.c
===================================================================
--- 2.6.orig/drivers/serial/8250.c	2005-05-09 13:14:33.000000000 -0300
+++ 2.6/drivers/serial/8250.c	2005-05-09 17:24:41.000000000 -0300
@@ -121,6 +121,9 @@
 
 #define UART_NR	(ARRAY_SIZE(old_serial_port) + CONFIG_SERIAL_8250_NR_UARTS)
 
+static unsigned long ignore_ports[UART_NR];
+static unsigned int ignore_ports_count;
+
 #ifdef CONFIG_SERIAL_8250_RSA
 
 #define PORT_RSA_MAX 4
@@ -2060,13 +2063,19 @@
 static void __init
 serial8250_register_ports(struct uart_driver *drv, struct device *dev)
 {
-	int i;
+	int i, j;
 
 	serial8250_isa_init_ports();
 
 	for (i = 0; i < UART_NR; i++) {
 		struct uart_8250_port *up = &serial8250_ports[i];
 
+		for (j = 0; j < ignore_ports_count; j++)
+			if (ignore_ports[j] == up->port.iobase)
+				break;
+		if (j < ignore_ports_count)
+			continue;
+
 		up->port.dev = dev;
 		uart_add_one_port(drv, &up->port);
 	}
@@ -2554,6 +2563,10 @@
 MODULE_PARM_DESC(share_irqs, "Share IRQs with other non-8250/16x50 devices"
 	" (unsafe)");
 
+module_param_array(ignore_ports, ulong, &ignore_ports_count, 0444);
+MODULE_PARM_DESC(ignore_ports, "I/O ports that should be ignored "
+		 "on probe");
+
 #ifdef CONFIG_SERIAL_8250_RSA
 module_param_array(probe_rsa, ulong, &probe_rsa_count, 0444);
 MODULE_PARM_DESC(probe_rsa, "Probe I/O ports for RSA");

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

* Re: [PATCH] add ignore_ports option
  2005-05-10 12:11 [PATCH] add ignore_ports option Aristeu Sergio Rozanski Filho
@ 2005-05-10 12:50 ` Russell King
  2005-05-10 13:01   ` Aristeu Sergio Rozanski Filho
  0 siblings, 1 reply; 5+ messages in thread
From: Russell King @ 2005-05-10 12:50 UTC (permalink / raw)
  To: Aristeu Sergio Rozanski Filho; +Cc: linux-serial

On Tue, May 10, 2005 at 09:11:51AM -0300, Aristeu Sergio Rozanski Filho wrote:
> Hi,
> 	this patch adds an option to 8250 driver to avoid probing for a
> 	serial port in specified addresses.
> 	Please consider applying

You don't say why this is desireable.

-- 
Russell King
 Linux kernel    2.6 ARM Linux   - http://www.arm.linux.org.uk/
 maintainer of:  2.6 Serial core

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

* Re: [PATCH] add ignore_ports option
  2005-05-10 12:50 ` Russell King
@ 2005-05-10 13:01   ` Aristeu Sergio Rozanski Filho
  2005-05-10 13:34     ` Russell King
  0 siblings, 1 reply; 5+ messages in thread
From: Aristeu Sergio Rozanski Filho @ 2005-05-10 13:01 UTC (permalink / raw)
  To: Russell King; +Cc: linux-serial

Hi,
> > Hi,
> > 	this patch adds an option to 8250 driver to avoid probing for a
> > 	serial port in specified addresses.
> > 	Please consider applying
> 
> You don't say why this is desireable.
	this is needed when you have to compile serial driver built-in
	for serial console but have, for example, an IRDA device in one
	of the ports. In my notebook this happens and I'm unable to load
	nsc-ircc driver after that because the I/O range is already
	taken:
Serial: 8250/16550 driver $Revision: 1.90 $ 8 ports, IRQ sharing
disabled
ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A
ttyS1 at I/O 0x2f8 (irq = 3) is a NS16550A
(...)
nsc-ircc, Found chip at base=0x02e
nsc-ircc, driver loaded (Dag Brattli)
nsc_ircc_open(), can't get iobase of 0x2f8

-- 
Aristeu


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

* Re: [PATCH] add ignore_ports option
  2005-05-10 13:01   ` Aristeu Sergio Rozanski Filho
@ 2005-05-10 13:34     ` Russell King
  2005-05-10 13:35       ` Aristeu Sergio Rozanski Filho
  0 siblings, 1 reply; 5+ messages in thread
From: Russell King @ 2005-05-10 13:34 UTC (permalink / raw)
  To: Aristeu Sergio Rozanski Filho; +Cc: linux-serial

On Tue, May 10, 2005 at 10:01:05AM -0300, Aristeu Sergio Rozanski Filho wrote:
> Hi,
> > > Hi,
> > > 	this patch adds an option to 8250 driver to avoid probing for a
> > > 	serial port in specified addresses.
> > > 	Please consider applying
> > 
> > You don't say why this is desireable.
> 	this is needed when you have to compile serial driver built-in
> 	for serial console but have, for example, an IRDA device in one
> 	of the ports. In my notebook this happens and I'm unable to load
> 	nsc-ircc driver after that because the I/O range is already
> 	taken:

No need for a patch.  Just use:

setserial /dev/ttyS1 none

-- 
Russell King
 Linux kernel    2.6 ARM Linux   - http://www.arm.linux.org.uk/
 maintainer of:  2.6 Serial core

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

* Re: [PATCH] add ignore_ports option
  2005-05-10 13:34     ` Russell King
@ 2005-05-10 13:35       ` Aristeu Sergio Rozanski Filho
  0 siblings, 0 replies; 5+ messages in thread
From: Aristeu Sergio Rozanski Filho @ 2005-05-10 13:35 UTC (permalink / raw)
  To: Russell King; +Cc: linux-serial

> > 	this is needed when you have to compile serial driver built-in
> > 	for serial console but have, for example, an IRDA device in one
> > 	of the ports. In my notebook this happens and I'm unable to load
> > 	nsc-ircc driver after that because the I/O range is already
> > 	taken:
> 
> No need for a patch.  Just use:
> 
> setserial /dev/ttyS1 none
Thanks!

-- 
Aristeu


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

end of thread, other threads:[~2005-05-10 13:36 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-05-10 12:11 [PATCH] add ignore_ports option Aristeu Sergio Rozanski Filho
2005-05-10 12:50 ` Russell King
2005-05-10 13:01   ` Aristeu Sergio Rozanski Filho
2005-05-10 13:34     ` Russell King
2005-05-10 13:35       ` Aristeu Sergio Rozanski Filho

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