From: Bjorn Helgaas <bjorn.helgaas@hp.com>
To: Russell King <rmk@arm.linux.org.uk>
Cc: linux-kernel@vger.kernel.org, Keith Owens <kaos@sgi.com>
Subject: [PATCH] Make serial console work for any port (take 2)
Date: Thu, 4 Mar 2004 09:48:00 -0700 [thread overview]
Message-ID: <200403040948.00936.bjorn.helgaas@hp.com> (raw)
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.
===== drivers/serial/8250.c 1.45 vs edited =====
--- 1.45/drivers/serial/8250.c Mon Feb 16 17:20:22 2004
+++ edited/drivers/serial/8250.c Tue Mar 2 14:24:04 2004
@@ -1976,6 +1976,8 @@
if (co->index >= UART_NR)
co->index = 0;
port = &serial8250_ports[co->index].port;
+ if (!port->ops)
+ return -ENODEV;
/*
* Temporary fix.
@@ -2006,6 +2008,14 @@
return 0;
}
console_initcall(serial8250_console_init);
+
+static int __init serial8250_late_console_init(void)
+{
+ if (!(serial8250_console.flags & CON_ENABLED))
+ register_console(&serial8250_console);
+ return 0;
+}
+late_initcall(serial8250_late_console_init);
#define SERIAL8250_CONSOLE &serial8250_console
#else
===== drivers/serial/serial_core.c 1.81 vs edited =====
--- 1.81/drivers/serial/serial_core.c Sat Feb 21 15:42:50 2004
+++ edited/drivers/serial/serial_core.c Tue Mar 2 14:17:22 2004
@@ -1874,9 +1874,6 @@
if (flow == 'r')
termios.c_cflag |= CRTSCTS;
- if (!port->ops)
- return 0; /* "console=" on ia64 */
-
port->ops->set_termios(port, &termios, NULL);
co->cflag = termios.c_cflag;
reply other threads:[~2004-03-04 16:48 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200403040948.00936.bjorn.helgaas@hp.com \
--to=bjorn.helgaas@hp.com \
--cc=kaos@sgi.com \
--cc=linux-kernel@vger.kernel.org \
--cc=rmk@arm.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®