Skip to contentSkip to conversation

early_port_register

PATCH In review Matt Porter 5 participants 8 messages Jun 12, 2003 – Jun 14, 2003 TTY layer and serial drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 early_port_register

Linus, please apply.

This has been discussed in a previous thread originated by David Mosberger. This removed early_serial_setup() in favor of a working early_port_register() call. Many PPC systems rely on this functionality and are currently hacking around it in the PPC devel tree. Last I looked, IA64 still had this in their devel tree too.

-Matt

===== drivers/serial/8250.c 1.32 vs edited =====

drivers/serial/8250.c +8 -2
@@ -2061,9 +2061,15 @@
 	return __register_serial(req, -1);
 }
 
-int __init early_serial_setup(struct serial_struct *req)
+int __init early_register_port(struct uart_port *port)
 {
-	__register_serial(req, req->line);
+	if (port->line >= ARRAY_SIZE(serial8250_ports))
+		return -ENODEV;
+
+	serial8250_isa_init_ports();    /* force ISA defaults */
+	serial8250_ports[port->line].port = *port;
+	serial8250_ports[port->line].port.ops = &serial8250_pops;
+
 	return 0;
 }
 

===== include/linux/serial.h 1.8 vs edited =====

include/linux/serial.h +3 -1
@@ -180,8 +180,10 @@
 extern int register_serial(struct serial_struct *req);
 extern void unregister_serial(int line);
 
+struct uart_port;
+
 /* Allow complicated architectures to specify rs_table[] at run time */
-extern int early_serial_setup(struct serial_struct *req);
+extern int early_register_port(struct uart_port *port);
 
 #ifdef CONFIG_ACPI
 /* tty ports reserved for the ACPI serial console port and debug port */
#1 lore raw
Quoted 1 line · Matt Porter

Linus, please apply.

Umm, isn't Russell the serial maintainer? I think you should discuss changes in that area with him.. (And I remember having sent him a similar patch..)

#2 lore raw
Quoted 6 lines · Christoph Hellwig
Quoted 1 line · Matt Porter

Linus, please apply.

Umm, isn't Russell the serial maintainer? I think you should discuss changes in that area with him.. (And I remember having sent him a similar patch..)

Well, I didn't mention that I first sent this to him more than two months ago. He hasn't had time to reply about it so it may be that he's not actively maintaining the serial driver. Queried a couple more times with no reply. This is the next stop.

BTW, in the original thread, David M. seemed to indicate that Russell was in support of this FWIW.

Regards,

Signature · 2 lines
Matt Porter
[email protected]
#3 lore raw
Quoted 4 lines · Matt Porter
Quoted 3 lines · Christoph Hellwig
Quoted 1 line · Matt Porter

Linus, please apply.

Quoted 8 lines
Quoted 3 lines

Umm, isn't Russell the serial maintainer? I think you should discuss changes in that area with him.. (And I remember having sent him a similar patch..)

Well, I didn't mention that I first sent this to him more than two months ago. He hasn't had time to reply about it so it may be that he's not actively maintaining the serial driver. Queried a couple more times with no reply. This is the next stop.

Sigh, there seems to be one cset still pending in my serial BK tree:

[email protected], 2003-05-14 16:50:47+02:00, [email protected]
acpi serial stuff

I'll request Linus pulls this tonight.

Signature · 2 lines
Russell King ([email protected])                The developer of ARM Linux
             http://www.arm.linux.org.uk/personal/aboutme.html
#4 lore raw
Quoted 6 lines · Russell King

Sigh, there seems to be one cset still pending in my serial BK tree:

[email protected], 2003-05-14 16:50:47+02:00, [email protected]
acpi serial stuff

I'll request Linus pulls this tonight.

FYI, its still sitting here...

Signature · 2 lines
Russell King ([email protected])                The developer of ARM Linux
             http://www.arm.linux.org.uk/personal/aboutme.html
#5 lore raw
Quoted 9 lines · Russell King
Quoted 6 lines · Russell King

Sigh, there seems to be one cset still pending in my serial BK tree:

[email protected], 2003-05-14 16:50:47+02:00, [email protected]
acpi serial stuff

I'll request Linus pulls this tonight.

FYI, its still sitting here...

Linus pulled it, but added an extra cset:

1.1311 Remove strange and broken ACPI rule from serial Makefile

drivers/serial/Makefile +0 -1
diff -Nru a/drivers/serial/Makefile b/drivers/serial/Makefile
@@ -8,7 +8,6 @@
 serial-8250-$(CONFIG_GSC) += 8250_gsc.o
 serial-8250-$(CONFIG_PCI) += 8250_pci.o
 serial-8250-$(CONFIG_PNP) += 8250_pnp.o
-serial-8250-$(CONFIG_ACPI) += acpi.o
 serial-8250-$(CONFIG_SERIAL_HCDP) += 8250_hcdp.o
 
 obj-$(CONFIG_SERIAL_CORE) += core.o

The file is actually called "8250_acpi.o".

Can you guys ensure that the patch and code works and send an update direct to Linus please?

Unfortunately, its too late for 2.5.71.

Signature · 2 lines
Russell King ([email protected])                The developer of ARM Linux
             http://www.arm.linux.org.uk/personal/aboutme.html
#6 lore raw
In reply to Matt Porter
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line · Matt Porter

Matt> Linus, please apply.
Matt> This has been discussed in a previous thread originated by David Matt> Mosberger. This removed early_serial_setup() in favor of a Matt> working early_port_register() call. Many PPC systems rely on Matt> this functionality and are currently hacking around it in the Matt> PPC devel tree. Last I looked, IA64 still had this in their Matt> devel tree too.

Absolutely. I was planning to resubmit it, but you beat me to it (and I'm happy you did; one less thing to worry about... ;-).

	--david
#7 lore raw
In reply to Matt Porter
Quoted 6 lines · Matt Porter

This has been discussed in a previous thread originated by David Mosberger. This removed early_serial_setup() in favor of a working early_port_register() call. Many PPC systems rely on this functionality and are currently hacking around it in the PPC devel tree. Last I looked, IA64 still had this in their devel tree too.

I'm not sure if this is related to recent TTY changes or not, but this does bring up a small 'issue'. To get at uart_port, you need <linux/serial_core.h>, which currently requires but does not #include <linux/tty.h>. But I haven't been following close enough to know if this is new breakage due to TTY changes or just no one had done linux/serial_core.h w/o linux/tty.h before..

Signature · 2 lines
Tom Rini
http://gate.crashing.org/~trini/