diff options
-rw-r--r-- | drivers/serial/8250.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/serial/8250.c b/drivers/serial/8250.c index e001ea0606ec..bbf78aaf9e01 100644 --- a/drivers/serial/8250.c +++ b/drivers/serial/8250.c | |||
@@ -2235,10 +2235,17 @@ static void | |||
2235 | serial8250_console_write(struct console *co, const char *s, unsigned int count) | 2235 | serial8250_console_write(struct console *co, const char *s, unsigned int count) |
2236 | { | 2236 | { |
2237 | struct uart_8250_port *up = &serial8250_ports[co->index]; | 2237 | struct uart_8250_port *up = &serial8250_ports[co->index]; |
2238 | unsigned long flags; | ||
2238 | unsigned int ier; | 2239 | unsigned int ier; |
2240 | int locked = 1; | ||
2239 | 2241 | ||
2240 | touch_nmi_watchdog(); | 2242 | touch_nmi_watchdog(); |
2241 | 2243 | ||
2244 | if (oops_in_progress) { | ||
2245 | locked = spin_trylock_irqsave(&up->port.lock, flags); | ||
2246 | } else | ||
2247 | spin_lock_irqsave(&up->port.lock, flags); | ||
2248 | |||
2242 | /* | 2249 | /* |
2243 | * First save the IER then disable the interrupts | 2250 | * First save the IER then disable the interrupts |
2244 | */ | 2251 | */ |
@@ -2257,6 +2264,9 @@ serial8250_console_write(struct console *co, const char *s, unsigned int count) | |||
2257 | */ | 2264 | */ |
2258 | wait_for_xmitr(up, BOTH_EMPTY); | 2265 | wait_for_xmitr(up, BOTH_EMPTY); |
2259 | serial_out(up, UART_IER, ier); | 2266 | serial_out(up, UART_IER, ier); |
2267 | |||
2268 | if (locked) | ||
2269 | spin_unlock_irqrestore(&up->port.lock, flags); | ||
2260 | } | 2270 | } |
2261 | 2271 | ||
2262 | static int serial8250_console_setup(struct console *co, char *options) | 2272 | static int serial8250_console_setup(struct console *co, char *options) |