diff options
author | Russell King <rmk@dyn-67.arm.linux.org.uk> | 2005-07-03 16:05:45 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2005-07-03 16:05:45 -0400 |
commit | 976ecd12b8144d066a23fe97c6fbfc1ac8470af7 (patch) | |
tree | 3305e7d5ba95d3005a8b213dd2c211a632844768 | |
parent | 1d6bebf2ecf92924492c491d9c3a72edba95f907 (diff) |
[PATCH] Serial: Fix console port spinlock initialisation
Initialise the spinlock for port being used by the console early, but
don't re-initialise it again later.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
-rw-r--r-- | drivers/serial/serial_core.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/drivers/serial/serial_core.c b/drivers/serial/serial_core.c index 139863a787f3..54699c3a00ab 100644 --- a/drivers/serial/serial_core.c +++ b/drivers/serial/serial_core.c | |||
@@ -1808,6 +1808,12 @@ uart_set_options(struct uart_port *port, struct console *co, | |||
1808 | struct termios termios; | 1808 | struct termios termios; |
1809 | int i; | 1809 | int i; |
1810 | 1810 | ||
1811 | /* | ||
1812 | * Ensure that the serial console lock is initialised | ||
1813 | * early. | ||
1814 | */ | ||
1815 | spin_lock_init(&port->lock); | ||
1816 | |||
1811 | memset(&termios, 0, sizeof(struct termios)); | 1817 | memset(&termios, 0, sizeof(struct termios)); |
1812 | 1818 | ||
1813 | termios.c_cflag = CREAD | HUPCL | CLOCAL; | 1819 | termios.c_cflag = CREAD | HUPCL | CLOCAL; |
@@ -2196,10 +2202,16 @@ int uart_add_one_port(struct uart_driver *drv, struct uart_port *port) | |||
2196 | 2202 | ||
2197 | state->port = port; | 2203 | state->port = port; |
2198 | 2204 | ||
2199 | spin_lock_init(&port->lock); | ||
2200 | port->cons = drv->cons; | 2205 | port->cons = drv->cons; |
2201 | port->info = state->info; | 2206 | port->info = state->info; |
2202 | 2207 | ||
2208 | /* | ||
2209 | * If this port is a console, then the spinlock is already | ||
2210 | * initialised. | ||
2211 | */ | ||
2212 | if (!uart_console(port)) | ||
2213 | spin_lock_init(&port->lock); | ||
2214 | |||
2203 | uart_configure_port(drv, state, port); | 2215 | uart_configure_port(drv, state, port); |
2204 | 2216 | ||
2205 | /* | 2217 | /* |