Commit 5d713dd5 authored by Bjorn Helgaas's avatar Bjorn Helgaas Committed by Russell King

[SERIAL] Make serial console work for any port (take 2)

The current serial console code only works for ports that are either
defined in SERIAL_PORT_DFNS (and set up by serial8250_isa_init_ports())
or registered by early_serial_setup().

On ia64, SERIAL_PORT_DFNS is empty because we discover everything
via ACPI and PCI.  And we only use early_serial_setup() for one port
described by the HCDP firmware table.

This patch against 2.6.4-rc1 makes it work for any valid port.  If we
don't know about the port early, we just return -ENODEV from the
setup() function, which leaves the serial console disabled.  After the
driver has found all the ports, we try to register the serial console
again if it hasn't been enabled already.

Keith Owens noticed that the first version of this patch broke some
serial console setups because many early serial ports are registered
with "type == PORT_UNKNOWN".  So this version tests "port->ops"
instead, and Keith has confirmed that this works for him.
parent b02a51da
...@@ -1976,7 +1976,7 @@ static int __init serial8250_console_setup(struct console *co, char *options) ...@@ -1976,7 +1976,7 @@ static int __init serial8250_console_setup(struct console *co, char *options)
if (co->index >= UART_NR) if (co->index >= UART_NR)
co->index = 0; co->index = 0;
port = &serial8250_ports[co->index].port; port = &serial8250_ports[co->index].port;
if (port->type == PORT_UNKNOWN) if (!port->ops)
return -ENODEV; return -ENODEV;
/* /*
......
...@@ -1874,9 +1874,6 @@ uart_set_options(struct uart_port *port, struct console *co, ...@@ -1874,9 +1874,6 @@ uart_set_options(struct uart_port *port, struct console *co,
if (flow == 'r') if (flow == 'r')
termios.c_cflag |= CRTSCTS; termios.c_cflag |= CRTSCTS;
if (!port->ops)
return 0; /* "console=" on ia64 */
port->ops->set_termios(port, &termios, NULL); port->ops->set_termios(port, &termios, NULL);
co->cflag = termios.c_cflag; co->cflag = termios.c_cflag;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment